Skip to content

Commit f6aaacd

Browse files
committed
Replacing ShanghaiBlock -> ShanghaiTime and CancunBlock -> CancunTime
per PRs: - ethereum/go-ethereum#25878 - ethereum/go-ethereum#26481
1 parent af50f86 commit f6aaacd

File tree

11 files changed

+104
-102
lines changed

11 files changed

+104
-102
lines changed

app/ante/cosmos/setup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ func (suite *AnteTestSuite) SetupTest() {
8282
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
8383
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
8484
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
85-
evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt
86-
evmGenesis.Params.ChainConfig.CancunBlock = &maxInt
85+
evmGenesis.Params.ChainConfig.ShanghaiTime = &maxInt
86+
evmGenesis.Params.ChainConfig.CancunTime = &maxInt
8787
}
8888
if suite.evmParamsOption != nil {
8989
suite.evmParamsOption(&evmGenesis.Params)

app/ante/evm/setup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (suite *AnteTestSuite) SetupTest() {
6565
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
6666
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
6767
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
68-
evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt
69-
evmGenesis.Params.ChainConfig.CancunBlock = &maxInt
68+
evmGenesis.Params.ChainConfig.ShanghaiTime = &maxInt
69+
evmGenesis.Params.ChainConfig.CancunTime = &maxInt
7070
}
7171
if suite.evmParamsOption != nil {
7272
suite.evmParamsOption(&evmGenesis.Params)

app/ante/utils/setup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func (suite *AnteTestSuite) SetupTest() {
6262
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
6363
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
6464
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
65-
evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt
66-
evmGenesis.Params.ChainConfig.CancunBlock = &maxInt
65+
evmGenesis.Params.ChainConfig.ShanghaiTime = &maxInt
66+
evmGenesis.Params.ChainConfig.CancunTime = &maxInt
6767
}
6868
if suite.evmParamsOption != nil {
6969
suite.evmParamsOption(&evmGenesis.Params)

client/docs/swagger-ui/swagger.yaml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,15 +3836,15 @@ paths:
38363836
title: >-
38373837
merge_netsplit_block: Virtual fork after The Merge to
38383838
use as a network splitter
3839-
shanghai_block:
3839+
shanghai_time:
38403840
type: string
38413841
title: >-
3842-
shanghai_block switch block (nil = no fork, 0 =
3842+
shanghai_time switch block (nil = no fork, 0 =
38433843
already on shanghai)
3844-
cancun_block:
3844+
cancun_time:
38453845
type: string
38463846
title: >-
3847-
cancun_block switch block (nil = no fork, 0 = already
3847+
cancun_time switch block (nil = no fork, 0 = already
38483848
on cancun)
38493849
description: >-
38503850
ChainConfig defines the Ethereum ChainConfig parameters
@@ -4648,15 +4648,15 @@ paths:
46484648
in: query
46494649
required: false
46504650
type: string
4651-
- name: trace_config.overrides.shanghai_block
4651+
- name: trace_config.overrides.shanghai_time
46524652
description: >-
4653-
shanghai_block switch block (nil = no fork, 0 = already on
4653+
shanghai_time switch block (nil = no fork, 0 = already on
46544654
shanghai).
46554655
in: query
46564656
required: false
46574657
type: string
4658-
- name: trace_config.overrides.cancun_block
4659-
description: cancun_block switch block (nil = no fork, 0 = already on cancun).
4658+
- name: trace_config.overrides.cancun_time
4659+
description: cancun_time switch block (nil = no fork, 0 = already on cancun).
46604660
in: query
46614661
required: false
46624662
type: string
@@ -5157,15 +5157,15 @@ paths:
51575157
in: query
51585158
required: false
51595159
type: string
5160-
- name: trace_config.overrides.shanghai_block
5160+
- name: trace_config.overrides.shanghai_time
51615161
description: >-
5162-
shanghai_block switch block (nil = no fork, 0 = already on
5162+
shanghai_time switch block (nil = no fork, 0 = already on
51635163
shanghai).
51645164
in: query
51655165
required: false
51665166
type: string
5167-
- name: trace_config.overrides.cancun_block
5168-
description: cancun_block switch block (nil = no fork, 0 = already on cancun).
5167+
- name: trace_config.overrides.cancun_time
5168+
description: cancun_time switch block (nil = no fork, 0 = already on cancun).
51695169
in: query
51705170
required: false
51715171
type: string
@@ -45116,12 +45116,12 @@ definitions:
4511645116
title: >-
4511745117
merge_netsplit_block: Virtual fork after The Merge to use as a network
4511845118
splitter
45119-
shanghai_block:
45119+
shanghai_time:
4512045120
type: string
45121-
title: shanghai_block switch block (nil = no fork, 0 = already on shanghai)
45122-
cancun_block:
45121+
title: shanghai_time switch block (nil = no fork, 0 = already on shanghai)
45122+
cancun_time:
4512345123
type: string
45124-
title: cancun_block switch block (nil = no fork, 0 = already on cancun)
45124+
title: cancun_time switch block (nil = no fork, 0 = already on cancun)
4512545125
description: >-
4512645126
ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int
4512745127
values
@@ -45583,14 +45583,14 @@ definitions:
4558345583
title: >-
4558445584
merge_netsplit_block: Virtual fork after The Merge to use as a
4558545585
network splitter
45586-
shanghai_block:
45586+
shanghai_time:
4558745587
type: string
4558845588
title: >-
45589-
shanghai_block switch block (nil = no fork, 0 = already on
45589+
shanghai_time switch block (nil = no fork, 0 = already on
4559045590
shanghai)
45591-
cancun_block:
45591+
cancun_time:
4559245592
type: string
45593-
title: cancun_block switch block (nil = no fork, 0 = already on cancun)
45593+
title: cancun_time switch block (nil = no fork, 0 = already on cancun)
4559445594
description: >-
4559545595
ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int
4559645596
values
@@ -45782,15 +45782,15 @@ definitions:
4578245782
title: >-
4578345783
merge_netsplit_block: Virtual fork after The Merge to use as a
4578445784
network splitter
45785-
shanghai_block:
45785+
shanghai_time:
4578645786
type: string
4578745787
title: >-
45788-
shanghai_block switch block (nil = no fork, 0 = already on
45788+
shanghai_time switch block (nil = no fork, 0 = already on
4578945789
shanghai)
45790-
cancun_block:
45790+
cancun_time:
4579145791
type: string
4579245792
title: >-
45793-
cancun_block switch block (nil = no fork, 0 = already on
45793+
cancun_time switch block (nil = no fork, 0 = already on
4579445794
cancun)
4579545795
description: >-
4579645796
ChainConfig defines the Ethereum ChainConfig parameters using
@@ -45965,14 +45965,14 @@ definitions:
4596545965
title: >-
4596645966
merge_netsplit_block: Virtual fork after The Merge to use as a
4596745967
network splitter
45968-
shanghai_block:
45968+
shanghai_time:
4596945969
type: string
4597045970
title: >-
45971-
shanghai_block switch block (nil = no fork, 0 = already on
45971+
shanghai_time switch block (nil = no fork, 0 = already on
4597245972
shanghai)
45973-
cancun_block:
45973+
cancun_time:
4597445974
type: string
45975-
title: cancun_block switch block (nil = no fork, 0 = already on cancun)
45975+
title: cancun_time switch block (nil = no fork, 0 = already on cancun)
4597645976
description: >-
4597745977
ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int
4597845978
values

infrastructure/kubernetes/mezo-staging/mezo-genesis-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ data:
192192
"arrow_glacier_block": "0",
193193
"gray_glacier_block": "0",
194194
"merge_netsplit_block": "0",
195-
"shanghai_block": "0",
196-
"cancun_block": "0"
195+
"shanghai_time": "0",
196+
"cancun_time": "0"
197197
},
198198
"allow_unprotected_txs": false
199199
}

proto/ethermint/evm/v1/evm.proto

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ message ChainConfig {
117117
(gogoproto.customtype) = "cosmossdk.io/math.Int",
118118
(gogoproto.moretags) = "yaml:\"merge_netsplit_block\""
119119
];
120-
// shanghai_block switch block (nil = no fork, 0 = already on shanghai)
121-
string shanghai_block = 22 [
120+
// shanghai_time switch block (nil = no fork, 0 = already on shanghai)
121+
string shanghai_time = 22 [
122122
(gogoproto.customtype) = "cosmossdk.io/math.Int",
123-
(gogoproto.moretags) = "yaml:\"shanghai_block\""
123+
(gogoproto.moretags) = "yaml:\"shanghai_time\""
124124
];
125-
// cancun_block switch block (nil = no fork, 0 = already on cancun)
126-
string cancun_block = 23 [
125+
// cancun_time switch block (nil = no fork, 0 = already on cancun)
126+
string cancun_time = 23 [
127127
(gogoproto.customtype) = "cosmossdk.io/math.Int",
128-
(gogoproto.moretags) = "yaml:\"cancun_block\""
128+
(gogoproto.moretags) = "yaml:\"cancun_time\""
129129
];
130130
}
131131

x/evm/keeper/setup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func (suite *KeeperTestSuite) SetupAppWithT(checkTx bool, t require.TestingT) {
121121
evmGenesis.Params.ChainConfig.ArrowGlacierBlock = &maxInt
122122
evmGenesis.Params.ChainConfig.GrayGlacierBlock = &maxInt
123123
evmGenesis.Params.ChainConfig.MergeNetsplitBlock = &maxInt
124-
evmGenesis.Params.ChainConfig.ShanghaiBlock = &maxInt
125-
evmGenesis.Params.ChainConfig.CancunBlock = &maxInt
124+
evmGenesis.Params.ChainConfig.ShanghaiTime = &maxInt
125+
evmGenesis.Params.ChainConfig.CancunTime = &maxInt
126126
genesis[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis)
127127
}
128128

x/evm/migrations/v4/types/evm.pb.go

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/evm/types/chain_config.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import (
2929
// EthereumConfig returns an Ethereum ChainConfig for EVM state transitions.
3030
// All the negative or nil values are converted to nil
3131
func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
32+
shanghaiTime := cc.ShanghaiTime.BigInt().Uint64()
33+
cancunTime := cc.CancunTime.BigInt().Uint64()
3234
return &params.ChainConfig{
3335
ChainID: chainID,
3436
HomesteadBlock: getBlockValue(cc.HomesteadBlock),
@@ -47,8 +49,8 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
4749
ArrowGlacierBlock: getBlockValue(cc.ArrowGlacierBlock),
4850
GrayGlacierBlock: getBlockValue(cc.GrayGlacierBlock),
4951
MergeNetsplitBlock: getBlockValue(cc.MergeNetsplitBlock),
50-
ShanghaiBlock: getBlockValue(cc.ShanghaiBlock),
51-
CancunBlock: getBlockValue(cc.CancunBlock),
52+
ShanghaiTime: &shanghaiTime,
53+
CancunTime: &cancunTime,
5254
TerminalTotalDifficulty: nil,
5355
Ethash: nil,
5456
Clique: nil,
@@ -72,7 +74,7 @@ func DefaultChainConfig() ChainConfig {
7274
arrowGlacierBlock := sdkmath.ZeroInt()
7375
grayGlacierBlock := sdkmath.ZeroInt()
7476
mergeNetsplitBlock := sdkmath.ZeroInt()
75-
shanghaiBlock := sdkmath.ZeroInt()
77+
shanghaiTime := sdkmath.ZeroInt()
7678
cancunBlock := sdkmath.ZeroInt()
7779

7880
return ChainConfig{
@@ -93,8 +95,8 @@ func DefaultChainConfig() ChainConfig {
9395
ArrowGlacierBlock: &arrowGlacierBlock,
9496
GrayGlacierBlock: &grayGlacierBlock,
9597
MergeNetsplitBlock: &mergeNetsplitBlock,
96-
ShanghaiBlock: &shanghaiBlock,
97-
CancunBlock: &cancunBlock,
98+
ShanghaiTime: &shanghaiTime,
99+
CancunTime: &cancunBlock,
98100
}
99101
}
100102

@@ -157,11 +159,11 @@ func (cc ChainConfig) Validate() error {
157159
if err := validateBlock(cc.MergeNetsplitBlock); err != nil {
158160
return errorsmod.Wrap(err, "MergeNetsplitBlock")
159161
}
160-
if err := validateBlock(cc.ShanghaiBlock); err != nil {
161-
return errorsmod.Wrap(err, "ShanghaiBlock")
162+
if err := validateBlock(cc.ShanghaiTime); err != nil {
163+
return errorsmod.Wrap(err, "ShanghaiTime")
162164
}
163-
if err := validateBlock(cc.CancunBlock); err != nil {
164-
return errorsmod.Wrap(err, "CancunBlock")
165+
if err := validateBlock(cc.CancunTime); err != nil {
166+
return errorsmod.Wrap(err, "CancunTime")
165167
}
166168
// NOTE: chain ID is not needed to check config order
167169
if err := cc.EthereumConfig(nil).CheckConfigForkOrder(); err != nil {

0 commit comments

Comments
 (0)