Skip to content

Conversation

@Yoni-Starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @noaov1)


crates/blockifier/src/bouncer_test.rs line 457 at r1 (raw file):

                527194,
            ),
        }

We have two acesses, one of the is write. So we saved one traversal:

In [2]: 702922 - (1 * 5722 + 100 * 16) * 24
Out[2]: 527194

In [3]: 542410 - (1 * 4050 + 100 * 16) * 24
Out[3]: 406810

Code quote:

    expect![
        r#"
        BouncerWeights {
            l1_gas: 10,
            message_segment_length: 10,
            n_events: 10,
            state_diff_size: 14,
            sierra_gas: GasAmount(
                406810,
            ),
            n_txs: 20,
            proving_gas: GasAmount(
                527194,
            ),
        }

@github-actions
Copy link

github-actions bot commented Nov 11, 2025

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@dorimedini-starkware reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)


crates/blockifier/src/bouncer.rs line 852 at r1 (raw file):

        n_visited_storage_entries,
        // TODO(Yoni) consider counting here the global contract tree and the aliases as well.
        state_changes_keys.storage_keys.len(),

this includes aliases? we can ignore the block hash update I guess but we can't ignore aliases

Code quote:

state_changes_keys.storage_keys.len(),

Copy link
Collaborator Author

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)


crates/blockifier/src/bouncer.rs line 852 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this includes aliases? we can ignore the block hash update I guess but we can't ignore aliases

No, it's not. I don't want to include it yet since it will double the estimation (alias access per every storage access).
We are already overshooting badly here. The alias is a special case, maybe I could estimate a multi-update there properly

@Yoni-Starkware Yoni-Starkware force-pushed the yoni/blockifier/update-patricia-resources-to-new-impl branch from 6197f25 to ef327fb Compare November 11, 2025 08:18
Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noaov1 reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)


crates/blockifier/src/bouncer.rs line 955 at r1 (raw file):

///   1. n_visited_storage_entries includes both read and write accesses, and may overlap with
///      n_modified_storage_entries (if the first access to a cell was write) and my not (if a
///      cell was read by a previous transaction and is now modified).

What about a write overlap? If a previous transaction has already written to that cell?

Suggestion:

///   1. n_visited_storage_entries includes both read and write accesses, and may overlap with
///      n_modified_storage_entries (if the first access to a cell was write) and may not (if a
///      cell was read by a previous transaction and is now modified).

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noaov1 reviewed 1 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)

@Yoni-Starkware Yoni-Starkware force-pushed the yoni/blockifier/update-patricia-resources-to-new-impl branch from ef327fb to 45e50a9 Compare November 11, 2025 08:52
Copy link
Collaborator Author

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @noaov1)


crates/blockifier/src/bouncer.rs line 955 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

What about a write overlap? If a previous transaction has already written to that cell?

I wouldn't appear in state_changes_keys. Only the first change is counted. We do not remove cancelled writes from it.

Update names and docs; hopefully, we won't fall into this hole in the future

@Yoni-Starkware Yoni-Starkware force-pushed the yoni/blockifier/update-patricia-resources-to-new-impl branch from 45e50a9 to f029374 Compare November 11, 2025 08:53
@Yoni-Starkware Yoni-Starkware force-pushed the yoni/blockifier/update-patricia-resources-to-new-impl branch from f029374 to f412c97 Compare November 11, 2025 08:54
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@noaov1 reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)

@Yoni-Starkware Yoni-Starkware added this pull request to the merge queue Nov 12, 2025
Merged via the queue into main-v0.14.1 with commit ec83746 Nov 12, 2025
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants