Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend fork_choice test format with on_payload_info #2965

Merged
merged 3 commits into from
Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion tests/formats/fork_choice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".
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

The checks to verify the current status of `store`.
Expand Down