Skip to content

central_systest_blobs: implement blob creation from blocks#13967

Open
dorimedini-starkware wants to merge 1 commit into04-30-central_systest_blobs_implement_block_production_given_txsfrom
04-30-central_systest_blobs_implement_blob_creation_from_blocks
Open

central_systest_blobs: implement blob creation from blocks#13967
dorimedini-starkware wants to merge 1 commit into04-30-central_systest_blobs_implement_block_production_given_txsfrom
04-30-central_systest_blobs_implement_blob_creation_from_blocks

Conversation

@dorimedini-starkware
Copy link
Copy Markdown
Collaborator

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Collaborator Author

dorimedini-starkware commented May 5, 2026

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.

@cursor
Copy link
Copy Markdown

cursor Bot commented May 5, 2026

PR Summary

Medium Risk
Medium risk because it changes how test data is turned into BlobParameters/AerospikeBlob, including proposal/parent commitments and recent block hashes, which are consensus-adjacent invariants. Failures would primarily affect regression tests and blob fixture generation rather than production paths.

Overview
The regression test now builds real AerospikeBlobs from executed blocks instead of returning an empty blob list, by converting each finalized BlockData into BlobParameters and calling AerospikeBlob::from_blob_parameters_and_class_manager.

This adds block-linking metadata to the generated blob inputs (proposal commitment, optional parent proposal commitment, and recent_block_hashes containing only the previous block) and refactors preconfirmed-block construction to take explicit BlockContext/tx/state inputs while avoiding extra cloning.

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

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c0d0ac9. Configure here.

Comment thread crates/central_systest_blobs/src/cende_blob_regression_test.rs
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_blob_creation_from_blocks branch from c0d0ac9 to 0e56d10 Compare May 5, 2026 11:18
Copy link
Copy Markdown
Collaborator Author

@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 resolved 1 discussion.
Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on nimrod-starkware and yoavGrs).

@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_blob_creation_from_blocks branch from 0e56d10 to 99fd2d7 Compare May 5, 2026 11:56
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_block_production_given_txs branch from c72a3dc to 31f9d81 Compare May 5, 2026 11:56
Copy link
Copy Markdown
Contributor

@nimrod-starkware nimrod-starkware left a comment

Choose a reason for hiding this comment

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

@nimrod-starkware made 4 comments.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on dorimedini-starkware and yoavGrs).


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 132 at r2 (raw file):

impl From<BlockData> for BlobParameters {
    /// If this is not the first block, also sets the parent proposal commitment and populates the
    /// recent block hashes with the last block hash (of the previous block).

Suggestion:

    /// If this is not the first block, also sets the parent proposal commitment and populates the
    /// recent block hashes only with the hash of the previous block.

crates/central_systest_blobs/src/cende_blob_regression_test.rs line 134 at r2 (raw file):

    /// recent block hashes with the last block hash (of the previous block).
    fn from(block: BlockData) -> Self {
        let commitment_state_diff = CommitmentStateDiff::from(block.state_maps.clone());

works?

Suggestion:

let commitment_state_diff = CommitmentStateDiff::from(block.state_maps);

crates/central_systest_blobs/src/cende_blob_regression_test.rs line 163 at r2 (raw file):

        };

        BlobParameters {

Suggestion:

 Self {

crates/central_systest_blobs/src/cende_blob_regression_test.rs line 475 at r2 (raw file):

            transaction_receipts.push(Some(receipt));
            transaction_state_diffs.push(Some(tx_state_diff));
        }

The changes of these txs are not applied on the state (not even between txs), is this intentional?

Code quote:

        for (tx_index, (executable, internal)) in txs.into_iter().enumerate() {
            let tx_hash = match &internal {
                InternalConsensusTransaction::RpcTransaction(tx) => tx.tx_hash,
                InternalConsensusTransaction::L1Handler(_) => {
                    panic!("unexpected L1Handler in test")
                }
            };

            let mut tx_state = CachedState::new(state.clone());
            let execution_info = BlockifierAccountTx::new_for_sequencing(executable)
                .execute(&mut tx_state, &block_context)
                .unwrap();

            let state_changes = tx_state.to_state_diff().unwrap();

            let receipt = StarknetClientTransactionReceipt::from((
                tx_hash,
                TransactionOffsetInBlock(tx_index),
                &execution_info,
                None,
            ));
            let tx_state_diff = StarknetClientStateDiff::from(state_changes.state_maps).0;

            transactions.push(CendePreconfirmedTransaction::from(internal));
            transaction_receipts.push(Some(receipt));
            transaction_state_diffs.push(Some(tx_state_diff));
        }

@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_block_production_given_txs branch from 31f9d81 to b86febd Compare May 5, 2026 12:31
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_blob_creation_from_blocks branch from 99fd2d7 to 35f0f1b Compare May 5, 2026 12:31
Copy link
Copy Markdown
Collaborator Author

@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 made 4 comments.
Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on nimrod-starkware and yoavGrs).


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 134 at r2 (raw file):

Previously, nimrod-starkware wrote…

works?

no, there is no impl From<&StateMaps> for CommitmentStateDiff, only impl From<StateMaps> for CommitmentStateDiff


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 475 at r2 (raw file):

Previously, nimrod-starkware wrote…

The changes of these txs are not applied on the state (not even between txs), is this intentional?

discussed in the PR that added this function, and fixed there (not intentional)


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 132 at r2 (raw file):

impl From<BlockData> for BlobParameters {
    /// If this is not the first block, also sets the parent proposal commitment and populates the
    /// recent block hashes with the last block hash (of the previous block).

Done.


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 163 at r2 (raw file):

        };

        BlobParameters {

Done.

Copy link
Copy Markdown
Contributor

@nimrod-starkware nimrod-starkware left a comment

Choose a reason for hiding this comment

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

@nimrod-starkware made 2 comments and resolved 2 discussions.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware and yoavGrs).


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 132 at r2 (raw file):

Previously, dorimedini-starkware wrote…

Done.

almost :)


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 134 at r2 (raw file):

Previously, dorimedini-starkware wrote…

no, there is no impl From<&StateMaps> for CommitmentStateDiff, only impl From<StateMaps> for CommitmentStateDiff

If block is owned (and it is), then block.state_maps type should be StateMaps not &StateMaps... no?

@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_block_production_given_txs branch from b86febd to eb6a3de Compare May 5, 2026 14:17
@dorimedini-starkware dorimedini-starkware force-pushed the 04-30-central_systest_blobs_implement_blob_creation_from_blocks branch from 35f0f1b to 9c6fcc0 Compare May 5, 2026 14:17
Copy link
Copy Markdown
Collaborator Author

@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 made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on nimrod-starkware and yoavGrs).


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 132 at r2 (raw file):

Previously, nimrod-starkware wrote…

almost :)

whoops :P


crates/central_systest_blobs/src/cende_blob_regression_test.rs line 134 at r2 (raw file):

Previously, nimrod-starkware wrote…

If block is owned (and it is), then block.state_maps type should be StateMaps not &StateMaps... no?

right you are, of course!
done

Copy link
Copy Markdown
Contributor

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

@nimrod-starkware reviewed 1 file, made 1 comment, and resolved 2 discussions.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on yoavGrs).

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