Skip to content

Commit

Permalink
[evm] enable opCall fix at Jutland height
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Sep 20, 2021
1 parent 3eea5b7 commit f245109
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions action/protocol/execution/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ func getChainConfig(g genesis.Blockchain, height uint64) *params.ChainConfig {
if g.IsIceland(height) {
chainConfig.ChainID = new(big.Int).SetUint64(uint64(config.EVMNetworkID()))
}
// for safety, we enable the opCall fix at Jutland height
// to be reverted post-Jutland if verified that this is not necessary
chainConfig.JutlandBlock = new(big.Int).SetUint64(g.JutlandBlockHeight)
return &chainConfig
}

Expand Down
3 changes: 3 additions & 0 deletions action/protocol/execution/evm/evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ func TestConstantinople(t *testing.T) {
require.False(evmChainConfig.IsLondon(evm.Context.BlockNumber))
require.False(chainRules.IsBerlin)
require.False(chainRules.IsLondon)

require.Equal(big.NewInt(int64(g.JutlandBlockHeight)), evmChainConfig.JutlandBlock)
require.Equal(g.IsJutland(e.height), evmChainConfig.IsJutland(evm.Context.BlockNumber))
}
}

Expand Down
1 change: 1 addition & 0 deletions action/protocol/execution/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ func (sct *SmartContractTest) prepareBlockchain(
cfg.Genesis.FairbankBlockHeight = 0
cfg.Genesis.GreenlandBlockHeight = 0
cfg.Genesis.IcelandBlockHeight = 0
cfg.Genesis.JutlandBlockHeight = 0
}
for _, expectedBalance := range sct.InitBalances {
cfg.Genesis.InitBalanceMap[expectedBalance.Account] = expectedBalance.Balance().String()
Expand Down
2 changes: 1 addition & 1 deletion action/protocol/execution/testdata/datacopy.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"comment": "the data of return is [0x11, 0x22, 0x33]",
"expectedBlockInfos" : {
"txRootHash" : "3672945ca662bea4dd977e799374c5ce36c0c3e9ecbe98f1655f33439bbfe40c",
"stateRootHash" : "6fb3dc7f5ef66ce9b384f034191d6a67801e01961ecd824061c4101035844667",
"stateRootHash" : "3c1c42103ce3fbb116bbfbbc71d9df35055370e6aab5153822ee7cdd661bef1c",
"receiptRootHash" : "0dfe7718f029aaffccd9c20bfaa50a1fb3405014de68af4f89516160de53d2f2"
}
}]
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ require (
gopkg.in/yaml.v2 v2.4.0
)

replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v0.4.0
replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v0.4.0-safefix

replace golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190212162355-a5947ffaace3
replace golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190212162355-a5947ffaace3
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,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 v0.4.0 h1:3GX+vZTI6KeazPabaw3oyLpPl1dOuyJyqqGpWspi1Gs=
github.com/iotexproject/go-ethereum v0.4.0/go.mod h1:pJNuIUYfX5+JKzSD/BTdNsvJSZ1TJqmz0dVyXMAbf6M=
github.com/iotexproject/go-ethereum v0.4.0-safefix h1:e0r20bkJlIMfJumoSQmTnF38I0EpQW5fP6tHI5PRv7s=
github.com/iotexproject/go-ethereum v0.4.0-safefix/go.mod h1:pJNuIUYfX5+JKzSD/BTdNsvJSZ1TJqmz0dVyXMAbf6M=
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.2 h1:iPVhimnJW5+cg9y/ezXhZpkPwU/fp3u70cmzf6njKC0=
Expand Down Expand Up @@ -1588,4 +1588,4 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=

0 comments on commit f245109

Please sign in to comment.