Skip to content

Commit

Permalink
simulators/ethereum/engine: Fix bugs within fcu version tests (Shangh…
Browse files Browse the repository at this point in the history
…ai/Cancun).
  • Loading branch information
spencer-tb committed Oct 24, 2023
1 parent e080138 commit 69b3764
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions simulators/ethereum/engine/suites/cancun/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@ var Tests = []test.Spec{
// ForkchoiceUpdatedV3 before cancun
&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV3 Set Head to Shanghai Payload, Nil Payload Attributes",
Name: "ForkchoiceUpdatedV3 Set Head to Shanghai Payload, Null Payload Attributes",
About: `
Test sending ForkchoiceUpdatedV3 to set the head of the chain to a Shanghai payload:
- Send NewPayloadV2 with Shanghai payload on block 1
- Use ForkchoiceUpdatedV3 to set the head to the payload, with nil payload attributes
- Use ForkchoiceUpdatedV3 to set the head to the payload, with null payload attributes
Verify that client returns no error.
Verify that client returns no error
`,
MainFork: config.Cancun,
ForkHeight: 2,
Expand All @@ -525,11 +525,11 @@ var Tests = []test.Spec{

&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV3 To Request Shanghai Payload, Nil Beacon Root",
Name: "ForkchoiceUpdatedV3 To Request Shanghai Payload, Null Beacon Root",
About: `
Test sending ForkchoiceUpdatedV3 to request a Shanghai payload:
- Payload Attributes uses Shanghai timestamp
- Payload Attributes' Beacon Root is nil
- Payload Attributes Beacon Root is null
Verify that client returns INVALID_PARAMS_ERROR.
`,
Expand All @@ -545,19 +545,19 @@ var Tests = []test.Spec{
},
},
ExpectationDescription: fmt.Sprintf(`
ForkchoiceUpdatedV3 before Cancun with any nil field must return INVALID_PARAMS_ERROR (code %d)
ForkchoiceUpdatedV3 before Cancun with any null field must return INVALID_PARAMS_ERROR (code %d)
`, *globals.INVALID_PARAMS_ERROR),
},
},
},

&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV3 To Request Shanghai Payload, Zero Beacon Root",
Name: "ForkchoiceUpdatedV3 To Request Shanghai Payload, Non-Null Beacon Root",
About: `
Test sending ForkchoiceUpdatedV3 to request a Shanghai payload:
- Payload Attributes uses Shanghai timestamp
- Payload Attributes' Beacon Root zero
- Payload Attributes Beacon Root is non-null
Verify that client returns UNSUPPORTED_FORK_ERROR.
`,
Expand All @@ -576,7 +576,7 @@ var Tests = []test.Spec{
},
},
ExpectationDescription: fmt.Sprintf(`
ForkchoiceUpdatedV3 before Cancun with beacon root must return UNSUPPORTED_FORK_ERROR (code %d)
ForkchoiceUpdatedV3 before Cancun with beacon root field present must return UNSUPPORTED_FORK_ERROR (code %d)
`, *globals.UNSUPPORTED_FORK_ERROR),
},
},
Expand All @@ -585,27 +585,25 @@ var Tests = []test.Spec{
// ForkchoiceUpdatedV2 before cancun with beacon root
&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV2 To Request Shanghai Payload, Zero Beacon Root",
Name: "ForkchoiceUpdatedV2 To Request Shanghai Payload, Non-Null Beacon Root ",
About: `
Test sending ForkchoiceUpdatedV2 to request a Cancun payload:
Test sending ForkchoiceUpdatedV2 to request a Shanghai payload:
- Payload Attributes uses Shanghai timestamp
- Payload Attributes' Beacon Root zero
- Payload Attributes Beacon Root is non-null
Verify that client returns INVALID_PARAMS_ERROR.
`,
MainFork: config.Cancun,
ForkHeight: 1,
ForkHeight: 2,
},

TestSequence: TestSequence{
NewPayloads{
FcUOnPayloadRequest: &helper.DowngradeForkchoiceUpdatedVersion{
ForkchoiceUpdatedCustomizer: &helper.BaseForkchoiceUpdatedCustomizer{
PayloadAttributesCustomizer: &helper.BasePayloadAttributesCustomizer{
BeaconRoot: &(common.Hash{}),
},
ExpectedError: globals.INVALID_PARAMS_ERROR,
FcUOnPayloadRequest: &helper.BaseForkchoiceUpdatedCustomizer{
PayloadAttributesCustomizer: &helper.BasePayloadAttributesCustomizer{
BeaconRoot: &(common.Hash{}),
},
ExpectedError: globals.INVALID_PARAMS_ERROR,
},
ExpectationDescription: fmt.Sprintf(`
ForkchoiceUpdatedV2 before Cancun with beacon root field must return INVALID_PARAMS_ERROR (code %d)
Expand All @@ -614,14 +612,14 @@ var Tests = []test.Spec{
},
},

// ForkchoiceUpdatedV2 after cancun
// ForkchoiceUpdatedV2 after cancun with beacon root
&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV2 To Request Cancun Payload, Zero Beacon Root",
Name: "ForkchoiceUpdatedV2 To Request Cancun Payload, Non-Null Beacon Root",
About: `
Test sending ForkchoiceUpdatedV2 to request a Cancun payload:
- Payload Attributes uses Cancun timestamp
- Payload Attributes' Beacon Root zero
- Payload Attributes Beacon Root is non-null
Verify that client returns INVALID_PARAMS_ERROR.
`,
Expand All @@ -633,6 +631,9 @@ var Tests = []test.Spec{
NewPayloads{
FcUOnPayloadRequest: &helper.DowngradeForkchoiceUpdatedVersion{
ForkchoiceUpdatedCustomizer: &helper.BaseForkchoiceUpdatedCustomizer{
PayloadAttributesCustomizer: &helper.BasePayloadAttributesCustomizer{
BeaconRoot: &(common.Hash{}),
},
ExpectedError: globals.INVALID_PARAMS_ERROR,
},
},
Expand All @@ -644,11 +645,11 @@ var Tests = []test.Spec{
},
&CancunBaseSpec{
BaseSpec: test.BaseSpec{
Name: "ForkchoiceUpdatedV2 To Request Cancun Payload, Nil Beacon Root",
Name: "ForkchoiceUpdatedV2 To Request Cancun Payload, Missing Beacon Root",
About: `
Test sending ForkchoiceUpdatedV2 to request a Cancun payload:
- Payload Attributes uses Cancun timestamp
- Payload Attributes' Beacon Root nil (not provided)
- Payload Attributes Beacon Root is missing
Verify that client returns UNSUPPORTED_FORK_ERROR.
`,
Expand Down

0 comments on commit 69b3764

Please sign in to comment.