From 0243e039335e8530aca06150849a9e29633f148e Mon Sep 17 00:00:00 2001 From: Arsenii Kulikov Date: Mon, 2 Sep 2024 12:24:39 +0400 Subject: [PATCH] chore(deps): bump op-alloy-rpc-types (#10646) Co-authored-by: Roman Krasiuk --- Cargo.lock | 16 ++++++++++------ Cargo.toml | 2 +- crates/optimism/rpc/src/eth/receipt.rs | 16 +++++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46dceaf62b14..0dbc4a4632de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5038,9 +5038,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "op-alloy-consensus" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0db6e3a9bbbcef7cef19d77aa2cc76d61377376e3bb86f89167e7e3f30ea023" +checksum = "f024d4e0aebc67d887600f90b38ef5c410bce74561995abd79bcb2a8139a52eb" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5049,13 +5049,14 @@ dependencies = [ "alloy-serde", "derive_more 1.0.0", "serde", + "spin", ] [[package]] name = "op-alloy-network" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66184e6c92269ba4ef1f80e8566ce11d41b584884ce7476d4b1b5e0e38503ecb" +checksum = "c90477039fba02e655363be5f034da3bbaea03404d6b3fc92cddaee278e3d64b" dependencies = [ "alloy-consensus", "alloy-eips", @@ -5068,9 +5069,9 @@ dependencies = [ [[package]] name = "op-alloy-rpc-types" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c604cd3b9680d0edd0b7127f3550bcff634c2d2efe27b2b4853e72320186a8" +checksum = "e0a8514b4b8571ef7202c6ad9de623e820952c6356285d928f64d4debbacdc09" dependencies = [ "alloy-network", "alloy-primitives 0.8.0", @@ -9637,6 +9638,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spki" diff --git a/Cargo.toml b/Cargo.toml index bfe18acbf57a..c7786f8676ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -446,7 +446,7 @@ alloy-transport-ipc = { version = "0.3.0", default-features = false } alloy-transport-ws = { version = "0.3.0", default-features = false } # op -op-alloy-rpc-types = "0.2" +op-alloy-rpc-types = "0.2.5" op-alloy-rpc-types-engine = "0.2" op-alloy-network = "0.2" diff --git a/crates/optimism/rpc/src/eth/receipt.rs b/crates/optimism/rpc/src/eth/receipt.rs index d9f1ffb8236d..881b91c81597 100644 --- a/crates/optimism/rpc/src/eth/receipt.rs +++ b/crates/optimism/rpc/src/eth/receipt.rs @@ -60,9 +60,9 @@ pub fn op_receipt_fields( op_fields.deposit_receipt_version = receipt.deposit_receipt_version; } else if let Some(l1_block_info) = optimism_tx_meta.l1_block_info { // always present - op_fields.l1_fee = optimism_tx_meta.l1_fee; - op_fields.l1_gas_price = Some(l1_block_info.l1_base_fee.saturating_to()); - op_fields.l1_gas_used = optimism_tx_meta.l1_data_gas.map(|dg| { + op_fields.l1_block_info.l1_fee = optimism_tx_meta.l1_fee; + op_fields.l1_block_info.l1_gas_price = Some(l1_block_info.l1_base_fee.saturating_to()); + op_fields.l1_block_info.l1_gas_used = optimism_tx_meta.l1_data_gas.map(|dg| { dg.saturating_add( l1_block_info.l1_fee_overhead.unwrap_or_default().saturating_to::(), ) @@ -72,16 +72,18 @@ pub fn op_receipt_fields( // None if ecotone is active if l1_block_info.l1_fee_overhead.is_some() { // only pre Ecotone - op_fields.l1_fee_scalar = + op_fields.l1_block_info.l1_fee_scalar = Some(f64::from(l1_block_info.l1_base_fee_scalar) / 1_000_000.0); } else { // base fee scalar is enabled post Ecotone - op_fields.l1_base_fee_scalar = Some(l1_block_info.l1_base_fee_scalar.saturating_to()); + op_fields.l1_block_info.l1_base_fee_scalar = + Some(l1_block_info.l1_base_fee_scalar.saturating_to()); } // 4844 post Ecotone - op_fields.l1_blob_base_fee = l1_block_info.l1_blob_base_fee.map(|v| v.saturating_to()); - op_fields.l1_blob_base_fee_scalar = + op_fields.l1_block_info.l1_blob_base_fee = + l1_block_info.l1_blob_base_fee.map(|v| v.saturating_to()); + op_fields.l1_block_info.l1_blob_base_fee_scalar = l1_block_info.l1_blob_base_fee_scalar.map(|v| v.saturating_to()); }