Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(starknet_batcher): set temp gas prices in propose block input #2341

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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
Loading