Skip to content
Open
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 @@ -319,6 +319,7 @@ async fn get_proposal_content(
info.l2_gas_used,
args.override_l2_gas_price_fri,
&args.min_l2_gas_price_per_height,
None,
);
let fin_payload = ProposalFinPayload {
commitment_parts: CommitmentParts::from(&info),
Expand Down
9 changes: 7 additions & 2 deletions crates/apollo_consensus_orchestrator/src/fee_market/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub fn calculate_next_l2_gas_price_for_fin(
l2_gas_used: GasAmount,
override_l2_gas_price_fri: Option<u128>,
min_l2_gas_price_per_height: &[PricePerHeight],
fee_actual: Option<GasPrice>,
) -> GasPrice {
if let Some(override_value) = override_l2_gas_price_fri {
info!(
Expand All @@ -67,8 +68,12 @@ pub fn calculate_next_l2_gas_price_for_fin(
return GasPrice(override_value);
}
let gas_target = VersionedConstants::latest_constants().gas_target;
let min_gas_price = get_min_gas_price_for_height(height, min_l2_gas_price_per_height);
calculate_next_base_gas_price(current_l2_gas_price, l2_gas_used, gas_target, min_gas_price)
let config_min = get_min_gas_price_for_height(height, min_l2_gas_price_per_height);
let effective_min = match fee_actual {
Some(fa) => GasPrice(max(config_min.0, fa.0)),
None => config_min,
};
calculate_next_base_gas_price(current_l2_gas_price, l2_gas_used, gas_target, effective_min)
}

/// Calculate the base gas price for the next block according to EIP-1559.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ impl SequencerConsensusContext {
l2_gas_used,
self.config.dynamic_config.override_l2_gas_price_fri,
&self.config.dynamic_config.min_l2_gas_price_per_height,
None,
)
}

Expand Down
Loading