Skip to content

Commit c60fa3a

Browse files
lispcholimanThegaram
authored
fix(trace): fix memory trace size (#497)
* core/vm: for tracing, do not report post-op memory * fmt * bump version --------- Co-authored-by: Martin Holst Swende <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]>
1 parent d45613f commit c60fa3a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

core/vm/interpreter.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,15 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
249249
if err != nil || !contract.UseGas(dynamicCost) {
250250
return nil, ErrOutOfGas
251251
}
252-
}
253-
if memorySize > 0 {
254-
mem.Resize(memorySize)
255-
}
256-
257-
if in.cfg.Debug {
252+
// Do tracing before memory expansion
253+
if in.cfg.Debug {
254+
in.cfg.Tracer.CaptureState(pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
255+
logged = true
256+
}
257+
if memorySize > 0 {
258+
mem.Resize(memorySize)
259+
}
260+
} else if in.cfg.Debug {
258261
in.cfg.Tracer.CaptureState(pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
259262
logged = true
260263
}

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 4 // Major version component of the current release
2626
VersionMinor = 3 // Minor version component of the current release
27-
VersionPatch = 60 // Patch version component of the current release
27+
VersionPatch = 61 // Patch version component of the current release
2828
VersionMeta = "sepolia" // Version metadata to append to the version string
2929
)
3030

0 commit comments

Comments
 (0)