Skip to content

blockifier_reexecution: extract contract_class_mapping_dumper into ConsecutiveRpcStateReaders#13741

Merged
AvivYossef-starkware merged 1 commit intomain-v0.14.2from
aviv/reexecution-dumper-arc
Apr 14, 2026
Merged

blockifier_reexecution: extract contract_class_mapping_dumper into ConsecutiveRpcStateReaders#13741
AvivYossef-starkware merged 1 commit intomain-v0.14.2from
aviv/reexecution-dumper-arc

Conversation

@AvivYossef-starkware
Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review April 13, 2026 12:48
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 13, 2026

PR Summary

Medium Risk
Medium risk because it changes how the contract-class mapping used for offline reexecution dumps is retained and consumed; mistakes could lead to missing mappings or panics during dump serialization.

Overview
Refactors offline reexecution dumping to store the contract_class_mapping_dumper directly on ConsecutiveRpcStateReaders, cloning the same Arc<Mutex<...>> from the initially-created last_block_state_reader.

When writing block reexecution data, the code now clones this Arc before self is consumed and then moves the mapping out via take() (instead of retrieving/cloning it through the nested block_state reader), ensuring the collected contract classes are captured for serialization without extra clones.

Reviewed by Cursor Bugbot for commit 1614cea. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Collaborator

@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.

@Yoni-Starkware made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on AvivYossef-starkware and noaov1).


crates/blockifier_reexecution/src/state_reader/rpc_state_reader.rs line 708 at r1 (raw file):

        let serializable_data_prev_block = SerializableDataPrevBlock {
            state_maps: block_state.get_initial_reads().unwrap(),
            contract_class_mapping: contract_class_mapping_dumper.lock().unwrap().clone().unwrap(),

Why do you need this additional clone?

Code quote:

er.lock().unwrap().clone().unwrap()

@graphite-app graphite-app Bot changed the base branch from aviv/reexecution-prefetched-state-reader to main-v0.14.2 April 14, 2026 11:27
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/reexecution-dumper-arc branch from f51f1f6 to 1614cea Compare April 14, 2026 11:32
Copy link
Copy Markdown
Contributor Author

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

@AvivYossef-starkware made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on noaov1 and Yoni-Starkware).


crates/blockifier_reexecution/src/state_reader/rpc_state_reader.rs line 708 at r1 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Why do you need this additional clone?

We can take it here since it's the end of its use,

Copy link
Copy Markdown
Collaborator

@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.

:lgtm:

@Yoni-Starkware reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on noaov1).

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main-v0.14.2 with commit c9f9c37 Apr 14, 2026
22 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants