Skip to content

Commit e334f7a

Browse files
rakitaklkvrmattsse
authoredMar 17, 2025··
bump: revm v20.0.0-alpha.6 (#15087)
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com> Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
1 parent e5bf126 commit e334f7a

File tree

4 files changed

+60
-45
lines changed

4 files changed

+60
-45
lines changed
 

‎Cargo.lock

+26-26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -434,17 +434,17 @@ reth-ress-protocol = { path = "crates/ress/protocol" }
434434
reth-ress-provider = { path = "crates/ress/provider" }
435435

436436
# revm
437-
revm = { version = "20.0.0-alpha.5", default-features = false }
438-
revm-bytecode = { version = "1.0.0-alpha.3", default-features = false }
439-
revm-database = { version = "1.0.0-alpha.3", default-features = false }
440-
revm-state = { version = "1.0.0-alpha.3", default-features = false }
441-
revm-primitives = { version = "16.0.0-alpha.3", default-features = false }
442-
revm-interpreter = { version = "16.0.0-alpha.5", default-features = false }
443-
revm-inspector = { version = "1.0.0-alpha.5", default-features = false }
444-
revm-context = { version = "1.0.0-alpha.4", default-features = false }
445-
revm-context-interface = { version = "1.0.0-alpha.4", default-features = false }
446-
revm-database-interface = { version = "1.0.0-alpha.3", default-features = false }
447-
op-revm = { version = "1.0.0-alpha.4", default-features = false }
437+
revm = { version = "20.0.0-alpha.6", default-features = false }
438+
revm-bytecode = { version = "1.0.0-alpha.4", default-features = false }
439+
revm-database = { version = "1.0.0-alpha.4", default-features = false }
440+
revm-state = { version = "1.0.0-alpha.4", default-features = false }
441+
revm-primitives = { version = "16.0.0-alpha.4", default-features = false }
442+
revm-interpreter = { version = "16.0.0-alpha.6", default-features = false }
443+
revm-inspector = { version = "1.0.0-alpha.6", default-features = false }
444+
revm-context = { version = "1.0.0-alpha.5", default-features = false }
445+
revm-context-interface = { version = "1.0.0-alpha.5", default-features = false }
446+
revm-database-interface = { version = "1.0.0-alpha.4", default-features = false }
447+
op-revm = { version = "1.0.0-alpha.5", default-features = false }
448448
revm-inspectors = "0.17.0-alpha.1"
449449

450450
# eth

‎crates/primitives-traits/src/account.rs

+22-8
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,33 @@ impl reth_codecs::Compact for Bytecode {
165165

166166
use compact_ids::*;
167167

168-
let len = buf.read_u32::<byteorder::BigEndian>().expect("could not read bytecode length");
169-
let bytes = Bytes::from(buf.copy_to_bytes(len as usize));
168+
let len = buf.read_u32::<byteorder::BigEndian>().expect("could not read bytecode length")
169+
as usize;
170+
let bytes = Bytes::from(buf.copy_to_bytes(len));
170171
let variant = buf.read_u8().expect("could not read bytecode variant");
171172
let decoded = match variant {
172173
LEGACY_RAW_BYTECODE_ID => Self(RevmBytecode::new_raw(bytes)),
173174
REMOVED_BYTECODE_ID => {
174175
unreachable!("Junk data in database: checked Bytecode variant was removed")
175176
}
176-
LEGACY_ANALYZED_BYTECODE_ID => Self(RevmBytecode::new_analyzed(
177-
bytes,
178-
buf.read_u64::<byteorder::BigEndian>().unwrap() as usize,
179-
revm_bytecode::JumpTable::from_slice(buf),
180-
)),
177+
LEGACY_ANALYZED_BYTECODE_ID => {
178+
let original_len = buf.read_u64::<byteorder::BigEndian>().unwrap() as usize;
179+
// When saving jumptable, its length is getting aligned to u8 boundary. Thus, we
180+
// need to re-calculate the internal length of bitvec and truncate it when loading
181+
// jumptables to avoid inconsistencies during `Compact` roundtrip.
182+
let jump_table_len = if buf.len() * 8 >= bytes.len() {
183+
// Use length of padded bytecode if we can fit it
184+
bytes.len()
185+
} else {
186+
// Otherwise, use original_len
187+
original_len
188+
};
189+
Self(RevmBytecode::new_analyzed(
190+
bytes,
191+
original_len,
192+
revm_bytecode::JumpTable::from_slice(buf, jump_table_len),
193+
))
194+
}
181195
EOF_BYTECODE_ID | EIP7702_BYTECODE_ID => {
182196
// EOF and EIP-7702 bytecode objects will be decoded from the raw bytecode
183197
Self(RevmBytecode::new_raw(bytes))
@@ -293,7 +307,7 @@ mod tests {
293307
let bytecode = Bytecode(RevmBytecode::LegacyAnalyzed(LegacyAnalyzedBytecode::new(
294308
Bytes::from(&hex!("ff00")),
295309
2,
296-
JumpTable::from_slice(&[0]),
310+
JumpTable::from_slice(&[0], 2),
297311
)));
298312
let len = bytecode.to_compact(&mut buf);
299313
assert_eq!(len, 16);

‎deny.toml

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ exceptions = [
6262
# These dependencies are grandfathered in https://github.com/paradigmxyz/reth/pull/6980
6363
{ allow = ["MPL-2.0"], name = "option-ext" },
6464
{ allow = ["MPL-2.0"], name = "webpki-roots" },
65+
{ allow = ["MPL-2.0"], name = "webpki-root-certs" },
6566
]
6667

6768
[[licenses.clarify]]

0 commit comments

Comments
 (0)
Please sign in to comment.