Skip to content

Commit

Permalink
chore(deps): bump op-alloy-rpc-types (#10646)
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Krasiuk <[email protected]>
  • Loading branch information
klkvr and rkrasiuk authored Sep 2, 2024
1 parent c49feff commit 0243e03
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
16 changes: 10 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 9 additions & 7 deletions crates/optimism/rpc/src/eth/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<u128>(),
)
Expand All @@ -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());
}

Expand Down

0 comments on commit 0243e03

Please sign in to comment.