Extend fork_choice test format with on_payload_info

This commit is contained in:
Mikhail Kalinin 2022-08-03 18:19:39 +06:00
parent fb71509052
commit 14d4f44c11
1 changed files with 25 additions and 1 deletions

View File

@ -69,7 +69,7 @@ The file is located in the same folder (see below).
After this step, the `store` object may have been updated.
#### `on_merge_block` execution
#### `on_merge_block` execution step
Adds `PowBlock` data which is required for executing `on_block(store, block)`.
```yaml
@ -97,6 +97,30 @@ The file is located in the same folder (see below).
After this step, the `store` object may have been updated.
#### `on_payload_info` execution step
Optional step for optimistic sync tests.
```yaml
{
block_hash: string, -- Encoded 32-byte value of payload's block hash.
payload_status: {
status: string, -- Enum, "VALID" | "INVALID" | "SYNCING" | "ACCEPTED" | "INVALID_BLOCK_HASH".
latestValidHash: string, -- Encoded 32-byte value of the latest valid block hash, may be `null`.
validationError: string, -- Message providing additional details on the validation error, may be `null`.
}
}
```
This step sets the [`payloadStatus`](https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#PayloadStatusV1)
value that Execution Layer client mock returns in responses to the following Engine API calls:
* [`engine_newPayloadV1(payload)`](https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#engine_newpayloadv1) if `payload.blockHash == payload_info.block_hash`
* [`engine_forkchoiceUpdatedV1(forkchoiceState, ...)`](https://github.com/ethereum/execution-apis/blob/main/src/engine/specification.md#engine_forkchoiceupdatedv1) if `forkchoiceState.headBlockHash == payload_info.block_hash`
*Note:* Status of a payload must be *initialized* via `on_payload_info` before the corresponding `on_block` execution step.
*Note:* Status of the same payload may be updated for several times throughout the test.
#### Checks step
The checks to verify the current status of `store`.