Skip to content

blockifier,blockifier_reexecution: opt out of OS read collection when replaying recorded state - #14907

Closed
itamar-starkware wants to merge 1 commit into
remove-os-input-featurefrom
fix-blockifier-reexecution-os-reads
Closed

blockifier,blockifier_reexecution: opt out of OS read collection when replaying recorded state#14907
itamar-starkware wants to merge 1 commit into
remove-os-input-featurefrom
fix-blockifier-reexecution-os-reads

Conversation

@itamar-starkware

Copy link
Copy Markdown
Contributor

No description provided.

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped to finalize-time initial_reads collection with production paths still using true; reexecution explicitly opts out to avoid incorrect extra reads.

Overview
Adds a collect_os_initial_reads switch on block finalization so callers can skip building the OS initial-read set when it would pollute replay against a partial state snapshot.

finalize_block now takes this flag: when enabled (normal finalize / close_block), behavior is unchanged and get_os_initial_reads() still runs; when disabled, initial_reads in BlockExecutionSummary is empty instead of triggering extra reads.

non_consuming_finalize(collect_os_initial_reads) threads the flag through for reexecution and tests. Block reexecution passes false so finalize does not read state beyond what the replay reader recorded; the cende blob regression path passes true to keep collecting reads for blob fixtures.

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

itamar-starkware commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

@yoavGrs yoavGrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@yoavGrs made 2 comments.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on itamar-starkware).


crates/blockifier/src/blockifier/transaction_executor.rs line 247 at r1 (raw file):

    block_state: &mut CachedState<S>,
    block_context: &BlockContext,
    collect_os_initial_reads: bool,

I'm looking for a way to enforce the collection of the initial reads in production by the compiler.
What about this?

pub enum OsReadsCollection {
    Collect,
    #[cfg(feature = "reexecution")]
    Skip,
}

Code quote:

collect_os_initial_reads: bool,

crates/central_systest_blobs/src/cende_blob_regression_test.rs line 339 at r1 (raw file):

                .push(InternalTransactionWithReceipt { transaction: internal, execution_info });
        }
        let summary = executor.non_consuming_finalize(true).unwrap();

Add TODO here, and please add it to Monday as well.

@itamar-starkware
itamar-starkware marked this pull request as ready for review August 2, 2026 11:50
@itamar-starkware

Copy link
Copy Markdown
Contributor Author

crates/blockifier/src/blockifier/transaction_executor.rs line 247 at r1 (raw file):

Previously, yoavGrs wrote…

I'm looking for a way to enforce the collection of the initial reads in production by the compiler.
What about this?

pub enum OsReadsCollection {
    Collect,
    #[cfg(feature = "reexecution")]
    Skip,
}

If enum with one option is working I think it's a good approach.

@itamar-starkware

Copy link
Copy Markdown
Contributor Author

crates/central_systest_blobs/src/cende_blob_regression_test.rs line 339 at r1 (raw file):

Previously, yoavGrs wrote…

Add TODO here, and please add it to Monday as well.

TODO of what?

@itamar-starkware
itamar-starkware force-pushed the fix-blockifier-reexecution-os-reads branch from 3d96f8b to 947e9c0 Compare August 2, 2026 12:55
@itamar-starkware
itamar-starkware changed the base branch from graphite-base/14907 to remove-os-input-feature August 2, 2026 12:55

@yoavGrs yoavGrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@yoavGrs made 1 comment.
Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on itamar-starkware).


a discussion (no related file):
Close this PR and review this: https://app.graphite.com/github/pr/starkware-libs/sequencer/14911

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.

3 participants