Skip to content

Commit

Permalink
[emv] enable Bellatrix at Redsea height (#3942)
Browse files Browse the repository at this point in the history
Co-authored-by: envestcc <chen1233216@hotmail.com>
  • Loading branch information
CoderZhi and envestcc committed Oct 23, 2023
1 parent a43f11f commit f52501f
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 18 deletions.
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

0 comments on commit f52501f

Please sign in to comment.