diff --git a/crates/p2p/src/client/conv.rs b/crates/p2p/src/client/conv.rs index dde63a667..0fdde1d21 100644 --- a/crates/p2p/src/client/conv.rs +++ b/crates/p2p/src/client/conv.rs @@ -132,8 +132,8 @@ impl ToDto for SignedBlockHeader { gas_price_wei: self.header.eth_l1_gas_price.0, data_gas_price_fri: self.header.strk_l1_data_gas_price.0, data_gas_price_wei: self.header.eth_l1_data_gas_price.0, - l2_gas_price_fri: self.header.strk_l2_gas_price.0, - l2_gas_price_wei: self.header.eth_l2_gas_price.0, + l2_gas_price_fri: Some(self.header.strk_l2_gas_price.0), + l2_gas_price_wei: Some(self.header.eth_l2_gas_price.0), l1_data_availability_mode: self.header.l1_da_mode.to_dto(), signatures: vec![p2p_proto::common::ConsensusSignature { r: self.signature.r.0, diff --git a/crates/p2p/src/client/types.rs b/crates/p2p/src/client/types.rs index 2dc254c5e..a3b28157f 100644 --- a/crates/p2p/src/client/types.rs +++ b/crates/p2p/src/client/types.rs @@ -101,8 +101,8 @@ impl TryFromDto for SignedBlockHeader { strk_l1_gas_price: GasPrice(dto.gas_price_fri), eth_l1_data_gas_price: GasPrice(dto.data_gas_price_wei), strk_l1_data_gas_price: GasPrice(dto.data_gas_price_fri), - eth_l2_gas_price: GasPrice(dto.l2_gas_price_wei), - strk_l2_gas_price: GasPrice(dto.l2_gas_price_fri), + eth_l2_gas_price: GasPrice(dto.l2_gas_price_wei.unwrap_or_default()), + strk_l2_gas_price: GasPrice(dto.l2_gas_price_fri.unwrap_or_default()), sequencer_address: SequencerAddress(dto.sequencer_address.0), starknet_version: dto.protocol_version.parse()?, event_commitment: EventCommitment(dto.events.root.0), diff --git a/crates/p2p_proto/src/header.rs b/crates/p2p_proto/src/header.rs index 61b6c685b..792953d3c 100644 --- a/crates/p2p_proto/src/header.rs +++ b/crates/p2p_proto/src/header.rs @@ -34,8 +34,10 @@ pub struct SignedBlockHeader { pub gas_price_wei: u128, pub data_gas_price_fri: u128, pub data_gas_price_wei: u128, - pub l2_gas_price_fri: u128, - pub l2_gas_price_wei: u128, + #[optional] + pub l2_gas_price_fri: Option, + #[optional] + pub l2_gas_price_wei: Option, pub l1_data_availability_mode: L1DataAvailabilityMode, pub signatures: Vec, }