Skip to content

apollo_consensus_orchestrator: wire SNIP-35 fee_proposal into build_proposal#13818

Merged
ShahakShama merged 1 commit into
mainfrom
04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal
May 24, 2026
Merged

apollo_consensus_orchestrator: wire SNIP-35 fee_proposal into build_proposal#13818
ShahakShama merged 1 commit into
mainfrom
04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal

Conversation

@sirandreww-starkware
Copy link
Copy Markdown
Contributor

No description provided.

@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 972c17d to 146f67d Compare May 4, 2026 11:14
Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware made 1 comment.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on ShahakShama).


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 34 at r2 (raw file):

/// Target USD cost per L2 gas unit in atto-USD ($3e-9 = 3_000_000_000 atto-USD).
pub(crate) const TARGET_ATTO_USD_PER_L2_GAS: u128 = 3_000_000_000;

add a TODO to make this a dynamic config

Code quote:

TARGET_ATTO_USD_PER_L2_GAS

@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_wire_snip-35_fee_proposal_into_build_proposal branch from 592c2d8 to 3605b81 Compare May 4, 2026 13:20
Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 4 files and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 34 at r2 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

add a TODO to make this a dynamic config

Add it


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 31 at r5 (raw file):

pub(crate) const FEE_PROPOSAL_WINDOW_SIZE: usize = 10;

/// Maximum fee_proposal change per block in parts per thousand (SNIP-35: 0.2%).

Add TODO to consider moving to versioned constants


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 37 at r5 (raw file):

pub(crate) const TARGET_ATTO_USD_PER_L2_GAS: u128 = 3_000_000_000;

/// Hard minimum for the oracle-derived floor (FRI).

Get it from versioned constants instead (it's already there)


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 408 at r5 (raw file):

        // compute_fee_actual returns None for zero median or insufficient data, falling back to
        // the current l2_gas_price. This ensures proposer and validator use the same fallback.
        let fee_actual = self.compute_fee_actual().unwrap_or(self.l2_gas_price);

Shouldn't you output fee_actual as well for the batcher?

Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 2 files and all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on sirandreww-starkware).

Comment thread crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs Outdated
Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware made 4 comments.
Reviewable status: 0 of 6 files reviewed, 4 unresolved discussions (waiting on ShahakShama).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 408 at r5 (raw file):

Previously, ShahakShama wrote…

Shouldn't you output fee_actual as well for the batcher?

Decided to take it as an input here and to calculate it outside this function


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 34 at r2 (raw file):

Previously, ShahakShama wrote…

Add it

Done.


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 31 at r5 (raw file):

Previously, ShahakShama wrote…

Add TODO to consider moving to versioned constants

Done.


crates/apollo_consensus_orchestrator/src/snip35/mod.rs line 37 at r5 (raw file):

Previously, ShahakShama wrote…

Get it from versioned constants instead (it's already there)

I decided to remove this clamping since it's not actually in the SNIP I just added because I thought it would somehow be "safer"

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 3df8374. Configure here.

Comment thread crates/apollo_consensus_orchestrator/src/snip35/mod.rs Outdated
Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 6 files and all commit messages, made 3 comments, and resolved 4 discussions.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context_test.rs line 1683 at r10 (raw file):

)]
#[tokio::test]
async fn test_compute_snip35_fee_proposal(

Add a test where the rate changes mid run


crates/apollo_consensus_orchestrator/src/snip35/test.rs line 33 at r10 (raw file):

#[rstest]
// Heights [0, 9] needed for fee_actual at height 10; height 5 is missing.

The bahaviour here should be return none or panic?

Comment thread crates/apollo_consensus_orchestrator/src/snip35/mod.rs Outdated
Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware made 3 comments.
Reviewable status: 2 of 6 files reviewed, 3 unresolved discussions (waiting on ShahakShama).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context_test.rs line 1683 at r10 (raw file):

Previously, ShahakShama wrote…

Add a test where the rate changes mid run

Done.


crates/apollo_consensus_orchestrator/src/snip35/test.rs line 33 at r10 (raw file):

Previously, ShahakShama wrote…

The bahaviour here should be return none or panic?

I tend to think we should warn instead of panic (does not add complexity to the code and prevents unexpected issues from making the node useless).
If we were to change this to a panic, then I think it should be done by expecting on the result instead
What do you say?

Comment thread crates/apollo_consensus_orchestrator/src/snip35/mod.rs Outdated
Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 3 files and all commit messages, made 2 comments, and resolved 2 discussions.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context_test.rs line 1683 at r10 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

Done.

No. I meant a test where the oracle returns at first x and then y


crates/apollo_consensus_orchestrator/src/snip35/test.rs line 33 at r10 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

I tend to think we should warn instead of panic (does not add complexity to the code and prevents unexpected issues from making the node useless).
If we were to change this to a panic, then I think it should be done by expecting on the result instead
What do you say?

ok

Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama resolved 1 discussion.
Reviewable status: 5 of 6 files reviewed, all discussions resolved (waiting on sirandreww-starkware).

Copy link
Copy Markdown
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

:lgtm:

@ShahakShama reviewed 1 file and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).

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.

3 participants