Skip to content

Add examples for engine methods #465

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

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion spellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ matrix:
wordlists:
- wordlist.txt
encoding: utf-8
pipeline: null
pipeline:
- pyspelling.filters.context:
context_visible_first: true
delimiters:
- open: ''
content: 0x[a-fA-F0-9]+
close: ''
24 changes: 24 additions & 0 deletions src/engine/openrpc/methods/capabilities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,27 @@
type: array
items:
type: string
examples:
- name: engine_exchangeCapabilities example
params:
- name: Consensus client methods
value:
- 'engine_exchangeTransitionConfigurationV1'
- 'engine_forkchoiceUpdatedV1'
- 'engine_getPayloadBodiesByHashV1'
- 'engine_getPayloadBodiesByRangeV1'
- 'engine_getPayloadV1'
- 'engine_newPayloadV1'
result:
name: Execution client methods
value:
- 'engine_getPayloadV1'
- 'engine_getPayloadV2'
- 'engine_executePayloadV1'
- 'engine_newPayloadV1'
- 'engine_newPayloadV2'
- 'engine_forkchoiceUpdatedV1'
- 'engine_forkchoiceUpdatedV2'
- 'engine_exchangeTransitionConfigurationV1'
- 'engine_getPayloadBodiesByHashV1'
- 'engine_getPayloadBodiesByRangeV1'
82 changes: 82 additions & 0 deletions src/engine/openrpc/methods/forkchoice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
message: Invalid forkchoice state
- code: -38003
message: Invalid payload attributes
examples:
- name: engine_forkchoiceUpdatedV1 example
params:
- name: Forkchoice state
value:
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
- name: Payload attributes
value:
timestamp: '0x5'
prevRandao: '0x0000000000000000000000000000000000000000000000000000000000000000'
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
result:
name: Response object
value:
payloadStatus:
status: VALID
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
validationError: null
payloadId: '0x0000000021f32cc1'
- name: engine_forkchoiceUpdatedV2
summary: Updates the forkchoice state
externalDocs:
Expand All @@ -44,6 +65,36 @@
message: Invalid forkchoice state
- code: -38003
message: Invalid payload attributes
examples:
- name: engine_forkchoiceUpdatedV2 example
params:
- name: Forkchoice state
value:
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
- name: Payload attributes
value:
timestamp: '0x64e7785b'
prevRandao: '0xc130d5e63c61c935f6089e61140ca9136172677cf6aa5800dcc1cf0a02152a14'
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
withdrawals:
- index: '0xf0'
validatorIndex: '0xf0'
address: '0x00000000000000000000000000000000000010f0'
amount: '0x1'
- index: '0xf1'
validatorIndex: '0xf1'
address: '0x00000000000000000000000000000000000010f1'
amount: '0x1'
result:
name: Response object
value:
payloadStatus:
status: VALID
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
validationError: null
payloadId: '0x0000000021f32cc1'
- name: engine_forkchoiceUpdatedV3
summary: Updates the forkchoice state
externalDocs:
Expand Down Expand Up @@ -71,3 +122,34 @@
message: Invalid params
- code: -38005
message: Unsupported fork
examples:
- name: engine_forkchoiceUpdatedV3 example
params:
- name: Forkchoice state
value:
headBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
safeBlockHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
finalizedBlockHash: '0x3b8fb240d288781d4aac94d3fd16809ee413bc99294a085798a589dae51ddd4a'
- name: Payload attributes
value:
timestamp: '0x64e7785b'
prevRandao: '0xc130d5e63c61c935f6089e61140ca9136172677cf6aa5800dcc1cf0a02152a14'
suggestedFeeRecipient: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b'
withdrawals:
- index: '0xf0'
validatorIndex: '0xf0'
address: '0x00000000000000000000000000000000000010f0'
amount: '0x1'
- index: '0xf1'
validatorIndex: '0xf1'
address: '0x00000000000000000000000000000000000010f1'
amount: '0x1'
parentBeaconBlockRoot: '0x11f780a954bcba8889998e4e61deaae6388dd2391e9c810bd9c94962cc1eadc1'
result:
name: Response object
value:
payloadStatus:
status: VALID
latestValidHash: '0x3559e851470f6e7bbed1db474980683e8c315bfce99b2a6ef47c057c04de7858'
validationError: null
payloadId: '0x0000000021f32cc1'
Loading