Skip to content

Commit

Permalink
chore(starknet_batcher): set temp gas prices in propose block input
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Dec 2, 2024
1 parent 5e5126a commit b927f8a
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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.
Expand Down Expand Up @@ -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"),
),
Expand Down Expand Up @@ -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"),
),
Expand Down

0 comments on commit b927f8a

Please sign in to comment.