Skip to content

Commit ada6415

Browse files
spencer-tbEikix
authored andcommitted
simulators/ethereum/engine: update test names for distinction (ethereum#914)
1 parent 09ed207 commit ada6415

12 files changed

+90
-73
lines changed

simulators/ethereum/engine/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Send a NewPayload directive to the client including an incorrect BlockHash, shou
114114
- NewPayload while syncing, on canonical chain
115115
- NewPayload while syncing, on side chain
116116

117-
- ParentHash==BlockHash on NewPayload:
117+
- ParentHash equals BlockHash on NewPayload:
118118
Send a NewPayload directive to the client including ParentHash that is equal to the BlockHash (Incorrect hash).
119119

120120
- Invalid Transition Payload:
@@ -176,10 +176,10 @@ Test that performing a re-org back into a previous block of the canonical chain
176176
Build an alternative chain of 10 payloads.
177177
Perform `newPayload(P10')` + `fcU(P10')`, which should result in client `SYNCING`. Verify that the client can re-org back to the canonical chain after sending `newPayload(P11)` + `fcU(P11)`.
178178

179-
- Import and re-org to previously validated payload on a side chain:
179+
- Re-org to Previously Validated Sidechain Payload:
180180
Attempt to re-org to one of the sidechain (previously validated) payloads, but not the leaf, and also build a new payload from this sidechain.
181181

182-
- Safe Re-Org to Side Chain
182+
- Safe Re-Org to Side Chain:
183183
Perform a re-org of the safe block (and head block) to a valid sidechain.
184184

185185
### Suggested Fee Recipient in Payload creation

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

+22-22
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ var Tests = []test.Spec{
158158
&CancunBaseSpec{
159159

160160
BaseSpec: test.BaseSpec{
161-
Name: "Blob Transaction Ordering, Single Account",
161+
Name: "Blob Transaction Ordering, Single Account, Single Blob",
162162
About: `
163163
Send N blob transactions with cancun.MAX_BLOBS_PER_BLOCK-1 blobs each,
164164
using account A.
@@ -203,7 +203,7 @@ var Tests = []test.Spec{
203203
&CancunBaseSpec{
204204

205205
BaseSpec: test.BaseSpec{
206-
Name: "Blob Transaction Ordering, Single Account 2",
206+
Name: "Blob Transaction Ordering, Single Account, Dual Blob",
207207
About: `
208208
Send N blob transactions with cancun.MAX_BLOBS_PER_BLOCK-1 blobs each,
209209
using account A.
@@ -1085,7 +1085,7 @@ var Tests = []test.Spec{
10851085
&CancunBaseSpec{
10861086

10871087
BaseSpec: test.BaseSpec{
1088-
Name: "NewPayloadV3 Versioned Hashes, Missing Hash",
1088+
Name: "NewPayloadV3 Versioned Hashes, Missing Hash, Syncing=False",
10891089
About: `
10901090
Tests VersionedHashes in Engine API NewPayloadV3 where the array
10911091
is missing one of the hashes.
@@ -1117,7 +1117,7 @@ var Tests = []test.Spec{
11171117
&CancunBaseSpec{
11181118

11191119
BaseSpec: test.BaseSpec{
1120-
Name: "NewPayloadV3 Versioned Hashes, Extra Hash",
1120+
Name: "NewPayloadV3 Versioned Hashes, Extra Hash, Syncing=False",
11211121
About: `
11221122
Tests VersionedHashes in Engine API NewPayloadV3 where the array
11231123
is has an extra hash for a blob that is not in the payload.
@@ -1151,7 +1151,7 @@ var Tests = []test.Spec{
11511151

11521152
&CancunBaseSpec{
11531153
BaseSpec: test.BaseSpec{
1154-
Name: "NewPayloadV3 Versioned Hashes, Out of Order",
1154+
Name: "NewPayloadV3 Versioned Hashes, Out of Order, Syncing=False",
11551155
About: `
11561156
Tests VersionedHashes in Engine API NewPayloadV3 where the array
11571157
is out of order.
@@ -1183,7 +1183,7 @@ var Tests = []test.Spec{
11831183

11841184
&CancunBaseSpec{
11851185
BaseSpec: test.BaseSpec{
1186-
Name: "NewPayloadV3 Versioned Hashes, Repeated Hash",
1186+
Name: "NewPayloadV3 Versioned Hashes, Repeated Hash, Syncing=False",
11871187
About: `
11881188
Tests VersionedHashes in Engine API NewPayloadV3 where the array
11891189
has a blob that is repeated in the array.
@@ -1215,7 +1215,7 @@ var Tests = []test.Spec{
12151215

12161216
&CancunBaseSpec{
12171217
BaseSpec: test.BaseSpec{
1218-
Name: "NewPayloadV3 Versioned Hashes, Incorrect Hash",
1218+
Name: "NewPayloadV3 Versioned Hashes, Incorrect Hash, Syncing=False",
12191219
About: `
12201220
Tests VersionedHashes in Engine API NewPayloadV3 where the array
12211221
has a blob hash that does not belong to any blob contained in the payload.
@@ -1246,7 +1246,7 @@ var Tests = []test.Spec{
12461246
},
12471247
&CancunBaseSpec{
12481248
BaseSpec: test.BaseSpec{
1249-
Name: "NewPayloadV3 Versioned Hashes, Incorrect Version",
1249+
Name: "NewPayloadV3 Versioned Hashes, Incorrect Version, Syncing=False",
12501250
About: `
12511251
Tests VersionedHashes in Engine API NewPayloadV3 where the array
12521252
has a single blob that has an incorrect version.
@@ -1279,7 +1279,7 @@ var Tests = []test.Spec{
12791279

12801280
&CancunBaseSpec{
12811281
BaseSpec: test.BaseSpec{
1282-
Name: "NewPayloadV3 Versioned Hashes, Nil Hashes",
1282+
Name: "NewPayloadV3 Versioned Hashes, Nil Hashes, Syncing=False",
12831283
About: `
12841284
Tests VersionedHashes in Engine API NewPayloadV3 where the array
12851285
is nil, even though the fork has already happened.
@@ -1311,7 +1311,7 @@ var Tests = []test.Spec{
13111311

13121312
&CancunBaseSpec{
13131313
BaseSpec: test.BaseSpec{
1314-
Name: "NewPayloadV3 Versioned Hashes, Empty Hashes",
1314+
Name: "NewPayloadV3 Versioned Hashes, Empty Hashes, Syncing=False",
13151315
About: `
13161316
Tests VersionedHashes in Engine API NewPayloadV3 where the array
13171317
is empty, even though there are blobs in the payload.
@@ -1343,7 +1343,7 @@ var Tests = []test.Spec{
13431343

13441344
&CancunBaseSpec{
13451345
BaseSpec: test.BaseSpec{
1346-
Name: "NewPayloadV3 Versioned Hashes, Non-Empty Hashes",
1346+
Name: "NewPayloadV3 Versioned Hashes, Non-Empty Hashes, Syncing=False",
13471347
About: `
13481348
Tests VersionedHashes in Engine API NewPayloadV3 where the array
13491349
is contains hashes, even though there are no blobs in the payload.
@@ -1372,7 +1372,7 @@ var Tests = []test.Spec{
13721372
&CancunBaseSpec{
13731373

13741374
BaseSpec: test.BaseSpec{
1375-
Name: "NewPayloadV3 Versioned Hashes, Missing Hash (Syncing)",
1375+
Name: "NewPayloadV3 Versioned Hashes, Missing Hash, Syncing=True",
13761376
About: `
13771377
Tests VersionedHashes in Engine API NewPayloadV3 where the array
13781378
is missing one of the hashes.
@@ -1411,7 +1411,7 @@ var Tests = []test.Spec{
14111411
&CancunBaseSpec{
14121412

14131413
BaseSpec: test.BaseSpec{
1414-
Name: "NewPayloadV3 Versioned Hashes, Extra Hash (Syncing)",
1414+
Name: "NewPayloadV3 Versioned Hashes, Extra Hash, Syncing=True",
14151415
About: `
14161416
Tests VersionedHashes in Engine API NewPayloadV3 where the array
14171417
is has an extra hash for a blob that is not in the payload.
@@ -1452,7 +1452,7 @@ var Tests = []test.Spec{
14521452

14531453
&CancunBaseSpec{
14541454
BaseSpec: test.BaseSpec{
1455-
Name: "NewPayloadV3 Versioned Hashes, Out of Order (Syncing)",
1455+
Name: "NewPayloadV3 Versioned Hashes, Out of Order, Syncing=True",
14561456
About: `
14571457
Tests VersionedHashes in Engine API NewPayloadV3 where the array
14581458
is out of order.
@@ -1490,7 +1490,7 @@ var Tests = []test.Spec{
14901490

14911491
&CancunBaseSpec{
14921492
BaseSpec: test.BaseSpec{
1493-
Name: "NewPayloadV3 Versioned Hashes, Repeated Hash (Syncing)",
1493+
Name: "NewPayloadV3 Versioned Hashes, Repeated Hash, Syncing=True",
14941494
About: `
14951495
Tests VersionedHashes in Engine API NewPayloadV3 where the array
14961496
has a blob that is repeated in the array.
@@ -1529,7 +1529,7 @@ var Tests = []test.Spec{
15291529

15301530
&CancunBaseSpec{
15311531
BaseSpec: test.BaseSpec{
1532-
Name: "NewPayloadV3 Versioned Hashes, Incorrect Hash (Syncing)",
1532+
Name: "NewPayloadV3 Versioned Hashes, Incorrect Hash, Syncing=True",
15331533
About: `
15341534
Tests VersionedHashes in Engine API NewPayloadV3 where the array
15351535
has a blob that is repeated in the array.
@@ -1567,7 +1567,7 @@ var Tests = []test.Spec{
15671567
},
15681568
&CancunBaseSpec{
15691569
BaseSpec: test.BaseSpec{
1570-
Name: "NewPayloadV3 Versioned Hashes, Incorrect Version (Syncing)",
1570+
Name: "NewPayloadV3 Versioned Hashes, Incorrect Version, Syncing=True",
15711571
About: `
15721572
Tests VersionedHashes in Engine API NewPayloadV3 where the array
15731573
has a single blob that has an incorrect version.
@@ -1607,7 +1607,7 @@ var Tests = []test.Spec{
16071607

16081608
&CancunBaseSpec{
16091609
BaseSpec: test.BaseSpec{
1610-
Name: "NewPayloadV3 Versioned Hashes, Nil Hashes (Syncing)",
1610+
Name: "NewPayloadV3 Versioned Hashes, Nil Hashes, Syncing=True",
16111611
About: `
16121612
Tests VersionedHashes in Engine API NewPayloadV3 where the array
16131613
is nil, even though the fork has already happened.
@@ -1646,7 +1646,7 @@ var Tests = []test.Spec{
16461646

16471647
&CancunBaseSpec{
16481648
BaseSpec: test.BaseSpec{
1649-
Name: "NewPayloadV3 Versioned Hashes, Empty Hashes (Syncing)",
1649+
Name: "NewPayloadV3 Versioned Hashes, Empty Hashes, Syncing=True",
16501650
About: `
16511651
Tests VersionedHashes in Engine API NewPayloadV3 where the array
16521652
is empty, even though there are blobs in the payload.
@@ -1685,7 +1685,7 @@ var Tests = []test.Spec{
16851685

16861686
&CancunBaseSpec{
16871687
BaseSpec: test.BaseSpec{
1688-
Name: "NewPayloadV3 Versioned Hashes, Non-Empty Hashes (Syncing)",
1688+
Name: "NewPayloadV3 Versioned Hashes, Non-Empty Hashes, Syncing=True",
16891689
About: `
16901690
Tests VersionedHashes in Engine API NewPayloadV3 where the array
16911691
is contains hashes, even though there are no blobs in the payload.
@@ -1722,7 +1722,7 @@ var Tests = []test.Spec{
17221722
// and can be executed using `pyspec` simulator.
17231723
&CancunBaseSpec{
17241724
BaseSpec: test.BaseSpec{
1725-
Name: "Incorrect BlobGasUsed: Non-Zero on Zero Blobs",
1725+
Name: "Incorrect BlobGasUsed, Non-Zero on Zero Blobs",
17261726
About: `
17271727
Send a payload with zero blobs, but non-zero BlobGasUsed.
17281728
`,
@@ -1742,7 +1742,7 @@ var Tests = []test.Spec{
17421742
&CancunBaseSpec{
17431743

17441744
BaseSpec: test.BaseSpec{
1745-
Name: "Incorrect BlobGasUsed: GAS_PER_BLOB on Zero Blobs",
1745+
Name: "Incorrect BlobGasUsed, GAS_PER_BLOB on Zero Blobs",
17461746
About: `
17471747
Send a payload with zero blobs, but non-zero BlobGasUsed.
17481748
`,

simulators/ethereum/engine/suites/engine/bad_hash.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,11 @@ func (s ParentHashOnNewPayload) WithMainFork(fork config.Fork) test.Spec {
152152
}
153153

154154
func (p ParentHashOnNewPayload) GetName() string {
155-
name := "ParentHash==BlockHash on NewPayload"
155+
name := "ParentHash equals BlockHash on NewPayload,"
156156
if p.Syncing {
157-
name += " (Syncing)"
157+
name += " Syncing=True"
158+
} else {
159+
name += " Syncing=False"
158160
}
159161
return name
160162
}

simulators/ethereum/engine/suites/engine/fork_id.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package suite_engine
22

33
import (
44
"fmt"
5+
"strings"
56
"time"
67

78
"github.com/ethereum/hive/simulators/ethereum/engine/clmock"
@@ -22,14 +23,15 @@ func (s ForkIDSpec) WithMainFork(fork config.Fork) test.Spec {
2223
}
2324

2425
func (ft ForkIDSpec) GetName() string {
25-
name := fmt.Sprintf("Fork ID: Genesis at %d, %s at %d", ft.GetGenesisTimestamp(), ft.MainFork, ft.ForkTime)
26+
var name []string
27+
name = append(name, fmt.Sprintf("Fork ID: Genesis=%d, %s=%d", ft.GetGenesisTimestamp(), ft.MainFork, ft.ForkTime))
2628
if ft.PreviousForkTime != 0 {
27-
name += fmt.Sprintf(", %s at %d", ft.MainFork.PreviousFork(), ft.PreviousForkTime)
29+
name = append(name, fmt.Sprintf("%s=%d", ft.MainFork.PreviousFork(), ft.PreviousForkTime))
2830
}
2931
if ft.ProduceBlocksBeforePeering > 0 {
30-
name += fmt.Sprintf(", Produce %d blocks before peering", ft.ProduceBlocksBeforePeering)
32+
name = append(name, fmt.Sprintf("BlocksBeforePeering=%d", ft.ProduceBlocksBeforePeering))
3133
}
32-
return name
34+
return strings.Join(name, ", ")
3335
}
3436

3537
func (ft ForkIDSpec) Execute(t *test.Env) {

simulators/ethereum/engine/suites/engine/invalid_ancestor.go

+19-20
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"fmt"
77
"math/big"
8-
"strings"
98
"time"
109

1110
api "github.com/ethereum/go-ethereum/beacon/engine"
@@ -40,16 +39,16 @@ func (s InvalidMissingAncestorReOrgTest) WithMainFork(fork config.Fork) test.Spe
4039
}
4140

4241
func (tc InvalidMissingAncestorReOrgTest) GetName() string {
43-
name := []string{
44-
"Invalid Missing Ancestor ReOrg",
45-
fmt.Sprintf("Invalid %s", tc.InvalidField),
46-
}
42+
emptyTxsStatus := "False"
4743
if tc.EmptyTransactions {
48-
name = append(name, "Empty Txs")
44+
emptyTxsStatus = "True"
4945
}
50-
name = append(name, fmt.Sprintf("Invalid P%d'", tc.InvalidIndex))
51-
52-
return strings.Join(name, ", ")
46+
return fmt.Sprintf(
47+
"Invalid Missing Ancestor ReOrg, %s, EmptyTxs=%s, Invalid P%d",
48+
tc.InvalidField,
49+
emptyTxsStatus,
50+
tc.InvalidIndex,
51+
)
5352
}
5453

5554
func (tc InvalidMissingAncestorReOrgTest) Execute(t *test.Env) {
@@ -207,21 +206,21 @@ func (s InvalidMissingAncestorReOrgSyncTest) WithMainFork(fork config.Fork) test
207206
}
208207

209208
func (tc InvalidMissingAncestorReOrgSyncTest) GetName() string {
210-
name := []string{
211-
"Invalid Missing Ancestor ReOrg",
212-
fmt.Sprintf("Invalid %s", tc.InvalidField),
213-
}
209+
emptyTxsStatus := "False"
214210
if tc.EmptyTransactions {
215-
name = append(name, "Empty Txs")
211+
emptyTxsStatus = "True"
216212
}
217-
name = append(name,
218-
fmt.Sprintf("Invalid P%d'", tc.InvalidIndex),
219-
"Reveal using sync",
220-
)
213+
canonicalReOrgStatus := "False"
221214
if tc.ReOrgFromCanonical {
222-
name = append(name, "ReOrg from Canonical")
215+
canonicalReOrgStatus = "True"
223216
}
224-
return strings.Join(name, ", ")
217+
return fmt.Sprintf(
218+
"Invalid Missing Ancestor Syncing ReOrg, %s, EmptyTxs=%s, CanonicalReOrg=%s, Invalid P%d",
219+
tc.InvalidField,
220+
emptyTxsStatus,
221+
canonicalReOrgStatus,
222+
tc.InvalidIndex,
223+
)
225224
}
226225

227226
func (tc InvalidMissingAncestorReOrgSyncTest) Execute(t *test.Env) {

simulators/ethereum/engine/suites/engine/invalid_payload.go

+14-6
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,25 @@ func (s InvalidPayloadTestCase) WithMainFork(fork config.Fork) test.Spec {
4242
}
4343

4444
func (i InvalidPayloadTestCase) GetName() string {
45-
name := fmt.Sprintf("Invalid %s NewPayload", i.InvalidField)
45+
syncStatus := "False"
4646
if i.Syncing {
47-
name += " - Syncing"
47+
syncStatus = "True"
4848
}
49+
emptyTxsStatus := "False"
4950
if i.EmptyTransactions {
50-
name += " - Empty Transactions"
51+
emptyTxsStatus = "True"
5152
}
53+
dynFeeTxsStatus := "False"
5254
if i.BaseSpec.TestTransactionType == helper.DynamicFeeTxOnly {
53-
name += fmt.Sprintf(" - %s", i.BaseSpec.TestTransactionType)
55+
dynFeeTxsStatus = "True"
5456
}
55-
return name
57+
return fmt.Sprintf(
58+
"Invalid NewPayload, %s, Syncing=%s, EmptyTxs=%s, DynFeeTxs=%s",
59+
i.InvalidField,
60+
syncStatus,
61+
emptyTxsStatus,
62+
dynFeeTxsStatus,
63+
)
5664
}
5765

5866
func (tc InvalidPayloadTestCase) Execute(t *test.Env) {
@@ -400,7 +408,7 @@ func (s InvalidTxChainIDTest) WithMainFork(fork config.Fork) test.Spec {
400408
}
401409

402410
func (s InvalidTxChainIDTest) GetName() string {
403-
name := fmt.Sprintf("Build Payload with Invalid ChainID Transaction (%s)", s.TestTransactionType)
411+
name := fmt.Sprintf("Build Payload with Invalid ChainID Transaction, %s", s.TestTransactionType)
404412
return name
405413
}
406414

simulators/ethereum/engine/suites/engine/payload_attributes.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ func (s InvalidPayloadAttributesTest) WithMainFork(fork config.Fork) test.Spec {
2525
}
2626

2727
func (tc InvalidPayloadAttributesTest) GetName() string {
28-
name := fmt.Sprintf("Invalid PayloadAttributes: %s", tc.Description)
28+
name := fmt.Sprintf("Invalid PayloadAttributes, %s,", tc.Description)
2929
if tc.Syncing {
30-
name += " (Syncing)"
30+
name += " Syncing=True"
31+
} else {
32+
name += " Syncing=False"
3133
}
3234
return name
3335
}

simulators/ethereum/engine/suites/engine/payload_execution.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ func (s MultiplePayloadsExtendingCanonicalChainTest) WithMainFork(fork config.Fo
222222
}
223223

224224
func (s MultiplePayloadsExtendingCanonicalChainTest) GetName() string {
225-
name := "Multiple New Payloads Extending Canonical Chain"
225+
name := "Multiple New Payloads Extending Canonical Chain,"
226226
if s.SetHeadToFirstPayloadReceived {
227-
name += " (FcU to first payload received)"
227+
name += " Set Head to First Payload Received"
228+
} else {
229+
name += " Wait for Canonical Payload"
228230
}
229231
return name
230232
}

0 commit comments

Comments
 (0)