Skip to content

Commit

Permalink
[evm] proper handle refundSnapshot and upgrade go-ethereum release
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Dec 13, 2022
1 parent 3a231c3 commit 923edf8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions action/protocol/execution/evm/evmstatedbadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 923edf8

Please sign in to comment.