Skip to main content

testing_buildBlockV1

This method is a debugging and testing tool that simplifies the block production process into a single call.

**Specification:** - The client MUST build a new execution payload using the block specified by `parentBlockHash` as its parent. - The client MUST use the provided `payloadAttributes` to define the context of the new block. - If the `transactions` parameter is an empty array `[]`, the client MUST build an empty block (no transactions). - If the `transactions` parameter is JSON `null`, the client MAY build a block from its local transaction pool (mempool). - If the `transactions` parameter is a non-empty array, the client MUST include all transactions from the array on the block's transaction list, in the order they were provided, and MUST NOT include any transactions from its local transaction pool. - If `extraData` is provided, the client MUST set the `extraData` field of the resulting payload to this value. - This method MUST NOT modify the client's canonical chain or head block. It is a read-only method for payload generation.

**Security Considerations:** - This method is intended for testing environments ONLY and MUST NOT be exposed on public-facing RPC APIs. - It is strongly recommended that this method be disabled by default.

Builds a block on top of a given parentHash using the provided parameters. This is a testing-only method for generating test fixtures.

Parameters (by position)

Parent block hash string required


Payload attributes object required

PayloadAttributesV3


Show Payload attributes object

Payload attributes fields

  • parentBeaconBlockRoot string

    32 byte hex value

    Match pattern: ^0x[0-9a-f]{64}$


  • prevRandao string

    32 byte hex value

    Match pattern: ^0x[0-9a-f]{64}$


  • suggestedFeeRecipient string

    hex encoded address

    Match pattern: ^0x[0-9a-fA-F]{40}$


  • timestamp string

    hex encoded unsigned integer

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • withdrawals array<object>

    Validator withdrawal


    Show withdrawals object

    withdrawals fields

    • address string required

      recipient address for withdrawal value

      Match pattern: ^0x[0-9a-fA-F]{40}$


    • amount string required

      value contained in withdrawal

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,63})$


    • index string required

      index of withdrawal

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • validatorIndex string required

      index of validator that generated withdrawal

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • additionalProperties false


  • additionalProperties true


Transactions array<string> or null required

An array of raw, signed transactions (hex-encoded) to include in the generated block, or null.

  • If an empty array []: The client MUST build an empty block (no transactions).
  • If null: The client MAY build a block from its local transaction pool (mempool).
  • If a non-empty array: The client MUST include ALL transactions from this array in the resulting block, in the order provided, and MUST NOT include any transactions from its local mempool.

Show Option 1 Transactions array

Transactions fields

An array of raw, signed transactions (hex-encoded) to include in the generated block, or null.

  • If an empty array []: The client MUST build an empty block (no transactions).
  • If null: The client MAY build a block from its local transaction pool (mempool).
  • If a non-empty array: The client MUST include ALL transactions from this array in the resulting block, in the order provided, and MUST NOT include any transactions from its local mempool.

Transactions array<string> required

An array of raw, signed transactions (hex-encoded) to include in the generated block, or null.

  • If an empty array []: The client MUST build an empty block (no transactions).
  • If null: The client MAY build a block from its local transaction pool (mempool).
  • If a non-empty array: The client MUST include ALL transactions from this array in the resulting block, in the order provided, and MUST NOT include any transactions from its local mempool.

Match pattern: ^0x[0-9a-f]*$


Show Option 2 Transactions null

Transactions fields

An array of raw, signed transactions (hex-encoded) to include in the generated block, or null.

  • If an empty array []: The client MUST build an empty block (no transactions).
  • If null: The client MAY build a block from its local transaction pool (mempool).
  • If a non-empty array: The client MUST include ALL transactions from this array in the resulting block, in the order provided, and MUST NOT include any transactions from its local mempool.

Transactions null required

An array of raw, signed transactions (hex-encoded) to include in the generated block, or null.

  • If an empty array []: The client MUST build an empty block (no transactions).
  • If null: The client MAY build a block from its local transaction pool (mempool).
  • If a non-empty array: The client MUST include ALL transactions from this array in the resulting block, in the order provided, and MUST NOT include any transactions from its local mempool.

Extra data string or null

Data to be set as the extraData field of the built block. If provided, the client MUST use this exact value.


Show Option 1 hex encoded bytes string

hex encoded bytes fields

Data to be set as the extraData field of the built block. If provided, the client MUST use this exact value.

Extra data string

Data to be set as the extraData field of the built block. If provided, the client MUST use this exact value.

Match pattern: ^0x[0-9a-f]*$


