Skip to content

apollo_consensus_orchestrator: wire SNIP-35 fee_proposal into build_proposal#13818

Open
sirandreww-starkware wants to merge 1 commit into04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculationfrom
04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal
Open

apollo_consensus_orchestrator: wire SNIP-35 fee_proposal into build_proposal#13818
sirandreww-starkware wants to merge 1 commit into04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculationfrom
04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal

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 changed the base branch from 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposals_sliding_window to graphite-base/13818 April 19, 2026 17:43
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from e61ede6 to fec5e8d Compare April 19, 2026 17:43
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/13818 to 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation April 19, 2026 17:43
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 8ccdfc9 to fe3bed1 Compare April 23, 2026 11:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 01831f2 to e72260c Compare April 27, 2026 12:10
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch 2 times, most recently from 3fbc573 to 8842b22 Compare April 27, 2026 12:39
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch 2 times, most recently from 381d654 to 8fdc1e0 Compare April 27, 2026 12:54
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from 8842b22 to 1d1a4ac Compare April 27, 2026 12:54
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 8fdc1e0 to ed5cfb9 Compare April 28, 2026 07:38
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from 1d1a4ac to 1d52c47 Compare April 28, 2026 07:38
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from ed5cfb9 to e3c5db4 Compare April 28, 2026 07:51
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from 1d52c47 to dfeb913 Compare April 28, 2026 07:51
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from e3c5db4 to b59452c Compare April 28, 2026 08:30
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch 2 times, most recently from 8cf6fde to b15a802 Compare April 28, 2026 11:29
@sirandreww-starkware sirandreww-starkware self-assigned this Apr 28, 2026
@sirandreww-starkware sirandreww-starkware marked this pull request as ready for review April 28, 2026 12:28
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 28, 2026

PR Summary

Medium Risk
Touches consensus proposal-building and gas price adjustment paths; incorrect fee_proposal/fee_actual wiring or oracle fallback behavior could skew block headers and L2 gas pricing across nodes.

Overview
Wires SNIP-35 fees through proposal production: ProposalBuildArguments now carries fee_proposal and fee_actual, and build_proposal includes fee_proposal_fri in ProposalInit while using fee_actual as an additional floor when computing next_l2_gas_price.

SequencerConsensusContext now computes a per-block fee_proposal (using the STRK/USD oracle when available, otherwise freezing to fee_actual/current gas price), records SNIP-35 metrics, and persists the fee into state sync block headers. Test utilities are updated to populate the new build arguments, and snip35 adds constants for margin/target/oracle floor bounds used by the new computation.

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

@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 403f6c2 to 08c2f1e Compare April 30, 2026 11:45
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch 2 times, most recently from 0a69e61 to 5adf1d4 Compare April 30, 2026 12:25
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 128fd49 to b70aa35 Compare April 30, 2026 13:49
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from 5adf1d4 to 0b7d846 Compare April 30, 2026 13:49
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from b70aa35 to 4373775 Compare May 1, 2026 15:11
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch 3 times, most recently from d86d400 to f48b9c1 Compare May 1, 2026 15:59
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_fee_actual_floor_to_eip-1559_gas_price_calculation branch from 35a0ba2 to 90dacc3 Compare May 1, 2026 17:05
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from f48b9c1 to 78fa661 Compare May 1, 2026 17:05
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 78fa661. Configure here.

// TODO(Asmaa): Put the real value once we have it.
version_constant_commitment: Default::default(),
fee_proposal_fri: None,
fee_proposal_fri: Some(args.fee_proposal),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Propose and sync paths compute different block commitments

High Severity

Setting fee_proposal_fri to a non-zero value in ProposalInit and storing it in BlockHeaderWithoutHash creates a commitment mismatch between the propose and sync paths. During propose/validate, the batcher's PartialBlockHashComponents::new always uses GasPrice::default() (zero) for fee_proposal_fri when computing the commitment hash. But when a node syncs the same block, the batcher reconstructs PartialBlockHashComponents from the stored header using the actual non-zero value. Since fee_proposal_fri is part of the PartialBlockHash hash chain, these paths produce different ProposalCommitment values for the same block, corrupting prev_proposal_commitment on syncing nodes.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 78fa661. Configure here.

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