Skip to content

apollo_consensus_orchestrator: add SNIP-35 fee_proposal validation#13819

Merged
ShahakShama merged 1 commit into
mainfrom
04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation
May 25, 2026
Merged

apollo_consensus_orchestrator: add SNIP-35 fee_proposal validation#13819
ShahakShama merged 1 commit into
mainfrom
04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation

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 force-pushed the 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation branch from dcf0feb to 4ddb820 Compare May 3, 2026 13:11
@sirandreww-starkware sirandreww-starkware force-pushed the 05-03-apollo_consensus_orchestrator_include_fee_proposal_fri_in_proposal_commitment_hash branch from 938efa4 to 61da281 Compare May 3, 2026 14:34
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation branch 2 times, most recently from 436ef14 to b4e3014 Compare May 4, 2026 07:11
@sirandreww-starkware sirandreww-starkware force-pushed the 05-03-apollo_consensus_orchestrator_include_fee_proposal_fri_in_proposal_commitment_hash branch from 61da281 to b64fa48 Compare May 4, 2026 07:11
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation branch from b4e3014 to 683d6d0 Compare May 4, 2026 11:14
@sirandreww-starkware sirandreww-starkware force-pushed the 05-03-apollo_consensus_orchestrator_include_fee_proposal_fri_in_proposal_commitment_hash branch from b64fa48 to 4ddafee Compare May 4, 2026 11:14
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation branch from 683d6d0 to d7db64a Compare May 4, 2026 13:20
@sirandreww-starkware sirandreww-starkware force-pushed the 05-03-apollo_consensus_orchestrator_include_fee_proposal_fri_in_proposal_commitment_hash branch 2 times, most recently from 433b30d to 24e6abc Compare May 5, 2026 06:53
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_add_snip-35_fee_proposal_validation branch from d7db64a to 06aeda9 Compare May 5, 2026 06:53
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 5 comments.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context.rs line 837 at r2 (raw file):

                        .unwrap_or(self.l2_gas_price),
                    starknet_version: StarknetVersion::LATEST,
                    fee_actual: compute_fee_actual(&self.fee_proposals_window, init.height),

Why do you need to compute fee actual? What you need to compute is fee_actual_min and fee_actual_max


crates/apollo_consensus_orchestrator/src/test_utils.rs line 429 at r2 (raw file):

        starknet_version: starknet_api::block::StarknetVersion::LATEST,
        version_constant_commitment: Default::default(),
        // SNIP-35: required because LATEST >= V0_14_3. Match the proposer's default-fallback

No need for such a long comment. Just write the start:
// SNIP-35: required because LATEST >= V0_14_3. Match the proposer's default-fallback
// fee_proposal


crates/apollo_consensus_orchestrator/src/validate_proposal.rs line 81 at r2 (raw file):

    pub l2_gas_price_fri: GasPrice,
    pub starknet_version: StarknetVersion,
    /// SNIP-35: fee_actual from the sliding window. `None` during initiation, before the window

initiation's meaning is unclear


crates/apollo_consensus_orchestrator/src/validate_proposal.rs line 379 at r2 (raw file):

    }

    // SNIP-35: validate fee_proposal is within the configured margin of fee_actual.

As I said before, you shouldn't calculate margin from the fee actual you think should be based on your oracle. You should look at the max and min allowed


crates/apollo_consensus_orchestrator/src/validate_proposal_test.rs line 107 at r2 (raw file):

        l2_gas_price_fri: VersionedConstants::latest_constants().min_gas_price,
        starknet_version: StarknetVersion::LATEST,
        fee_actual: None,

Add TODO to test Some

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 3 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on sirandreww-starkware).

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 2 comments.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on ShahakShama).


crates/apollo_consensus_orchestrator/src/validate_proposal.rs line 81 at r2 (raw file):

Previously, ShahakShama wrote…

initiation's meaning is unclear

Done


crates/apollo_consensus_orchestrator/src/validate_proposal_test.rs line 107 at r2 (raw file):

Previously, ShahakShama wrote…

Add TODO to test Some

added a test instead of a TODO

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 4 files and all commit messages, made 1 comment, and resolved 2 discussions.
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