diff --git a/src/testing/testing_buildBlockV1.yaml b/src/testing/testing_buildBlockV1.yaml index 5b60e0342..d40f989f9 100644 --- a/src/testing/testing_buildBlockV1.yaml +++ b/src/testing/testing_buildBlockV1.yaml @@ -23,7 +23,7 @@ - name: Payload attributes required: true schema: - title: PayloadAttributesV3 + title: PayloadAttributesV4 type: object properties: timestamp: @@ -39,6 +39,10 @@ $ref: '#/components/schemas/Withdrawal' parentBeaconBlockRoot: $ref: '#/components/schemas/hash32' + slotNumber: + $ref: '#/components/schemas/uint' + targetGasLimit: + $ref: '#/components/schemas/uint' - name: Transactions required: true description: | @@ -106,6 +110,8 @@ suggestedFeeRecipient: '0x0000000000000000000000000000000000000000' withdrawals: [] parentBeaconBlockRoot: '0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884365149a42212e8822' + slotNumber: '0x0' + targetGasLimit: '0x1c9c380' - name: Transactions value: [] - name: Extra data diff --git a/tools/testgen/generators.go b/tools/testgen/generators.go index 97230b54e..0b7077094 100644 --- a/tools/testgen/generators.go +++ b/tools/testgen/generators.go @@ -2732,6 +2732,11 @@ var TestingBuildBlockV1 = MethodTests{ payloadAttrs["parentBeaconBlockRoot"] = beaconRoot.Hex() } + if t.chain.Config().IsAmsterdam(parentBlock.Number(), parentBlock.Time()) { + payloadAttrs["slotNumber"] = hexutil.Uint64(0) + payloadAttrs["targetGasLimit"] = hexutil.Uint64(parentBlock.GasLimit()) + } + // Use sender index 2 so nonce matches geth state: index 0 (and 3) are used by // eth_sendRawTransaction tests which call IncNonce, so they diverge from geth when run in full suite. sender, nonce := t.chain.GetSender(2) @@ -2821,6 +2826,11 @@ var TestingBuildBlockV1 = MethodTests{ payloadAttrs["parentBeaconBlockRoot"] = beaconRoot.Hex() } + if t.chain.Config().IsAmsterdam(parentBlock.Number(), parentBlock.Time()) { + payloadAttrs["slotNumber"] = hexutil.Uint64(0) + payloadAttrs["targetGasLimit"] = hexutil.Uint64(parentBlock.GasLimit()) + } + extraData := hexutil.Encode([]byte{}) var result map[string]interface{} err := t.rpc.CallContext(ctx, &result, "testing_buildBlockV1", @@ -2875,6 +2885,11 @@ var TestingBuildBlockV1 = MethodTests{ payloadAttrs["parentBeaconBlockRoot"] = beaconRoot.Hex() } + if t.chain.Config().IsAmsterdam(parentBlock.Number(), parentBlock.Time()) { + payloadAttrs["slotNumber"] = hexutil.Uint64(0) + payloadAttrs["targetGasLimit"] = hexutil.Uint64(parentBlock.GasLimit()) + } + // Add a transaction to the mempool first sender, nonce := t.chain.GetSender(1) basefee := parentBlock.BaseFee() @@ -2957,6 +2972,11 @@ var TestingBuildBlockV1 = MethodTests{ payloadAttrs["parentBeaconBlockRoot"] = beaconRoot.Hex() } + if t.chain.Config().IsAmsterdam(parentBlock.Number(), parentBlock.Time()) { + payloadAttrs["slotNumber"] = hexutil.Uint64(0) + payloadAttrs["targetGasLimit"] = hexutil.Uint64(parentBlock.GasLimit()) + } + // Use an invalid nonce (e.g. 999) so the tx cannot be applied; client MUST fail. sender, _ := t.chain.GetSender(2) basefee := parentBlock.BaseFee()