Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

# v80 tag (revm v27.0.0) -> v81 tag ( revm v27.0.1)

* Inspector fn `step_end` is now called even if Inspector `step` sets the action. Previously this was not the case
* https://github.com/bluealloy/revm/pull/2687
* this additionally fixes panic bug where `bytecode.opcode()` would panic in `step_end`

# v70 tag (revm v22.0.2) -> v71 tag ( revm v23.0.0)

* Removal of `EvmData`.
Expand Down
4 changes: 4 additions & 0 deletions crates/inspector/src/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ mod tests {
#[derive(Default, Debug)]
struct StackInspector {
pc: usize,
opcode: u8,
gas_inspector: GasInspector,
gas_remaining_steps: Vec<(usize, u64)>,
}
Expand All @@ -103,10 +104,13 @@ mod tests {

fn step(&mut self, interp: &mut Interpreter<INTR>, _context: &mut CTX) {
self.pc = interp.bytecode.pc();
self.opcode = interp.bytecode.opcode();
self.gas_inspector.step(&interp.gas);
}

fn step_end(&mut self, interp: &mut Interpreter<INTR>, _context: &mut CTX) {
interp.bytecode.pc();
interp.bytecode.opcode();
self.gas_inspector.step_end(&mut interp.gas);
self.gas_remaining_steps
.push((self.pc, self.gas_inspector.gas_remaining()));
Expand Down
7 changes: 7 additions & 0 deletions crates/inspector/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,18 @@ where
log_num = new_log;
}

// if loops is ending, break the loop so we can revert to the previous pointer and then call step_end.
if interpreter.bytecode.is_end() {
break;
}

// Call step_end.
inspector.step_end(interpreter, context);
}

interpreter.bytecode.revert_to_previous_pointer();
// call step_end again to handle the last instruction
inspector.step_end(interpreter, context);

let next_action = interpreter.take_next_action();

Expand Down
Loading