Merge pull request #2965 from mkalinin/optimistic-sync-tests

Extend fork_choice test format with on_payload_info
This commit is contained in:
Hsiao-Wei Wang 2022-09-12 17:53:08 +08:00 committed by GitHub
commit 97c61fed2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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. 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)`. Adds `PowBlock` data which is required for executing `on_block(store, block)`.
```yaml ```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. 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".
latest_valid_hash: string, -- Encoded 32-byte value of the latest valid block hash, may be `null`.
validation_error: 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 #### Checks step
The checks to verify the current status of `store`. The checks to verify the current status of `store`.