Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[emv] enable Bellatrix at Redsea height #3942

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion action/protocol/execution/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,12 @@ func getChainConfig(g genesis.Blockchain, height uint64, id uint32) *params.Chai
if g.IsIceland(height) {
chainConfig.ChainID = new(big.Int).SetUint64(uint64(id))
}
// enable Berlin and London
// enable Berlin and London at Okhotsk
chainConfig.BerlinBlock = new(big.Int).SetUint64(g.OkhotskBlockHeight)
chainConfig.LondonBlock = new(big.Int).SetUint64(g.OkhotskBlockHeight)
// enable ArrowGlacier, GrayGlacier at Redsea
chainConfig.ArrowGlacierBlock = new(big.Int).SetUint64(g.RedseaBlockHeight)
chainConfig.GrayGlacierBlock = new(big.Int).SetUint64(g.RedseaBlockHeight)
return &chainConfig
}

Expand Down
22 changes: 21 additions & 1 deletion action/protocol/execution/evm/evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,20 @@ func TestConstantinople(t *testing.T) {
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
24838200,
},
// after Quebec
// after Quebec - Redsea
{
action.EmptyAddress,
24838201,
},
{
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
34838200,
},
// after Redsea
{
action.EmptyAddress,
34838201,
},
{
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
math.MaxUint64,
Expand Down Expand Up @@ -302,7 +311,18 @@ func TestConstantinople(t *testing.T) {
require.Equal(isOkhotsk, chainRules.IsBerlin)
require.Equal(isOkhotsk, evmChainConfig.IsLondon(evm.Context.BlockNumber))
require.Equal(isOkhotsk, chainRules.IsLondon)

// Redsea = enable ArrowGlacier, GrayGlacier
isRedsea := g.IsRedsea(e.height)
require.Equal(big.NewInt(int64(g.RedseaBlockHeight)), evmChainConfig.ArrowGlacierBlock)
require.Equal(big.NewInt(int64(g.RedseaBlockHeight)), evmChainConfig.GrayGlacierBlock)
require.Equal(isRedsea, evmChainConfig.IsArrowGlacier(evm.Context.BlockNumber))
require.Equal(isRedsea, evmChainConfig.IsGrayGlacier(evm.Context.BlockNumber))

// Merge, Shanghai and Cancun not yet enabled
require.False(chainRules.IsMerge)
require.False(chainRules.IsShanghai)
require.False(evmChainConfig.IsCancun(evm.Context.BlockNumber))

// test basefee
require.Equal(new(big.Int), evm.Context.BaseFee)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/ethereum/go-ethereum v1.10.21
github.com/ethereum/go-ethereum v1.10.26
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
github.com/go-redis/redis/v8 v8.11.4
github.com/golang/mock v1.6.0
Expand Down Expand Up @@ -70,7 +70,7 @@ require (
github.com/benbjohnson/clock v1.0.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.21.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.1.2 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
Expand Down Expand Up @@ -201,6 +201,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v0.4.2
replace github.com/ethereum/go-ethereum => github.com/iotexproject/go-ethereum v0.4.4

replace golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20190212162355-a5947ffaace3
Loading