Skip to content

apollo_consensus_orchestrator: make SNIP-35 fee target a dynamic config#14220

Merged
sirandreww-starkware merged 1 commit into
main-v0.14.3from
05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config
May 28, 2026
Merged

apollo_consensus_orchestrator: make SNIP-35 fee target a dynamic config#14220
sirandreww-starkware merged 1 commit into
main-v0.14.3from
05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config

Conversation

@sirandreww-starkware

Copy link
Copy Markdown
Contributor

No description provided.

@sirandreww-starkware sirandreww-starkware self-assigned this May 27, 2026
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented May 27, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes consensus proposer fee targets and default economics ($3e-9 → $0.88 per 1e9 L2 gas atto-USD); misconfiguration could skew L2 base fees across the network.

Overview
Moves the SNIP-35 target USD cost per L2 gas from a hardcoded orchestrator constant to ContextDynamicConfig.snip35_target_atto_usd_per_l2_gas, so operators can tune it without a code change.

The proposer’s compute_proposer_fee_proposal now takes that value and build_proposal reads it from self.config.dynamic_config. The shared default is DEFAULT_SNIP35_TARGET_ATTO_USD_PER_L2_GAS (880_000_000 atto-USD), replacing the old compile-time 3_000_000_000 target. Deployment app configs and config_schema.json are updated to expose the new field (deployed value 880000000).

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

@matanl-starkware matanl-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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


crates/apollo_node/resources/config_schema.json line 2732 at r1 (raw file):

    "value": true
  },
  "consensus_manager_config.context_config.dynamic_config.snip35_target_atto_usd_per_l2_gas": {

You should run cargo run --bin deployment_generator

Code quote:

consensus_manager_config.context_config.dynamic_config.snip35_target_atto_usd_per_l2_gas

crates/apollo_node/resources/config_schema.json line 2736 at r1 (raw file):

    "privacy": "Public",
    "value": 880000000
  },

I think this value should be different per env. Make it env-dependent by using the $$$ replacer concept.

Code quote:

  },
  "consensus_manager_config.context_config.dynamic_config.snip35_target_atto_usd_per_l2_gas": {
    "description": "SNIP-35 target USD cost per L2 gas unit, in atto-USD ($0.88 per 1e9 L2 gas = 880_000_000 atto-USD).",
    "privacy": "Public",
    "value": 880000000
  },

@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from ecf68ca to 87e5f80 Compare May 27, 2026 13:53

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

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: 5 of 13 files reviewed, 2 unresolved discussions (waiting on matanl-starkware and sirandreww-starkware).


crates/apollo_node/resources/config_schema.json line 2732 at r1 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

You should run cargo run --bin deployment_generator

Done.


crates/apollo_node/resources/config_schema.json line 2736 at r1 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

I think this value should be different per env. Make it env-dependent by using the $$$ replacer concept.

Done
Would you like there to be different values now? Why do you suspect it should be different between envs?

@matanl-starkware matanl-starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@matanl-starkware reviewed 8 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).


crates/apollo_node/resources/config_schema.json line 2736 at r1 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

Done
Would you like there to be different values now? Why do you suspect it should be different between envs?

I guess POTC ans Starknet have a different price target.

@sirandreww-starkware sirandreww-starkware changed the base branch from 04-20-apollo_consensus_orchestrator_add_snip-35_proposer-validator_symmetry_tests to graphite-base/14220 May 27, 2026 14:05
@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from 87e5f80 to 4dea202 Compare May 27, 2026 14:08
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/14220 to main May 27, 2026 14:09
@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from 4dea202 to 5251011 Compare May 28, 2026 05:22

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

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: 8 of 15 files reviewed, 1 unresolved discussion (waiting on matanl-starkware and sirandreww-starkware).


crates/apollo_node/resources/config_schema.json line 2736 at r1 (raw file):

Previously, matanl-starkware (Matan Lior) wrote…

I guess POTC ans Starknet have a different price target.

asked Ohad, he said they override the value there