Show Option 2 Extra data null

Extra data fields

Data to be set as the extraData field of the built block. If provided, the client MUST use this exact value.

Extra data null

Data to be set as the extraData field of the built block. If provided, the client MUST use this exact value.


Result

Response object object

Response object


Show Response object object

Response object fields

  • blobsBundle object required

    Blobs bundle


    Show blobsBundle object

    blobsBundle fields

    • blobs array<string> required

      hex encoded bytes

      Match pattern: ^0x[0-9a-f]*$


    • commitments array<string> required

      48 hex encoded bytes

      Match pattern: ^0x[0-9a-f]{96}$


    • proofs array<string> required

      48 hex encoded bytes

      Match pattern: ^0x[0-9a-f]{96}$


    • additionalProperties true


  • blockValue string required

    Expected block value

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,63})$


  • executionPayload object required

    Execution payload


    Show executionPayload object

    executionPayload fields

    • baseFeePerGas string required

      Base fee per gas

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,63})$


    • blobGasUsed string required

      Blob gas used

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • blockHash string required

      Block hash

      Match pattern: ^0x[0-9a-f]{64}$


    • blockNumber string required

      Block number

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • excessBlobGas string required

      Excess blob gas

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • extraData string required

      Extra data

      Match pattern: ^0x[0-9a-f]{0,64}$


    • feeRecipient string required

      Recipient of transaction priority fees

      Match pattern: ^0x[0-9a-fA-F]{40}$


    • gasLimit string required

      Gas limit

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • gasUsed string required

      Gas used

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • logsBloom string required

      Bloom filter

      Match pattern: ^0x[0-9a-f]{512}$


    • parentHash string required

      Parent block hash

      Match pattern: ^0x[0-9a-f]{64}$


    • prevRandao string required

      Previous randao value

      Match pattern: ^0x[0-9a-f]{64}$


    • receiptsRoot string required

      Receipts root

      Match pattern: ^0x[0-9a-f]{64}$


    • stateRoot string required

      State root

      Match pattern: ^0x[0-9a-f]{64}$


    • timestamp string required

      Timestamp

      Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


    • transactions array<string> required

      hex encoded bytes

      Match pattern: ^0x[0-9a-f]*$


    • withdrawals array<object> required

      Withdrawal object V1


      Show withdrawals object

      withdrawals fields

      • address string required

        Withdrawal address

        Match pattern: ^0x[0-9a-fA-F]{40}$


      • amount string required

        Withdrawal amount

        Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


      • index string required

        Withdrawal index

        Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


      • validatorIndex string required

        Validator index

        Match pattern: ^0x(0|[1-9a-f][0-9a-f]{0,15})$


      • additionalProperties true


    • additionalProperties true


  • executionRequests array<string>

    hex encoded bytes

    Match pattern: ^0x[0-9a-f]*$


  • shouldOverrideBuilder boolean required

    Should override builder flag


  • additionalProperties true


Errors

Error code: -32602

  • code

    -32602

  • message

    Invalid parameters

Error code: -32603

  • code

    -32603

  • message

    Internal error

Examples

testing_buildBlockV1 example

Request

{
"params": [
"0xe27a3e81bd7cfe2aec2cc9e832c73a17c93e7efcf659cf4b39883b96c48708c2",
{
"parentBeaconBlockRoot": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884365149a42212e8822",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"suggestedFeeRecipient": "0x0000000000000000000000000000000000000000",
"timestamp": "0x1ce",
"withdrawals": []
},
[],
null
]
}

Response

{
"blobsBundle": {
"blobs": [],
"commitments": [],
"proofs": []
},
"blockValue": "0x0",
"executionPayload": {
"baseFeePerGas": "0x7",
"blobGasUsed": "0x0",
"blockHash": "0x1234567890123456789012345678901234567890123456789012345678901234",
"blockNumber": "0x1",
"excessBlobGas": "0x0",
"extraData": "0x",
"feeRecipient": "0x0000000000000000000000000000000000000000",
"gasLimit": "0x1c9c380",
"gasUsed": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"parentHash": "0xe27a3e81bd7cfe2aec2cc9e832c73a17c93e7efcf659cf4b39883b96c48708c2",
"prevRandao": "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot": "0xca3149fa9e37db08d1cd49c9061db1002ef1cd58db2210f2115c8c989b2bdf45",
"timestamp": "0x1ce",
"transactions": [],
"withdrawals": []
},
"shouldOverrideBuilder": false
}