Skip to content

apollo_storage: add fee_proposal to StorageBlockHeader#13813

Closed
sirandreww-starkware wants to merge 1 commit into
04-19-starknet_api_add_fee_proposal_to_blockheaderwithouthashfrom
04-19-apollo_storage_add_fee_proposal_to_storageblockheader
Closed

apollo_storage: add fee_proposal to StorageBlockHeader#13813
sirandreww-starkware wants to merge 1 commit into
04-19-starknet_api_add_fee_proposal_to_blockheaderwithouthashfrom
04-19-apollo_storage_add_fee_proposal_to_storageblockheader

Conversation

@sirandreww-starkware
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor Author

sirandreww-starkware commented Apr 19, 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.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@sirandreww-starkware sirandreww-starkware removed the request for review from dorimedini-starkware April 26, 2026 13:33
@sirandreww-starkware sirandreww-starkware marked this pull request as ready for review April 26, 2026 13:33
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 26, 2026

PR Summary

Medium Risk
Changes the persisted block-header schema/serialization, which can break compatibility with existing on-disk data unless handled via migration/resync.

Overview
Adds fee_proposal (SNIP-35 recommended fee) to StorageBlockHeader and plumbs it through header read/write paths so append_header, get_block_header, and revert_header round-trip the value instead of defaulting it.

Updates storage serialization and test instance generation for StorageBlockHeader to include the new field, effectively extending the on-disk header schema.

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

pub state_diff_length: Option<usize>,
pub n_transactions: usize,
pub n_events: usize,
pub fee_proposal: GasPrice,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing storage version bump for format change

High Severity

Adding fee_proposal to StorageBlockHeader changes the binary serialization format (via auto_storage_serde), but STORAGE_VERSION_BLOCKS is not bumped. The VersionZeroWrapper deserializer reads fields sequentially and returns None when bytes are exhausted, so all block headers stored before this change will silently fail to deserialize. A major version bump is needed to force a re-sync.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a87a8b7. Configure here.

@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo branch from 910b0b7 to ee05c0f Compare April 26, 2026 16:24
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from a87a8b7 to 6a81e1f Compare April 26, 2026 16:24
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from 6a81e1f to a3ce4d7 Compare April 26, 2026 17:17
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo branch 2 times, most recently from 8097471 to f1086ad Compare April 27, 2026 08:06
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch 3 times, most recently from f9d4b4e to 8a9ab4a Compare April 27, 2026 10:37
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.

There are 2 total unresolved issues (including 1 from previous review).

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 8a9ab4a. Configure here.

/// The number of events in this block.
pub n_events: usize,
/// SNIP-35: proposer's oracle-derived recommended fee.
pub fee_proposal: GasPrice,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing storage version bump for schema change

High Severity

Adding fee_proposal: GasPrice to StorageBlockHeader changes the binary serialization format generated by auto_storage_serde!, but STORAGE_VERSION_BLOCKS in lib.rs is not bumped. Existing database records serialized without this field will fail to deserialize (the macro's deserialize_from returns None when bytes are exhausted), silently making all previously stored block headers unreadable. A major version bump is needed to force a re-sync for existing databases.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8a9ab4a. Configure here.

@sirandreww-starkware sirandreww-starkware changed the base branch from 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo to graphite-base/13813 April 27, 2026 11:03
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from 8a9ab4a to c8c52ab Compare April 27, 2026 11:30
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/13813 to 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo April 27, 2026 11:30
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from c8c52ab to cbbe1ae Compare April 27, 2026 11:51
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo branch from 75f5dc1 to bbe72c6 Compare April 27, 2026 12:39
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from cbbe1ae to 89a7e5c Compare April 27, 2026 12:39
@sirandreww-starkware sirandreww-starkware changed the base branch from 04-19-apollo_protobuf_add_fee_proposal_to_proposalinit_and_l2gasinfo to graphite-base/13813 April 27, 2026 12:54
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from 89a7e5c to 4b3cbc2 Compare April 27, 2026 12:54
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/13813 to 04-19-starknet_api_add_fee_proposal_to_blockheaderwithouthash April 27, 2026 12:54
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-starknet_api_add_fee_proposal_to_blockheaderwithouthash branch from 3b4a2a3 to c83c0d6 Compare April 28, 2026 07:38
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_storage_add_fee_proposal_to_storageblockheader branch from 4b3cbc2 to 3c1f7e9 Compare April 28, 2026 07:38
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 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.

2 participants