Skip to content

Commit

Permalink
[genesis] set Okhotsk to activate at 01-11-2023 12am UTC (#3720)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Dec 20, 2022
1 parent c2e8d5e commit 5d4e409
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
25 changes: 8 additions & 17 deletions action/protocol/execution/evm/evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ func TestConstantinople(t *testing.T) {
},
{
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
37662680,
21542760,
},
// after Okhotsk
{
action.EmptyAddress,
37662681,
21542761,
},
{
"io1pcg2ja9krrhujpazswgz77ss46xgt88afqlk6y",
Expand All @@ -222,25 +222,14 @@ func TestConstantinople(t *testing.T) {
nil,
)
require.NoError(err)
opt := []StateDBAdapterOption{}
if !g.IsAleutian(e.height) {
opt = append(opt, NotFixTopicCopyBugOption())
}
if g.IsGreenland(e.height) {
opt = append(opt, AsyncContractTrieOption())
}
if g.IsKamchatka(e.height) {
opt = append(opt, FixSnapshotOrderOption())
}
stateDB, err := NewStateDBAdapter(sm, e.height, hash.ZeroHash256, opt...)
require.NoError(err)

fCtx := protocol.WithBlockCtx(ctx, protocol.BlockCtx{
fCtx := protocol.WithFeatureCtx(protocol.WithBlockCtx(ctx, protocol.BlockCtx{
Producer: identityset.Address(27),
GasLimit: testutil.TestGasLimit,
BlockHeight: e.height,
})
fCtx = protocol.WithFeatureCtx(fCtx)
}))
stateDB, err := prepareStateDB(fCtx, sm)
require.NoError(err)
ps, err := newParams(fCtx, ex, stateDB, func(uint64) (hash.Hash256, error) {
return hash.ZeroHash256, nil
})
Expand Down Expand Up @@ -289,6 +278,8 @@ func TestConstantinople(t *testing.T) {

// Okhotsk = enable Berlin and London
isOkhotsk := g.IsOkhotsk(e.height)
require.Equal(big.NewInt(int64(g.OkhotskBlockHeight)), evmChainConfig.BerlinBlock)
require.Equal(big.NewInt(int64(g.OkhotskBlockHeight)), evmChainConfig.LondonBlock)
require.Equal(isOkhotsk, evmChainConfig.IsBerlin(evm.Context.BlockNumber))
require.Equal(isOkhotsk, chainRules.IsBerlin)
require.Equal(isOkhotsk, evmChainConfig.IsLondon(evm.Context.BlockNumber))
Expand Down
2 changes: 1 addition & 1 deletion blockchain/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func defaultConfig() Genesis {
LordHoweBlockHeight: 13979161,
MidwayBlockHeight: 16509241,
NewfoundlandBlockHeight: 17662681,
OkhotskBlockHeight: 37662681,
OkhotskBlockHeight: 21542761,
ToBeEnabledBlockHeight: math.MaxUint64,
},
Account: Account{
Expand Down
6 changes: 3 additions & 3 deletions blockchain/genesis/heightupgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func TestNewHeightChange(t *testing.T) {
require.True(cfg.IsMidway(uint64(16509241)))
require.False(cfg.IsNewfoundland(uint64(17662680)))
require.True(cfg.IsNewfoundland(uint64(17662681)))
require.False(cfg.IsOkhotsk(uint64(37662680)))
require.True(cfg.IsOkhotsk(uint64(37662681)))
require.False(cfg.IsOkhotsk(uint64(21542760)))
require.True(cfg.IsOkhotsk(uint64(21542761)))

require.Equal(cfg.PacificBlockHeight, uint64(432001))
require.Equal(cfg.AleutianBlockHeight, uint64(864001))
Expand All @@ -72,5 +72,5 @@ func TestNewHeightChange(t *testing.T) {
require.Equal(cfg.LordHoweBlockHeight, uint64(13979161))
require.Equal(cfg.MidwayBlockHeight, uint64(16509241))
require.Equal(cfg.NewfoundlandBlockHeight, uint64(17662681))
require.Equal(cfg.OkhotskBlockHeight, uint64(37662681))
require.Equal(cfg.OkhotskBlockHeight, uint64(21542761))
}

0 comments on commit 5d4e409

Please sign in to comment.