Skip to content

Commit e8c2c4c

Browse files
committed
simulators/ethereum/engine: Sharding->Cancun
1 parent 5e68485 commit e8c2c4c

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

simulators/ethereum/engine/clmock/clmock.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ func isShanghai(blockTimestamp uint64, shanghaiTimestamp *big.Int) bool {
113113
return shanghaiTimestamp != nil && big.NewInt(int64(blockTimestamp)).Cmp(shanghaiTimestamp) >= 0
114114
}
115115

116-
func isSharding(blockTimestamp uint64, shardingTimestamp *big.Int) bool {
117-
return shardingTimestamp != nil && big.NewInt(int64(blockTimestamp)).Cmp(shardingTimestamp) >= 0
116+
func isCancun(blockTimestamp uint64, cancunTimestamp *big.Int) bool {
117+
return cancunTimestamp != nil && big.NewInt(int64(blockTimestamp)).Cmp(cancunTimestamp) >= 0
118118
}
119119

120120
func NewCLMocker(t *hivesim.T, slotsToSafe, slotsToFinalized, safeSlotsToImportOptimistically *big.Int, forkConfig globals.ForkConfig) *CLMocker {
@@ -369,7 +369,7 @@ func (cl *CLMocker) GetNextPayload() {
369369
var err error
370370
ctx, cancel := context.WithTimeout(cl.TestContext, globals.RPCTimeout)
371371
defer cancel()
372-
if isSharding(cl.LatestPayloadAttributes.Timestamp, cl.ShardingForkTimestamp) {
372+
if isCancun(cl.LatestPayloadAttributes.Timestamp, cl.CancunTimestamp) {
373373
cl.LatestPayloadBuilt, cl.LatestBlockValue, cl.LatestBlobBundle, err = cl.NextBlockProducer.GetPayloadV3(ctx, cl.NextPayloadID)
374374
} else if isShanghai(cl.LatestPayloadAttributes.Timestamp, cl.ShanghaiTimestamp) {
375375
cl.LatestPayloadBuilt, cl.LatestBlockValue, err = cl.NextBlockProducer.GetPayloadV2(ctx, cl.NextPayloadID)
@@ -619,7 +619,7 @@ func (cl *CLMocker) BroadcastNewPayload(payload *api.ExecutableData) []ExecutePa
619619
execPayloadResp api.PayloadStatusV1
620620
err error
621621
)
622-
if isSharding(payload.Timestamp, cl.ShardingForkTimestamp) {
622+
if isCancun(payload.Timestamp, cl.CancunTimestamp) {
623623
execPayloadResp, err = ec.NewPayloadV3(ctx, payload)
624624
} else if isShanghai(payload.Timestamp, cl.ShanghaiTimestamp) {
625625
execPayloadResp, err = ec.NewPayloadV2(ctx, payload)

simulators/ethereum/engine/globals/globals.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ var (
133133

134134
// Global types
135135
type ForkConfig struct {
136-
ShanghaiTimestamp *big.Int
137-
ShardingForkTimestamp *big.Int
136+
ShanghaiTimestamp *big.Int
137+
CancunTimestamp *big.Int
138138
}

simulators/ethereum/engine/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ require (
9494
rsc.io/tmplfunc v0.0.3 // indirect
9595
)
9696

97-
replace github.com/ethereum/go-ethereum => github.com/mdehoog/go-ethereum v1.10.19-0.20230424164545-6f54b68a31de
97+
replace github.com/ethereum/go-ethereum => github.com/mdehoog/go-ethereum v1.10.19-0.20230425170637-4bf5349a398b

simulators/ethereum/engine/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpe
345345
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
346346
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
347347
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
348-
github.com/mdehoog/go-ethereum v1.10.19-0.20230424164545-6f54b68a31de h1:o+C9qzIVKZE8a0+CQhgU0M/hfEaRd+uxqsrvEPLsl2g=
349-
github.com/mdehoog/go-ethereum v1.10.19-0.20230424164545-6f54b68a31de/go.mod h1:LDxvmzuVWhMl85FiRncDQZbgeg4218U/X73hJuRxszc=
348+
github.com/mdehoog/go-ethereum v1.10.19-0.20230425170637-4bf5349a398b h1:kPHJ0IGfdCk7Cry86FXFWwo3dCFx4DMjYRnrmxnNrjg=
349+
github.com/mdehoog/go-ethereum v1.10.19-0.20230425170637-4bf5349a398b/go.mod h1:LDxvmzuVWhMl85FiRncDQZbgeg4218U/X73hJuRxszc=
350350
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
351351
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
352352
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=

simulators/ethereum/engine/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ func addTestsToSuite(sim *hivesim.Simulation, suite *hivesim.Suite, tests []test
108108
newParams = newParams.Set("HIVE_SHANGHAI_TIMESTAMP", fmt.Sprintf("%d", currentTest.GetForkConfig().ShanghaiTimestamp))
109109
// Ensure the merge transition is activated before shanghai.
110110
newParams = newParams.Set("HIVE_MERGE_BLOCK_ID", "0")
111-
if currentTest.GetForkConfig().ShardingForkTimestamp != nil {
112-
newParams = newParams.Set("HIVE_SHARDING_FORK_TIMESTAMP", fmt.Sprintf("%d", currentTest.GetForkConfig().ShardingForkTimestamp))
111+
if currentTest.GetForkConfig().CancunTimestamp != nil {
112+
newParams = newParams.Set("HIVE_CANCUN_TIMESTAMP", fmt.Sprintf("%d", currentTest.GetForkConfig().CancunTimestamp))
113113
}
114114
}
115115

simulators/ethereum/engine/suites/blobs/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"github.com/ethereum/hive/simulators/ethereum/engine/globals"
1010
)
1111

12-
// Generates the fork config, including sharding fork timestamp.
12+
// Generates the fork config, including cancun fork timestamp.
1313
func (bs *BlobsBaseSpec) GetForkConfig() globals.ForkConfig {
1414
return globals.ForkConfig{
15-
ShanghaiTimestamp: big.NewInt(0),
16-
ShardingForkTimestamp: big.NewInt(int64(bs.BlobsForkHeight) * int64(bs.GetBlockTimeIncrements())),
15+
ShanghaiTimestamp: big.NewInt(0),
16+
CancunTimestamp: big.NewInt(int64(bs.BlobsForkHeight) * int64(bs.GetBlockTimeIncrements())),
1717
}
1818
}
1919

simulators/ethereum/engine/suites/blobs/tests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ var Tests = []test.SpecInterface{
3434
&BlobsBaseSpec{
3535

3636
Spec: test.Spec{
37-
Name: "Blob Transactions On Genesis",
37+
Name: "Blob Transactions On Block 1, Cancun Genesis",
3838
About: `
39-
Tests the sharding fork on genesis.
39+
Tests the Cancun fork since genesis.
4040
`,
4141
},
4242

simulators/ethereum/go.work.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vq
451451
github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
452452
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
453453
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
454-
github.com/mdehoog/go-ethereum v1.10.19-0.20230424164545-6f54b68a31de h1:o+C9qzIVKZE8a0+CQhgU0M/hfEaRd+uxqsrvEPLsl2g=
455-
github.com/mdehoog/go-ethereum v1.10.19-0.20230424164545-6f54b68a31de/go.mod h1:LDxvmzuVWhMl85FiRncDQZbgeg4218U/X73hJuRxszc=
454+
github.com/mdehoog/go-ethereum v1.10.19-0.20230425170637-4bf5349a398b h1:kPHJ0IGfdCk7Cry86FXFWwo3dCFx4DMjYRnrmxnNrjg=
455+
github.com/mdehoog/go-ethereum v1.10.19-0.20230425170637-4bf5349a398b/go.mod h1:LDxvmzuVWhMl85FiRncDQZbgeg4218U/X73hJuRxszc=
456456
github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
457457
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4=
458458
github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A=

0 commit comments

Comments
 (0)