@ShahakShama ShahakShama left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ShahakShama reviewed 15 files and all commit messages, made 2 comments, resolved 1 discussion, and dismissed @matanl-starkware from a discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context_test.rs line 1688 at r3 (raw file):

    let mut context = deps.build_context();
    context.l2_gas_price = l2_gas_price;
    let proposal = context.compute_proposer_fee_proposal(fee_actual, 0, 3_000_000_000).await;

Extract to a constant


crates/apollo_deployments/src/service.rs line 71 at r3 (raw file):

    "consensus_manager_config.context_config.dynamic_config.override_l2_gas_price_fri.#is_none",
    "consensus_manager_config.context_config.dynamic_config.override_l2_gas_price_fri",
    "consensus_manager_config.context_config.dynamic_config.snip35_target_atto_usd_per_l2_gas",

I thought you said we don't want this here

@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from 5251011 to a16613e Compare May 28, 2026 08:00

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

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: 11 of 15 files reviewed, 2 unresolved discussions (waiting on matanl-starkware, ShahakShama, and sirandreww-starkware).


crates/apollo_consensus_orchestrator/src/sequencer_consensus_context_test.rs line 1688 at r3 (raw file):

Previously, ShahakShama wrote…

Extract to a constant

Done


crates/apollo_deployments/src/service.rs line 71 at r3 (raw file):

Previously, ShahakShama wrote…

I thought you said we don't want this here

will do in a future PR

@ShahakShama ShahakShama left a comment

Copy link
Copy Markdown
Collaborator

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, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).


crates/apollo_deployments/src/service.rs line 71 at r3 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

will do in a future PR

Do it here as discussed

@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from a16613e to 7da3e50 Compare May 28, 2026 08:05

@ShahakShama ShahakShama left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@ShahakShama reviewed 6 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on sirandreww-starkware).

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

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 and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).


crates/apollo_deployments/src/service.rs line 71 at r3 (raw file):

Previously, ShahakShama wrote…

Do it here as discussed

Done.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 7da3e50. Configure here.

@sirandreww-starkware sirandreww-starkware changed the base branch from main to graphite-base/14220 May 28, 2026 08:14
@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from 7da3e50 to 6bd9fa3 Compare May 28, 2026 08:14
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/14220 to main-v0.14.3 May 28, 2026 08:14
@sirandreww-starkware sirandreww-starkware force-pushed the 05-27-apollo_consensus_orchestrator_make_snip-35_fee_target_a_dynamic_config branch from 6bd9fa3 to 9f3c029 Compare May 28, 2026 08:17
@sirandreww-starkware sirandreww-starkware dismissed matanl-starkware’s stale review May 28, 2026 08:25

OOO, his comments were adressed

@sirandreww-starkware sirandreww-starkware left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@sirandreww-starkware reviewed 15 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).

@sirandreww-starkware sirandreww-starkware added this pull request to the merge queue May 28, 2026
Merged via the queue into main-v0.14.3 with commit 355dc80 May 28, 2026
27 checks passed
nimrod-starkware added a commit that referenced this pull request Jun 3, 2026
Resolve conflicts from merging main-v0.14.3 into main:
- Cargo.lock: take incoming (circuits 618db0a, hashbrown 0.17.1).
- apollo_consensus_orchestrator gas-price test: combine the SNIP-35 const
  rename (#14220) with the rand 0.10 API change (#14194).
- blockifier stack-trace fixture: drop the SierraGas VM-frame pc line,
  consistent with strip_vm_frames_in_sierra_gas at v0.14.3+ (#14251).
- blockifier_versioned_constants_0_14_4.json: add the required
  strip_vm_frames_in_sierra_gas field. Silent merge skew: the file was added
  by #14237 before #14251 made the field mandatory.
- proof_flow/proof.bin: regenerated under the v0.14.3 verifier (618db0a);
  verified by proof_flow_fixtures_verify and proof_flow_program_hash_is_allowed.
- central_systest_blobs generation: kept at 26; the cende blob must be
  regenerated+uploaded for the merged content (UPDATE_EXPECT needs GCS creds).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

4 participants