Skip to content

Commit f52501f

Browse files
CoderZhienvestcc
andauthored
[emv] enable Bellatrix at Redsea height (#3942)
Co-authored-by: envestcc <[email protected]>
1 parent a43f11f commit f52501f

File tree

4 files changed

+67
-18
lines changed

4 files changed

+67
-18
lines changed

action/protocol/execution/evm/evm.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,12 @@ func getChainConfig(g genesis.Blockchain, height uint64, id uint32) *params.Chai
393393
if g.IsIceland(height) {
394394
chainConfig.ChainID = new(big.Int).SetUint64(uint64(id))
395395
}
396-
// enable Berlin and London
396+
// enable Berlin and London at Okhotsk
397397
chainConfig.BerlinBlock = new(big.Int).SetUint64(g.OkhotskBlockHeight)
398398
chainConfig.LondonBlock = new(big.Int).SetUint64(g.OkhotskBlockHeight)
399+
// enable ArrowGlacier, GrayGlacier at Redsea
400+
chainConfig.ArrowGlacierBlock = new(big.Int).SetUint64(g.RedseaBlockHeight)
401+
chainConfig.GrayGlacierBlock = new(big.Int).SetUint64(g.RedseaBlockHeight)
399402
return &chainConfig
400403
}
401404

action/protocol/execution/evm/evm_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,20 @@ func TestConstantinople(t *testing.T) {
219219
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
220220
24838200,
221221
},
222-
// after Quebec
222+
// after Quebec - Redsea
223223
{
224224
action.EmptyAddress,
225225
24838201,
226226
},
227+
{
228+
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
229+
34838200,
230+
},
231+
// after Redsea
232+
{
233+
action.EmptyAddress,
234+
34838201,
235+
},
227236
{
228237
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
229238
math.MaxUint64,
@@ -302,7 +311,18 @@ func TestConstantinople(t *testing.T) {
302311
require.Equal(isOkhotsk, chainRules.IsBerlin)
303312
require.Equal(isOkhotsk, evmChainConfig.IsLondon(evm.Context.BlockNumber))
304313
require.Equal(isOkhotsk, chainRules.IsLondon)
314+
315+
// Redsea = enable ArrowGlacier, GrayGlacier
316+
isRedsea := g.IsRedsea(e.height)
317+
require.Equal(big.NewInt(int64(g.RedseaBlockHeight)), evmChainConfig.ArrowGlacierBlock)
318+
require.Equal(big.NewInt(int64(g.RedseaBlockHeight)), evmChainConfig.GrayGlacierBlock)
319+
require.Equal(isRedsea, evmChainConfig.IsArrowGlacier(evm.Context.BlockNumber))
320+
require.Equal(isRedsea, evmChainConfig.IsGrayGlacier(evm.Context.BlockNumber))
321+
322+
// Merge, Shanghai and Cancun not yet enabled
305323
require.False(chainRules.IsMerge)
324+
require.False(chainRules.IsShanghai)
325+
require.False(evmChainConfig.IsCancun(evm.Context.BlockNumber))
306326

307327
// test basefee
308328
require.Equal(new(big.Int), evm.Context.BaseFee)

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
require (
66
github.com/cenkalti/backoff v2.2.1+incompatible
7-
github.com/ethereum/go-ethereum v1.10.21
7+
github.com/ethereum/go-ethereum v1.10.26
88
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a
99
github.com/go-redis/redis/v8 v8.11.4
1010
github.com/golang/mock v1.6.0
@@ -70,7 +70,7 @@ require (
7070
github.com/benbjohnson/clock v1.0.3 // indirect
7171
github.com/beorn7/perks v1.0.1 // indirect
7272
github.com/btcsuite/btcd v0.21.0-beta // indirect
73-
github.com/btcsuite/btcd/btcec/v2 v2.1.2 // indirect
73+
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
7474
github.com/davecgh/go-spew v1.1.1 // indirect
7575
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
7676
github.com/deckarep/golang-set v1.8.0 // indirect
@@ -201,6 +201,6 @@ require (
201201
gopkg.in/yaml.v3 v3.0.1 // indirect
202202
)
203203

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

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

0 commit comments

Comments
 (0)