Skip to content

Commit

Permalink
chore(batcher): set use_kzg_da flag in build block input
Browse files Browse the repository at this point in the history
  • Loading branch information
ArniStarkware committed Nov 28, 2024
1 parent a21cac0 commit 0b1faae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ impl ConsensusContext for SequencerConsensusContext {
block_timestamp: BlockTimestamp(
now.timestamp().try_into().expect("Failed to convert timestamp"),
),
use_kzg_da: true,
..Default::default()
},
};
Expand Down Expand Up @@ -213,6 +214,7 @@ impl ConsensusContext for SequencerConsensusContext {
block_timestamp: BlockTimestamp(
now.timestamp().try_into().expect("Failed to convert timestamp"),
),
use_kzg_da: true,
..Default::default()
},
};
Expand Down
14 changes: 13 additions & 1 deletion crates/starknet_api/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl GasPrices {
)]
pub struct BlockTimestamp(pub u64);

#[derive(Clone, Debug, Deserialize, Default, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct BlockInfo {
pub block_number: BlockNumber,
pub block_timestamp: BlockTimestamp,
Expand All @@ -497,6 +497,18 @@ pub struct BlockInfo {
pub use_kzg_da: bool,
}

impl Default for BlockInfo {
fn default() -> Self {
Self {
block_number: BlockNumber::default(),
block_timestamp: BlockTimestamp::default(),
sequencer_address: ContractAddress::default(),
gas_prices: GasPrices::default(),
use_kzg_da: true,
}
}
}

/// The signature of a [Block](`crate::block::Block`), signed by the sequencer. The signed message
/// is defined as poseidon_hash(block_hash, state_diff_commitment).
#[derive(
Expand Down

0 comments on commit 0b1faae

Please sign in to comment.