Skip to content

Conversation

@ArielElp
Copy link
Contributor

@ArielElp ArielElp commented Feb 10, 2026

Note

Medium Risk
Touches consensus-critical identifiers used to correlate proposals between batcher and orchestrator; mismatches or storage gaps in partial hash components could break proposal validation/parent linkage despite largely mechanical refactors.

Overview
Switches consensus proposal identification from a state_diff_commitment to a partial block hash (ProposalCommitment.partial_block_hash) across apollo_batcher, apollo_batcher_types, and the consensus orchestrator.

Batcher now caches and serves the parent proposal commitment by computing PartialBlockHash from stored PartialBlockHashComponents (via get_parent_hash_and_partial_block_hash_components) and sets prev_proposal_commitment during commit only when partial components are present; block building also derives the commitment from PartialBlockHashComponents instead of reading the state-diff commitment directly. Tests are updated accordingly, including new storage-reader expectations for retrieving partial block hash components.

Written by Cursor Bugbot for commit ea9afdf. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
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.

@ArielElp ArielElp marked this pull request as ready for review February 10, 2026 11:56
Copy link

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

})?,
},
));
}
Copy link

Choose a reason for hiding this comment

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

Setting cache before commit causes panic on retry

Medium Severity

self.prev_proposal_commitment is now set before commit_proposal writes to storage, whereas the old code set it after. If commit_proposal fails and returns an error, prev_proposal_commitment already holds Some((height, ...)) for the uncommitted height. On a retry of decision_reached for the same height, get_parent_proposal_commitment finds this stale entry with h == height but needs prev_height == height - 1, triggering the assert_eq! and panicking.

Additional Locations (1)

Fix in Cursor Fix in Web

@ArielElp ArielElp force-pushed the ariel/consensus_over_partial_block_hash branch from 52ea950 to 542b7ae Compare February 10, 2026 14:34
@ArielElp ArielElp force-pushed the ariel/partial_block_hash_definition branch from 71a6a74 to 9d1db12 Compare February 10, 2026 15:14
@ArielElp ArielElp force-pushed the ariel/consensus_over_partial_block_hash branch from 542b7ae to 5b8cbdd Compare February 10, 2026 15:14
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Artifacts upload workflows:

@ArielElp ArielElp force-pushed the ariel/consensus_over_partial_block_hash branch from 5b8cbdd to f9dab0e Compare February 10, 2026 15:21
@ArielElp ArielElp force-pushed the ariel/partial_block_hash_definition branch from 9d1db12 to fc53903 Compare February 10, 2026 15:21
@ArielElp ArielElp force-pushed the ariel/consensus_over_partial_block_hash branch from f9dab0e to ea9afdf Compare February 10, 2026 15:23
@ArielElp ArielElp force-pushed the ariel/partial_block_hash_definition branch from fc53903 to e529641 Compare February 10, 2026 15:23
Copy link

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

state_diff.deprecated_declared_classes = Vec::new();
})?;
let components =
components.expect("Missing partial block hash components for previous height.");
Copy link

Choose a reason for hiding this comment

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

Panic on cache miss for ParentHash blocks

Low Severity

When prev_proposal_commitment is None (e.g. after node restart), get_parent_proposal_commitment falls back to reading from storage. For blocks stored via StorageCommitmentBlockHash::ParentHash (pre-0.13.2 synced blocks), get_parent_hash_and_partial_block_hash_components returns None for the components, and the .expect(...) panics. The old code gracefully handled all block types by reading the state diff with get_state_diff and computing the hash from it.

Fix in Cursor Fix in Web

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.

2 participants