Skip to content

Commit c9226b7

Browse files
committed
Consolidate to iterative overlay root
1 parent aaa2842 commit c9226b7

File tree

7 files changed

+697
-3180
lines changed

7 files changed

+697
-3180
lines changed

src/account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl Account {
2626
/// case. An account is encoded as a list of 4 elements, with 3 of these represnting 32 byte values
2727
/// and the nonce being an 8 byte value. Each element has 1 extra byte of encoding overhead.
2828
/// The list also has 2 bytes of encoding overhead. The total length is `2 + 3*33 + 9 = 110`.
29-
const MAX_RLP_ENCODED_LEN: usize = 2 + 3*33 + 9;
29+
const MAX_RLP_ENCODED_LEN: usize = 2 + 3 * 33 + 9;
3030

3131
unsafe impl MaxEncodedLen<MAX_RLP_ENCODED_LEN> for Account {}
3232

src/node.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
pointer::Pointer,
44
storage::value::{self, Value},
55
};
6-
use alloy_primitives::{hex, StorageValue, B256, U256};
6+
use alloy_primitives::{StorageValue, B256, U256};
77
use alloy_rlp::{
88
decode_exact, encode_fixed_size, length_of_length, BufMut, Encodable, Header, MaxEncodedLen,
99
EMPTY_STRING_CODE,
@@ -17,11 +17,6 @@ use proptest::{arbitrary, strategy, strategy::Strategy};
1717
use proptest_derive::Arbitrary;
1818
use std::cmp::{max, min};
1919

20-
// This is equivalent to RlpNode::word_rlp(&EMPTY_ROOT_HASH), and is used to encode the storage root
21-
// of an account with no storage.
22-
const EMPTY_ROOT_RLP: [u8; 33] =
23-
hex!("0xa056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421");
24-
2520
const MAX_PREFIX_LENGTH: usize = 64;
2621

2722
/// A node in the trie.

src/overlay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl OverlayState {
148148

149149
#[inline]
150150
pub fn first(&self) -> Option<(&[u8], &Option<OverlayValue>)> {
151-
if self.len() == 0 {
151+
if self.is_empty() {
152152
None
153153
} else {
154154
let (path, value) = &self.data[self.start_idx];

src/storage.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod debug;
22
pub mod engine;
33
pub mod overlay_root;
4-
pub mod overlay_root_iterative;
54
pub mod proofs;
65
mod test_utils;
76
pub mod value;

0 commit comments

Comments
 (0)