apollo_consensus_orchestrator: add SNIP-35 fee_proposal validation#13819
Conversation
e61ede6 to
fec5e8d
Compare
6bd60bb to
8020f60
Compare
8020f60 to
c410076
Compare
dcf0feb to
4ddb820
Compare
938efa4 to
61da281
Compare
436ef14 to
b4e3014
Compare
61da281 to
b64fa48
Compare
b4e3014 to
683d6d0
Compare
b64fa48 to
4ddafee
Compare
683d6d0 to
d7db64a
Compare
433b30d to
24e6abc
Compare
d7db64a to
06aeda9
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
@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
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama resolved 3 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on sirandreww-starkware).
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@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
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 4 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).

No description provided.