Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulators/ethereum/engine: Fix engine-cancun fcu version tests #902

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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