From ef842b03c8cef953494ab56aba25757c33e5a51a Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Wed, 13 Jul 2022 16:45:21 -0700 Subject: [PATCH] Address some feedback on #591 --- evm/src/generation/memory.rs | 2 +- evm/src/generation/mod.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/evm/src/generation/memory.rs b/evm/src/generation/memory.rs index 0b80756a..60bfe794 100644 --- a/evm/src/generation/memory.rs +++ b/evm/src/generation/memory.rs @@ -42,7 +42,7 @@ impl MemorySegmentState { } pub(super) fn set(&mut self, virtual_addr: usize, value: U256) { - if virtual_addr + 1 > self.content.len() { + if virtual_addr >= self.content.len() { self.content.resize(virtual_addr + 1, U256::zero()); } self.content[virtual_addr] = value; diff --git a/evm/src/generation/mod.rs b/evm/src/generation/mod.rs index edca27dd..b73270db 100644 --- a/evm/src/generation/mod.rs +++ b/evm/src/generation/mod.rs @@ -12,6 +12,8 @@ use crate::util::trace_rows_to_poly_values; mod memory; pub(crate) mod state; +/// A piece of data which has been encoded using Recursive Length Prefix (RLP) serialization. +/// See https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/ pub type RlpBlob = Vec; /// Merkle proofs are encoded using an RLP blob for each node in the path.