Skip to content

Commit

Permalink
fix(starknet_gateway): sync state reader fails end to end flow
Browse files Browse the repository at this point in the history
End to End flow currently provides a zero value to gas_prices.
This commit adds a default assignment to gas price if a zero value was
provided, and add a TODO to remove the default once the test is fixed
  • Loading branch information
noamsp-starkware committed Dec 30, 2024
1 parent 5ac8172 commit 0625380
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions crates/starknet_gateway/src/sync_state_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,41 @@ impl MempoolStateReader for SyncStateReader {
block_number: block_header.block_number,
block_timestamp: block_header.timestamp,
sequencer_address: block_header.sequencer.0,
// TODO: Remove unwrap_or_default after fixing end to end flow test.
gas_prices: GasPrices {
eth_gas_prices: GasPriceVector {
l1_gas_price: block_header.l1_gas_price.price_in_wei.try_into()?,
l1_data_gas_price: block_header.l1_data_gas_price.price_in_wei.try_into()?,
l2_gas_price: block_header.l2_gas_price.price_in_wei.try_into()?,
l1_gas_price: block_header
.l1_gas_price
.price_in_wei
.try_into()
.unwrap_or_default(),
l1_data_gas_price: block_header
.l1_data_gas_price
.price_in_wei
.try_into()
.unwrap_or_default(),
l2_gas_price: block_header
.l2_gas_price
.price_in_wei
.try_into()
.unwrap_or_default(),
},
strk_gas_prices: GasPriceVector {
l1_gas_price: block_header.l1_gas_price.price_in_fri.try_into()?,
l1_data_gas_price: block_header.l1_data_gas_price.price_in_fri.try_into()?,
l2_gas_price: block_header.l2_gas_price.price_in_fri.try_into()?,
l1_gas_price: block_header
.l1_gas_price
.price_in_fri
.try_into()
.unwrap_or_default(),
l1_data_gas_price: block_header
.l1_data_gas_price
.price_in_fri
.try_into()
.unwrap_or_default(),
l2_gas_price: block_header
.l2_gas_price
.price_in_fri
.try_into()
.unwrap_or_default(),
},
},
use_kzg_da: match block_header.l1_da_mode {
Expand Down

0 comments on commit 0625380

Please sign in to comment.