Skip to content

blockifier_reexecution: add PrefetchedStateReader and move from starknet_transaction_prover#13654

Merged
AvivYossef-starkware merged 1 commit intomain-v0.14.2from
aviv/reexecution-prefetched-state-reader
Apr 14, 2026
Merged

blockifier_reexecution: add PrefetchedStateReader and move from starknet_transaction_prover#13654
AvivYossef-starkware merged 1 commit intomain-v0.14.2from
aviv/reexecution-prefetched-state-reader

Conversation

@AvivYossef-starkware
Copy link
Copy Markdown
Contributor

@AvivYossef-starkware AvivYossef-starkware commented Apr 5, 2026

Move the prefetched state reader and initial_reads deserialization utilities
from starknet_transaction_prover into blockifier_reexecution so both crates
share a single implementation. starknet_transaction_prover now imports
PrefetchedStateReader and deserialize_rpc_initial_reads from
blockifier_reexecution, and the local serde_utils module + SimulatedStateReader
are deleted.

Made-with: Cursor


Note

Medium Risk
Moves and rewires simulate-based state prefetch used during transaction execution/proving; mistakes could cause extra RPC fallbacks or incorrect cached reads in a critical execution path. Scope is contained but touches state-reading and RPC integration.

Overview
Centralizes simulate-based state prefetch in blockifier_reexecution by introducing prefetched_state_reader (SimulatedStateReader, simulate_and_get_initial_reads, and initial_reads deserialization) and adding a dedicated PrefetchState error variant.

starknet_transaction_prover now imports and uses this shared implementation for prefetch_state execution, and deletes its local serde_utils, duplicated SimulatedStateReader, and the old simulate/prefetch unit test (replaced with a new mock-based test in blockifier_reexecution).

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/reexecution-prefetched-state-reader branch 4 times, most recently from 835ad9b to 76f6139 Compare April 6, 2026 08:23
@AvivYossef-starkware AvivYossef-starkware changed the base branch from main to graphite-base/13654 April 8, 2026 08:07
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/reexecution-prefetched-state-reader branch from 76f6139 to 5b6e2a8 Compare April 8, 2026 08:28
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/13654 to main-v0.14.2 April 8, 2026 08:28
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/reexecution-prefetched-state-reader branch 2 times, most recently from e10ac13 to 528037f Compare April 9, 2026 12:37
@AvivYossef-starkware AvivYossef-starkware changed the title blockifier_reexecution: add PrefetchedStateReader and move deser utils from starknet_transaction_prover blockifier_reexecution: add PrefetchedStateReader and move from starknet_transaction_prover Apr 9, 2026
@AvivYossef-starkware AvivYossef-starkware marked this pull request as ready for review April 12, 2026 08:15
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/reexecution-prefetched-state-reader branch from 528037f to a1ace29 Compare April 13, 2026 09:53
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 13, 2026

PR Summary

Medium Risk
Moves and rewires simulate-based state prefetching used during transaction proving, which can impact execution correctness/performance if the RPC response shape/flags or fallback behavior differs. Changes are localized but touch core state-reading paths and error handling for simulation failures.

Overview
Adds a shared prefetched_state_reader module to blockifier_reexecution, including SimulatedStateReader, simulate_and_get_initial_reads, and initial_reads deserialization (with RPC fallback reads and a new ReexecutionError::PrefetchState for simulation failures).

Updates starknet_transaction_prover’s virtual block executor to import and use this shared prefetch implementation (passing validate_txs through), and removes the prover’s duplicated serde_utils, local SimulatedStateReader, and the standalone simulate unit test in favor of new focused tests in blockifier_reexecution.

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

Copy link
Copy Markdown
Contributor

@einat-starkware einat-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:

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

@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 e9dc327 Apr 14, 2026
28 of 30 checks passed
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