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 <martin@swende.se>
Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
This commit is contained in:
Zhang Zhuo 2023-09-01 17:01:53 +08:00 committed by GitHub
parent d45613f4b5
commit c60fa3a643
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View file

@ -249,12 +249,15 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
if err != nil || !contract.UseGas(dynamicCost) {
return nil, ErrOutOfGas
}
// Do tracing before memory expansion
if in.cfg.Debug {
in.cfg.Tracer.CaptureState(pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
logged = true
}
if memorySize > 0 {
mem.Resize(memorySize)
}
if in.cfg.Debug {
} else if in.cfg.Debug {
in.cfg.Tracer.CaptureState(pc, op, gasCopy, cost, callContext, in.returnData, in.evm.depth, err)
logged = true
}

View file

@ -24,7 +24,7 @@ import (
const (
VersionMajor = 4 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 60 // Patch version component of the current release
VersionPatch = 61 // Patch version component of the current release
VersionMeta = "sepolia" // Version metadata to append to the version string
)