Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
da7473d
fix lock
pgherveou Jul 27, 2025
df8d71d
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Jul 27, 2025
359b181
fixes
pgherveou Jul 27, 2025
58b9220
Rve/revm arithmetic instructions WIP (#9361)
0xRVE Jul 30, 2025
5b304a0
fixes gas computation of evm arithemtic instructions (#9379)
0xRVE Jul 30, 2025
aa40c56
added bitwise test
Jul 30, 2025
2281fb7
added tests for bitwise
Jul 30, 2025
509b0ee
fix comment
Jul 30, 2025
90d54d7
fixed bitwise compilation issue
Jul 30, 2025
e0a0d9f
ignore CLZ test
Jul 31, 2025
1921aef
host.rs::balance test not working
Aug 1, 2025
94697f7
fixed host:balance test. need to find global var for existential depo…
Aug 1, 2025
93a5dae
mult and offset to variables
Aug 1, 2025
db394c8
cleanup
Aug 1, 2025
a64ce67
added test for selfbalance
Aug 1, 2025
faa067c
fixe test host::selfbalance
Aug 4, 2025
5c30af0
cargo clippy
Aug 4, 2025
b9d1a58
added test for host::extcodesize
Aug 4, 2025
b5c8baf
added test for extcodehash
Aug 4, 2025
34e3e78
stared making blockhash instruction
Aug 4, 2025
6390a20
blockhash runs out of gas for some reason
Aug 4, 2025
b53d220
added stubs for other tests in host.rs
Aug 5, 2025
7a13f03
added Debug to exec.rs::Key
Aug 5, 2025
73adf94
added host test sload
Aug 5, 2025
e92b7d0
added host.rs test sstore
Aug 5, 2025
f5accbf
not so easy to test transient storage
Aug 5, 2025
2d88b1d
added test for selfdestruct but it gives out-of-gas error
Aug 6, 2025
d1b2baf
clean up
Aug 6, 2025
d6c852a
fixed Host.sol
Aug 6, 2025
8b9d9ba
fixed test for blockhash in host.rs
Aug 6, 2025
dfbaf67
created separate Host::selfdetruct fixtures for EVM and PVM
Aug 6, 2025
81f7da0
enabled solc and resolc in blockhash test in host.rs
Aug 6, 2025
aadfe10
added test for extcodecopy
Aug 7, 2025
d376bfc
cleanup
Aug 7, 2025
936c20d
cleanup
Aug 8, 2025
4f0f468
clean up
Aug 8, 2025
148e0e6
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 12, 2025
8817d7e
Revert "fixes gas computation of evm arithemtic instructions (#9379)"
Aug 12, 2025
02198ce
Revert "Rve/revm arithmetic instructions WIP (#9361)"
Aug 12, 2025
ab72894
added arithmetic
Aug 12, 2025
d8142a3
added test for transient storage in host.rs
Aug 12, 2025
5842fa7
cleanup
Aug 12, 2025
c071b7d
added test for memory
Aug 12, 2025
bb14f1c
[pallet-revive] do not silently fail Solidity fixtures compilation (#…
xermicus Aug 12, 2025
35bc95d
removed some function from Memory.sol fixture
Aug 13, 2025
90fb377
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 13, 2025
ef5bbc8
added test for mstore8
Aug 13, 2025
b00080d
turn off yul optimizer and added test for msize
Aug 13, 2025
22460f8
added test for mcopy in memory.rs
Aug 13, 2025
392cadd
selfdestruct doesnt work
Aug 13, 2025
1bfbaa8
refactor more benchmarks
pgherveou Aug 14, 2025
96e5402
added test for control jump
Aug 14, 2025
61f5bb3
added test for JUMPI instruction in control
Aug 14, 2025
ce3570d
cleanup
Aug 14, 2025
87d61cd
disable host selfdestruct opcode
Aug 14, 2025
c2170db
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 14, 2025
36f6d39
cleanup
Aug 14, 2025
cfec632
cleanup
Aug 15, 2025
6e4ca1f
refactor arithmetic tests
Aug 15, 2025
5278629
refactor bitwise tests
Aug 15, 2025
3e6a43b
refactor control tests
Aug 15, 2025
68bc07c
require call in solidity is not failing on incorrect predicate
Aug 15, 2025
d67c22e
inside test need to check for REVERT flag in result of bare call
Aug 15, 2025
f74a739
require in solidity fails/reverts without giving a clear error message
Aug 16, 2025
434fd78
moved decode_revert_message to tests.rs
Aug 16, 2025
9109b74
fixed bitwise tests
Aug 16, 2025
7f79d2e
Merge branch 'master' into pg/revm
pgherveou Aug 18, 2025
076246c
Merge branch 'master' into pg/revm
pgherveou Aug 18, 2025
b2ceaae
revm file shuffling
pgherveou Aug 18, 2025
7e68c51
fixes
pgherveou Aug 18, 2025
6ec1681
rm stuff for later
pgherveou Aug 18, 2025
c89d026
rm evm
pgherveou Aug 18, 2025
d53e0ac
rm evm stuff
pgherveou Aug 18, 2025
edde1d1
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 18, 2025
4f38703
rm
pgherveou Aug 18, 2025
d1683f8
removed some tests from arithmetic
Aug 18, 2025
ab3761e
taplo fix
pgherveou Aug 18, 2025
7dadbc1
fix up cargo.lock
pgherveou Aug 18, 2025
abcd13c
try
pgherveou Aug 18, 2025
6d30298
fixes
pgherveou Aug 18, 2025
68e9a84
Merge branch 'master' into pg/revm-base
pgherveou Aug 18, 2025
551c711
rm vm/runtime.rs
pgherveou Aug 18, 2025
2c308d7
Merge branch 'pg/revm-base' into pg/revm
pgherveou Aug 18, 2025
2debf91
fix
pgherveou Aug 18, 2025
0175328
nit
pgherveou Aug 18, 2025
59e59e8
fixes
pgherveou Aug 18, 2025
f1f2ffc
nit
pgherveou Aug 18, 2025
82ea9bc
update call_with_code_per_byte
pgherveou Aug 18, 2025
15935c3
not getting the right balance after INVALID instruction
Aug 18, 2025
6f7b2bf
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 18, 2025
20511d1
fixes
pgherveou Aug 18, 2025
4bf8aee
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 18, 2025
e1bbcb9
added migration
pgherveou Aug 18, 2025
78c92d3
Merge branch 'master' into pg/revm-base
pgherveou Aug 19, 2025
3789665
Merge branch 'pg/revm-base' into pg/revm
pgherveou Aug 19, 2025
f8da76f
refactoring
pgherveou Aug 19, 2025
b1b1192
fix clippy
pgherveou Aug 19, 2025
a829fab
fix clippy
pgherveou Aug 19, 2025
1066074
fixedd test for INVALID opcode
Aug 19, 2025
d11dd3f
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 19, 2025
4b5edb5
added assert for flag revert
Aug 19, 2025
e482eee
added tests for stack
Aug 19, 2025
fd57f68
review comments
Aug 20, 2025
de65cce
rustfmt
Aug 20, 2025
69602ac
added selfdestruct
Aug 20, 2025
d9e50a1
cleanup
Aug 20, 2025
b9c406e
rustfmt
Aug 20, 2025
24f4c6d
license
Aug 20, 2025
b8970a0
rustfmt
Aug 20, 2025
ade000c
fmt
Aug 20, 2025
c6378fb
fix macro import issue
Aug 20, 2025
3e1fc33
cargo check
Aug 20, 2025
dba3403
removed loggings
Aug 21, 2025
8112b00
cleanup
Aug 21, 2025
883af60
removed decode_revert_message
Aug 21, 2025
4731b5e
cargo +nightly fmt
pgherveou Aug 21, 2025
3c4f5c4
Merge branch 'master' into pg/revm
pgherveou Aug 21, 2025
953ee61
merge fix
pgherveou Aug 21, 2025
7cee5be
simplify migration tests
pgherveou Aug 21, 2025
b8dc717
add migration
pgherveou Aug 21, 2025
3503649
removed EVM version check from evm instructions
Aug 21, 2025
574fb97
removed log::info and println
Aug 21, 2025
81578a0
remove unneeded tests for this PR
pgherveou Aug 21, 2025
fa0ffa9
fix CALLDATACOPY gas
Aug 21, 2025
22cd095
cleanup
Aug 21, 2025
9df994e
added comments to control assembly contracts for jump and jumpi
Aug 21, 2025
2f13212
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 21, 2025
6000ed4
fixes
pgherveou Aug 21, 2025
c679776
keep these files for next PR
pgherveou Aug 21, 2025
5f839b6
comments
pgherveou Aug 21, 2025
8110392
fixes
pgherveou Aug 21, 2025
7a1c0a6
fix
pgherveou Aug 21, 2025
f3289d4
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 21, 2025
3512769
fix after merge
Aug 21, 2025
3b19c42
fmt
Aug 21, 2025
fa902be
make cargo check pass
Aug 21, 2025
4657b64
fmt
Aug 21, 2025
83ea8cd
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Aug 21, 2025
6706b9c
fix clippy
Aug 21, 2025
165957c
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 21, 2025
2b07ca6
rename seal_to_account_id
pgherveou Aug 21, 2025
0c4d0cd
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 21, 2025
f96fa39
update PRDOC
pgherveou Aug 21, 2025
2f369ad
Merge branch 'master' into pg/revm
pgherveou Aug 21, 2025
9f92c36
install solc in workflow
Aug 22, 2025
b66b47a
fix bench
pgherveou Aug 21, 2025
4d0db7e
output.data shoudl be untouched
pgherveou Aug 22, 2025
b7c0f7f
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 22, 2025
674e559
fix host test
Aug 22, 2025
42f8c2d
fmt
Aug 22, 2025
f5caa32
review fixes
Aug 22, 2025
4a98ea1
moved transfer_with_dust out of the transfer function
Aug 22, 2025
0784a4a
semicolon
Aug 22, 2025
b747e98
removed allow deadcode from H160Mapper in address.rs
Aug 22, 2025
79b84da
install solidity in job
pgherveou Aug 22, 2025
484edb2
fixed some stuff in host instructions
Aug 22, 2025
c907833
fmt
Aug 22, 2025
6403ef1
added install resolc to tests-misc.yml
Aug 22, 2025
4b80099
use resolc too
pgherveou Aug 22, 2025
4b6f4d2
rm line
pgherveou Aug 22, 2025
28b6217
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 22, 2025
c2332ca
trigger ci
Aug 22, 2025
ab15dc1
enforce evm code size limit
pgherveou Aug 23, 2025
e93c1a0
fix
pgherveou Aug 25, 2025
04d0551
fix
pgherveou Aug 25, 2025
8f8ebcc
fix
pgherveou Aug 25, 2025
dbb4b93
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 26, 2025
47b39c1
fixed gas in hsot.rs
Aug 26, 2025
d1d5199
cleanup
Aug 26, 2025
dec0849
PR review
pgherveou Aug 26, 2025
dbfc430
make pristine unbounded and check PVM & EVM code size
pgherveou Aug 26, 2025
87b7b4e
nit
pgherveou Aug 26, 2025
b4dad01
added comments
Aug 26, 2025
fbdd9fc
commented code so that estending memory will not cost any gas
Aug 26, 2025
cb8b8ce
added TODO in host.rs instruction for extcodecopy gas macro
Aug 26, 2025
ee7c237
unused vars in macros.rs
Aug 26, 2025
b769010
refcount = 1 for evm
pgherveou Aug 26, 2025
0abfc74
fix
pgherveou Aug 26, 2025
6060eb4
fix
pgherveou Aug 26, 2025
2007fb5
add one more assert
pgherveou Aug 26, 2025
f219e06
nit
pgherveou Aug 26, 2025
33e9216
Remove refcount and owner for EVM CodeInfo
pgherveou Aug 26, 2025
f75403a
rm unused
pgherveou Aug 26, 2025
d26d8ac
origin should be held not caller
pgherveou Aug 26, 2025
cc8cef4
Merge branch 'master' into pg/revm
pgherveou Aug 27, 2025
92e36a7
added trace logging in EVM interpreter loop
Aug 27, 2025
5175667
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Aug 27, 2025
5780c19
fix ci
Aug 27, 2025
256b802
fmt
Aug 27, 2025
59ccd47
fix ci
Aug 27, 2025
9cd90ca
Update from github-actions[bot] running command 'bench --runtime dev …
github-actions[bot] Aug 27, 2025
d647759
fix ci
Aug 27, 2025
63290b9
dummy chang
Aug 27, 2025
d22ac45
nit
Aug 27, 2025
8bd37b6
fix ci
Aug 27, 2025
9d40097
changed prdoc to major
Aug 27, 2025
e405e18
rollback refcount removals
pgherveou Aug 27, 2025
8b1669f
Update Cargo.toml
pgherveou Aug 27, 2025
4f86e9b
Update prdoc/pr_9285.prdoc
pgherveou Aug 27, 2025
315ae52
Update substrate/frame/revive/src/call_builder.rs
pgherveou Aug 27, 2025
3598d6f
Update substrate/frame/revive/src/benchmarking.rs
pgherveou Aug 27, 2025
3272e99
rm charge_evm_init_cost
pgherveou Aug 27, 2025
e2242a2
fix
pgherveou Aug 27, 2025
7fa6421
rm - 1
pgherveou Aug 27, 2025
ae647b6
restore legacy behaviour
pgherveou Aug 27, 2025
e374a38
fix selfdestruct in exec.rs and host.rs
Aug 27, 2025
38602a5
format fixtures
xermicus Aug 28, 2025
1a073b6
update
pgherveou Aug 28, 2025
2765b13
Merge remote-tracking branch 'origin/pg/revm' into rve/revm-instructi…
Aug 28, 2025
11fbe30
using U256Converter trait
Aug 28, 2025
f0b629d
fixed gas charge in host sstore and tstore
Aug 28, 2025
9632db8
review comments
Aug 28, 2025
7de00cc
remove prdoc
Aug 28, 2025
22d1b3c
Merge remote-tracking branch 'origin/rve/revm-instructions-bitwise' i…
Aug 28, 2025
9c4e85c
undo changes to weights
Aug 28, 2025
4bd37a2
fixed copy paste mistake
Aug 28, 2025
fb8ca75
fixed review comment
Aug 28, 2025
5a6b99a
remove allow deadcode in utility.rs
Aug 28, 2025
6d01a53
format
Aug 28, 2025
6d0181e
fixed copy paste mistake
Aug 28, 2025
04001a2
fixed review comment
Aug 28, 2025
f68a53d
remove allow deadcode in utility.rs
Aug 28, 2025
4fc21b4
Merge branch 'rve/revm-instructions-bitwise' into rve/revm2
Aug 28, 2025
833b847
fix ci
Aug 29, 2025
d137f91
fix ci
Aug 29, 2025
51ba0f7
trigger ci
Aug 29, 2025
4edc46e
format
Aug 29, 2025
7afade1
fix compilation issue
Aug 29, 2025
b48e5e1
Merge remote-tracking branch 'origin/rve/revm-instructions-bitwise' i…
Aug 29, 2025
d1808d6
added test for invalid jumpdest
Aug 29, 2025
a064b21
review comments
Aug 29, 2025
4283724
removed formatting diff
Aug 29, 2025
199516c
Merge remote-tracking branch 'origin/rve/revm-instructions-bitwise' i…
Aug 29, 2025
09d7a3a
fix unused variable
Aug 29, 2025
29765fc
fix unused variable
Aug 29, 2025
f10a0b2
Merge branch 'rve/revm-instructions-bitwise' into rve/revm2
Aug 29, 2025
fcae11f
fixed condition import
Aug 29, 2025
fdff8f2
change imports
Aug 29, 2025
d4b67b5
format
Aug 29, 2025
c05c012
Merge remote-tracking branch 'origin/master' into rve/revm2
Sep 10, 2025
02de532
fixed run_plain in evm.rs and added trace
Sep 10, 2025
8e57208
clean up
Sep 10, 2025
1835a44
undo formatting change
Sep 10, 2025
ac7562a
added newline
Sep 10, 2025
ea3782e
remove function that came out of nowhere
Sep 10, 2025
aba3351
undo pointless change
Sep 10, 2025
568a217
Merge remote-tracking branch 'origin/master' into rve/revm2
Sep 10, 2025
25161bf
.
Sep 10, 2025
1bed5a8
Update from github-actions[bot] running command 'prdoc --audience run…
github-actions[bot] Sep 10, 2025
4113549
remove some crates from prdoc
Sep 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions prdoc/pr_9561.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: added trace logging in EVM interpreter loop
doc:
- audience: Runtime Dev
description: |-
Added trace logging for each instruction to evm::run function.
solves https://github.com/paritytech/polkadot-sdk/issues/9575
crates:
- name: pallet-revive
bump: patch
49 changes: 49 additions & 0 deletions substrate/frame/revive/src/vm/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ fn run<'a, E: Ext>(
) -> InterpreterResult {
let host = &mut DummyHost {};
loop {
#[cfg(not(feature = "std"))]
let action = interpreter.run_plain(table, host);
#[cfg(feature = "std")]
let action = run_plain(interpreter, table, host);
match action {
InterpreterAction::Return(result) => {
log::trace!(target: LOG_TARGET, "Evm return {:?}", result);
Expand Down Expand Up @@ -242,6 +245,52 @@ fn run_call<'a, E: Ext>(
}
}

/// Re-implementation of REVM run_plain function to add trace logging to our EVM interpreter loop.
/// NB: copied directly from revm tag v82
#[cfg(feature = "std")]
fn run_plain<WIRE: InterpreterTypes>(
interpreter: &mut Interpreter<WIRE>,
instruction_table: &revm::interpreter::InstructionTable<WIRE, DummyHost>,
host: &mut DummyHost,
) -> InterpreterAction {
use crate::{alloc::string::ToString, format};
use revm::{
bytecode::OpCode,
interpreter::{
instruction_context::InstructionContext,
interpreter_types::{Jumps, LoopControl, MemoryTr, StackTr},
},
};
while interpreter.bytecode.is_not_end() {
log::trace!(target: LOG_TARGET,
"[{pc}]: {opcode}, stacktop: {stacktop}, memory size: {memsize} {memory:?}",
pc = interpreter.bytecode.pc(),
opcode = OpCode::new(interpreter.bytecode.opcode())
.map_or("INVALID".to_string(), |x| format!("{:?}", x.info())),
stacktop = interpreter.stack.top().map_or("None".to_string(), |x| format!("{:#x}", x)),
memsize = interpreter.memory.size(),
// printing at most the first 32 bytes of memory
memory = interpreter
.memory
.slice_len(0, core::cmp::min(32, interpreter.memory.size()))
.to_vec(),
);
// Get current opcode.
let opcode = interpreter.bytecode.opcode();

// SAFETY: In analysis we are doing padding of bytecode so that we are sure that last
// byte instruction is STOP so we are safe to just increment program_counter bcs on last
// instruction it will do noop and just stop execution of this contract
interpreter.bytecode.relative_jump(1);
let context = InstructionContext { interpreter, host };
// Execute instruction.
instruction_table[opcode as usize](context);
}
interpreter.bytecode.revert_to_previous_pointer();

interpreter.take_next_action()
}

fn run_create<'a, E: Ext>(
interpreter: &mut Interpreter<EVMInterpreter<'a, E>>,
create_input: Box<CreateInputs>,
Expand Down
Loading