diff --git a/action/protocol/execution/evm/evmstatedbadapter.go b/action/protocol/execution/evm/evmstatedbadapter.go index cadfcb2d99..a04c62a6c2 100644 --- a/action/protocol/execution/evm/evmstatedbadapter.go +++ b/action/protocol/execution/evm/evmstatedbadapter.go @@ -557,6 +557,14 @@ func (stateDB *StateDBAdapter) RevertToSnapshot(snapshot int) { // restore gas refund if !stateDB.manualCorrectGasRefund { stateDB.refund = stateDB.refundSnapshot[snapshot] + delete(stateDB.refundSnapshot, snapshot) + for i := snapshot + 1; ; i++ { + if _, ok := stateDB.refundSnapshot[i]; ok { + delete(stateDB.refundSnapshot, i) + } else { + break + } + } } // restore logs and txLogs if stateDB.revertLog { diff --git a/go.mod b/go.mod index 0f618a277b..2eb7ac6e47 100644 --- a/go.mod +++ b/go.mod @@ -200,6 +200,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v1.7.4-0.20221123031803-9e576f7b3e4b +replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v0.4.2 replace golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190212162355-a5947ffaace3 diff --git a/go.sum b/go.sum index d7afac391c..c5f000b1fe 100644 --- a/go.sum +++ b/go.sum @@ -486,8 +486,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/iotexproject/go-ethereum v1.7.4-0.20221123031803-9e576f7b3e4b h1:ImtTdFM8yaH8mYL4sd4idxHiV5J0r12B1SYiyBezdCs= -github.com/iotexproject/go-ethereum v1.7.4-0.20221123031803-9e576f7b3e4b/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= +github.com/iotexproject/go-ethereum v0.4.2 h1:aXfCHX4tL6/Gnh24p4KZGwiKmu63bjMrAAshPRBp6Pk= +github.com/iotexproject/go-ethereum v0.4.2/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/iotexproject/go-fsm v1.0.0 h1:Zrg9JnNDUZg4Anpj6oa0Tk4+sXbHTpJzI0v5/Cj5N6A= github.com/iotexproject/go-fsm v1.0.0/go.mod h1:t3aYXtCCcQxyS7oduQZyuUpPnVI4ddFTwbAagHN7fT0= github.com/iotexproject/go-p2p v0.3.5 h1:F71XxYQtR25youD+dCXnMgtfiCKGUFh8KDIqU7u5xOk=