From 7d5f5431aedb235d43978cf9d47218d08a1ea693 Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Sun, 27 Aug 2023 18:54:46 -0700 Subject: [PATCH 1/2] Fix comments --- crates/primitives/src/proofs.rs | 6 ++++++ crates/primitives/src/transaction/tx_type.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/primitives/src/proofs.rs b/crates/primitives/src/proofs.rs index 35f0ad92fbf..baf7f8f3dfc 100644 --- a/crates/primitives/src/proofs.rs +++ b/crates/primitives/src/proofs.rs @@ -180,6 +180,12 @@ mod tests { assert_eq!(block.transactions_root, tx_root, "Must be the same"); } + /// Tests that the receipt root is computed correctly for the regolith block. + /// This was implemented due to a minor bug in op-geth and op-erigon where in + /// the Regolith hardfork, the receipt root calculation does not include the + /// deposit nonce in the receipt encoding. + /// To fix this an op-reth patch was applied to the receipt root calculation + /// to strip the deposit nonce from each receipt before calculating the root. #[cfg(feature = "optimism")] #[test] fn check_optimism_receipt_root() { diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index 680e71b5fba..4f0f91f2863 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -79,7 +79,7 @@ impl Compact for TxType { } } - // For backwards compatibility purposesm only 2 bits of the type are encoded in the identifier + // For backwards compatibility purposes only 2 bits of the type are encoded in the identifier // parameter. In the case of a 3, the full transaction type is read from the buffer as a // single byte. fn from_compact(mut buf: &[u8], identifier: usize) -> (Self, &[u8]) { From 7869520b154d6498c1e493ce917d679b198f1086 Mon Sep 17 00:00:00 2001 From: Andreas Bigger Date: Sun, 27 Aug 2023 19:15:22 -0700 Subject: [PATCH 2/2] More comment fixes --- crates/revm/src/executor.rs | 2 ++ crates/rpc/rpc/src/eth/api/block.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/revm/src/executor.rs b/crates/revm/src/executor.rs index faca8eaa01c..1ea22847bd9 100644 --- a/crates/revm/src/executor.rs +++ b/crates/revm/src/executor.rs @@ -204,6 +204,8 @@ where // Fill revm structure. fill_tx_env(&mut self.evm.env.tx, transaction, sender); + // In order to support contract creation through deposit transactions, + // the tx nonce must be set to the nonce of the account. #[cfg(feature = "optimism")] if transaction.is_deposit() && self.chain_spec diff --git a/crates/rpc/rpc/src/eth/api/block.rs b/crates/rpc/rpc/src/eth/api/block.rs index 19d4d99af90..436085097f5 100644 --- a/crates/rpc/rpc/src/eth/api/block.rs +++ b/crates/rpc/rpc/src/eth/api/block.rs @@ -158,7 +158,7 @@ where let block_id = block_id.into(); if block_id.is_pending() { - // Pending block can be fetched directly without need for caching;; + // Pending block can be fetched directly without need for caching return Ok(self.provider().pending_block()?.map(|block| block.body.len())) }