From 6cfb9f4ef2c01c05d6b6585ec6109441ed243059 Mon Sep 17 00:00:00 2001 From: Arni Hod Date: Thu, 28 Nov 2024 10:53:27 +0200 Subject: [PATCH] chore(starknet_batcher): set temp gas prices in propose block input --- .../src/sequencer_consensus_context.rs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs b/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs index 41f1044c98f..d3204e84fce 100644 --- a/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs +++ b/crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs @@ -28,7 +28,16 @@ use papyrus_protobuf::consensus::{ TransactionBatch, Vote, }; -use starknet_api::block::{BlockHash, BlockHashAndNumber, BlockInfo, BlockNumber, BlockTimestamp}; +use starknet_api::block::{ + BlockHash, + BlockHashAndNumber, + BlockInfo, + BlockNumber, + BlockTimestamp, + GasPriceVector, + GasPrices, + NonzeroGasPrice, +}; use starknet_api::executable_transaction::Transaction; use starknet_batcher_types::batcher_types::{ DecisionReachedInput, @@ -47,6 +56,20 @@ use tokio::sync::Notify; use tokio::task::JoinHandle; use tracing::{debug, debug_span, error, info, trace, warn, Instrument}; +// TODO(Dan, Matan): Remove this once and replace with real gas prices. +const TEMPORARY_GAS_PRICES: GasPrices = GasPrices { + eth_gas_prices: GasPriceVector { + l1_gas_price: NonzeroGasPrice::MIN, + l1_data_gas_price: NonzeroGasPrice::MIN, + l2_gas_price: NonzeroGasPrice::MIN, + }, + strk_gas_prices: GasPriceVector { + l1_gas_price: NonzeroGasPrice::MIN, + l1_data_gas_price: NonzeroGasPrice::MIN, + l2_gas_price: NonzeroGasPrice::MIN, + }, +}; + // {height: {proposal_id: (content, [proposal_ids])}} // Note that multiple proposals IDs can be associated with the same content, but we only need to // store one of them. @@ -143,6 +166,7 @@ impl ConsensusContext for SequencerConsensusContext { // TODO(Dan, Matan): Fill block info. block_info: BlockInfo { block_number: proposal_init.height, + gas_prices: TEMPORARY_GAS_PRICES, block_timestamp: BlockTimestamp( now.timestamp().try_into().expect("Failed to convert timestamp"), ), @@ -333,6 +357,7 @@ impl SequencerConsensusContext { // TODO(Dan, Matan): Fill block info. block_info: BlockInfo { block_number: height, + gas_prices: TEMPORARY_GAS_PRICES, block_timestamp: BlockTimestamp( now.timestamp().try_into().expect("Failed to convert timestamp"), ),