Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/apollo_consensus_orchestrator/src/build_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ async fn initiate_build(args: &mut ProposalBuildArguments) -> BuildProposalResul
starknet_version: starknet_api::block::StarknetVersion::LATEST,
// TODO(Asmaa): Put the real value once we have it.
version_constant_commitment: Default::default(),
fee_proposal_fri: None,
};

let retrospective_block_hash = wait_for_retrospective_block_hash(
Expand Down
1 change: 1 addition & 0 deletions crates/apollo_consensus_orchestrator/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ pub(crate) fn proposal_init(height: BlockNumber, round: u32) -> ProposalInit {
l1_data_gas_price_wei,
starknet_version: starknet_api::block::StarknetVersion::LATEST,
version_constant_commitment: Default::default(),
fee_proposal_fri: None,
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/apollo_consensus_orchestrator/src/utils_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async fn get_proposal_init(args: &ProposalBuildArguments) -> ProposalInit {
l1_data_gas_price_fri: l1_prices_fri.l1_data_gas_price,
starknet_version: starknet_api::block::StarknetVersion::LATEST,
version_constant_commitment: Default::default(),
fee_proposal_fri: None,
}
}

Expand Down
4 changes: 4 additions & 0 deletions crates/apollo_protobuf/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ pub struct ProposalInit {
pub starknet_version: starknet_api::block::StarknetVersion,
/// Version constant commitment.
pub version_constant_commitment: StarkHash,
/// SNIP-35: proposer's oracle-derived recommended fee. Present iff
/// `starknet_version >= V0_14_3`.
pub fee_proposal_fri: Option<GasPrice>,
}

/// A temporary constant to use as a validator ID. Zero is not a valid contract address.
Expand Down Expand Up @@ -156,6 +159,7 @@ impl Default for ProposalInit {
l1_data_gas_price_wei: Default::default(),
starknet_version: starknet_api::block::StarknetVersion::LATEST,
version_constant_commitment: Default::default(),
fee_proposal_fri: Default::default(),
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/apollo_protobuf/src/converters/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ impl TryFrom<protobuf::ProposalInit> for ProposalInit {
.version_constant_commitment
.ok_or(missing("version_constant_commitment"))?
.try_into()?;
let fee_proposal_fri = value.fee_proposal_fri.map(|raw| GasPrice(raw.into()));
Ok(ProposalInit {
height,
round,
Expand All @@ -241,6 +242,7 @@ impl TryFrom<protobuf::ProposalInit> for ProposalInit {
l1_data_gas_price_wei,
starknet_version,
version_constant_commitment,
fee_proposal_fri,
})
}
}
Expand All @@ -262,6 +264,7 @@ impl From<ProposalInit> for protobuf::ProposalInit {
l1_data_gas_price_wei: Some(value.l1_data_gas_price_wei.0.into()),
starknet_version: value.starknet_version.to_string(),
version_constant_commitment: Some(value.version_constant_commitment.into()),
fee_proposal_fri: value.fee_proposal_fri.map(|gp| gp.0.into()),
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/apollo_protobuf/src/converters/test_instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ auto_impl_get_test_instance! {
pub l1_data_gas_price_wei: GasPrice,
pub starknet_version: StarknetVersion,
pub version_constant_commitment: StarkHash,
pub fee_proposal_fri: Option<GasPrice>,
}
pub enum ProposalPart {
Init(ProposalInit) = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ message ProposalInit {
Uint128 l1_data_gas_price_wei = 12;
string starknet_version = 13;
Hash version_constant_commitment = 14;
// SNIP-35: proposer's recommended fee for future blocks. Present iff Starknet version >= V0_14_3.
optional Uint128 fee_proposal_fri = 15;
}

message TransactionBatch {
Expand Down
3 changes: 3 additions & 0 deletions crates/apollo_protobuf/src/protobuf/protoc_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ pub struct ProposalInit {
pub starknet_version: ::prost::alloc::string::String,
#[prost(message, optional, tag = "14")]
pub version_constant_commitment: ::core::option::Option<Hash>,
/// SNIP-35: proposer's recommended fee for future blocks. Present iff Starknet version >= V0_14_3.
#[prost(message, optional, tag = "15")]
pub fee_proposal_fri: ::core::option::Option<Uint128>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
Loading