Skip to content

Commit

Permalink
simulators/ethereum/engine: Add payload id check on beacon root change
Browse files Browse the repository at this point in the history
  • Loading branch information
marioevz committed Aug 18, 2023
1 parent c4799b5 commit b37bbd8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions simulators/ethereum/engine/suites/cancun/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ func (step NewPayloads) Execute(t *CancunTestContext) error {
r.ExpectNoError()
r.ExpectPayloadStatus(expectedStatus)
}
if r.Response.PayloadID != nil {
t.CLMock.AddPayloadID(r.Response.PayloadID)
}
}
},
OnRequestNextPayload: func() {
Expand Down
43 changes: 43 additions & 0 deletions simulators/ethereum/engine/suites/cancun/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,49 @@ var Tests = []test.SpecInterface{
},
},

// ForkchoiceUpdatedV3 with modified BeaconRoot Attribute
&CancunBaseSpec{
Spec: test.Spec{
Name: "ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root",
About: `
Test requesting a Cancun Payload using ForkchoiceUpdatedV3 twice with the beacon root
payload attribute as the only change between requests and verify that the payload ID is
different.
`,
},

CancunForkHeight: 1,

TestSequence: TestSequence{
SendBlobTransactions{
TransactionCount: 1,
BlobsPerTransaction: MAX_BLOBS_PER_BLOCK,
BlobTransactionMaxBlobGasCost: big.NewInt(100),
},
NewPayloads{
ExpectedIncludedBlobCount: MAX_BLOBS_PER_BLOCK,
FcUOnPayloadRequest: &helper.BaseForkchoiceUpdatedCustomizer{
PayloadAttributesCustomizer: &helper.BasePayloadAttributesCustomizer{
BeaconRoot: &(common.Hash{}),
},
},
},
SendBlobTransactions{
TransactionCount: 1,
BlobsPerTransaction: MAX_BLOBS_PER_BLOCK,
BlobTransactionMaxBlobGasCost: big.NewInt(100),
},
NewPayloads{
ExpectedIncludedBlobCount: MAX_BLOBS_PER_BLOCK,
FcUOnPayloadRequest: &helper.BaseForkchoiceUpdatedCustomizer{
PayloadAttributesCustomizer: &helper.BasePayloadAttributesCustomizer{
BeaconRoot: &(common.Hash{1}),
},
},
},
},
},

// GetPayloadV3 Before Cancun, Negative Tests
&CancunBaseSpec{
Spec: test.Spec{
Expand Down

0 comments on commit b37bbd8

Please sign in to comment.