Skip to content

Commit

Permalink
chore(starknet_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 Dec 1, 2024
1 parent c65933e commit f3ada2d
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 @@ -162,6 +162,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 @@ -348,6 +349,7 @@ impl 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 f3ada2d

Please sign in to comment.