-
Notifications
You must be signed in to change notification settings - Fork 189
Update attestation APIs to support EIP-7549 #448
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
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ce9248f
update attestation APIs to support EIP-7549
mehdi-aouadi f65f537
fix attestations array shcema
mehdi-aouadi e48a7e7
fix one of array item schemas
mehdi-aouadi 24e9251
use anyOf instead of oneOf
mehdi-aouadi fd69e15
bump attestations apis to v2
mehdi-aouadi 997e21b
add change log entries
mehdi-aouadi 1245eb6
refactoring
mehdi-aouadi f2aeebf
add consensus version header to POST apis parameters
mehdi-aouadi e815e4f
update spec version
mehdi-aouadi ea9832e
fix typos
mehdi-aouadi 3261557
rebase master
mehdi-aouadi 757e314
update indexed attestation spec link
mehdi-aouadi ed03dfd
update changes log
mehdi-aouadi 79c54ae
add new line
mehdi-aouadi 6bc0ec8
Review PR
nflaig adbcc6f
Merge branch 'master' into eip-7549
nflaig bb0b6ae
fixing reviews
mehdi-aouadi b68317e
Fix Attestation field order
nflaig 9defc48
Correct committee_bits example
nflaig f45461c
Fix required properties ordering
nflaig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
get: | ||
operationId: getBlockAttestationsV2 | ||
summary: Get block attestations | ||
description: Retrieves attestation included in requested block. | ||
tags: | ||
- Beacon | ||
parameters: | ||
- name: block_id | ||
in: path | ||
required: true | ||
$ref: '../../../beacon-node-oapi.yaml#/components/parameters/BlockId' | ||
responses: | ||
"200": | ||
description: Success | ||
headers: | ||
Eth-Consensus-Version: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' | ||
content: | ||
application/json: | ||
schema: | ||
title: GetBlockAttestationsV2Response | ||
type: object | ||
required: [version, execution_optimistic, finalized, data] | ||
properties: | ||
version: | ||
type: string | ||
enum: [phase0, altair, bellatrix, capella, deneb, electra] | ||
example: "phase0" | ||
execution_optimistic: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ExecutionOptimistic" | ||
finalized: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/Finalized" | ||
data: | ||
anyOf: | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' | ||
"400": | ||
description: "The block ID supplied could not be parsed" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 400 | ||
message: "Invalid block ID: current" | ||
"404": | ||
description: "Block not found" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 404 | ||
message: "Block not found" | ||
"500": | ||
$ref: "../../../beacon-node-oapi.yaml#/components/responses/InternalError" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
get: | ||
operationId: getPoolAttestationsV2 | ||
summary: Get attestations from operations pool | ||
description: Retrieves attestations known by the node but not necessarily incorporated into any block | ||
parameters: | ||
- name: slot | ||
in: query | ||
required: false | ||
schema: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64' | ||
- name: committee_index | ||
in: query | ||
required: false | ||
schema: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Uint64' | ||
tags: | ||
- Beacon | ||
responses: | ||
"200": | ||
description: Successful response | ||
headers: | ||
Eth-Consensus-Version: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' | ||
content: | ||
application/json: | ||
schema: | ||
title: GetPoolAttestationsV2Response | ||
type: object | ||
required: [version, data] | ||
properties: | ||
version: | ||
type: string | ||
enum: [phase0, altair, bellatrix, capella, deneb, electra] | ||
example: "phase0" | ||
data: | ||
anyOf: | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' | ||
"400": | ||
description: "The slot or committee index could not be parsed" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 400 | ||
message: "Invalid slot: current" | ||
"500": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' | ||
|
||
post: | ||
operationId: submitPoolAttestationsV2 | ||
summary: Submit Attestation objects to node | ||
description: | | ||
Submits Attestation objects to the node. Each attestation in the request body is processed individually. | ||
|
||
If an attestation is validated successfully, the node MUST publish that attestation on the appropriate subnet. | ||
|
||
If one or more attestations fail validation, the node MUST return a 400 error with details of which attestations have failed, and why. | ||
parameters: | ||
- in: header | ||
schema: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' | ||
required: true | ||
name: Eth-Consensus-Version | ||
description: "Version of the attestations being submitted." | ||
tags: | ||
- Beacon | ||
- ValidatorRequiredApi | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
anyOf: | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Attestation' | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.Attestation' | ||
responses: | ||
"200": | ||
description: Attestations are stored in pool and broadcast on the appropriate subnet | ||
"400": | ||
description: "Errors with one or more attestations" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/IndexedErrorMessage" | ||
"500": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
get: | ||
operationId: getPoolAttesterSlashingsV2 | ||
summary: Get attester slashings from operations pool | ||
description: Retrieves attester slashings known by the node but not necessarily incorporated into any block | ||
tags: | ||
- Beacon | ||
responses: | ||
"200": | ||
description: Successful response | ||
headers: | ||
Eth-Consensus-Version: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/headers/Eth-Consensus-Version' | ||
content: | ||
application/json: | ||
schema: | ||
title: GetPoolAttesterSlashingsV2Response | ||
type: object | ||
required: [version, data] | ||
properties: | ||
version: | ||
type: string | ||
enum: [ phase0, altair, bellatrix, capella, deneb, electra ] | ||
example: "phase0" | ||
data: | ||
anyOf: | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' | ||
- type: array | ||
items: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' | ||
"500": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' | ||
|
||
post: | ||
operationId: submitPoolAttesterSlashingsV2 | ||
summary: Submit AttesterSlashing object to node's pool | ||
description: Submits AttesterSlashing object to node's pool. Upon successful validation the node MUST broadcast it to network. | ||
parameters: | ||
- in: header | ||
schema: | ||
$ref: '../../../beacon-node-oapi.yaml#/components/schemas/ConsensusVersion' | ||
required: true | ||
name: Eth-Consensus-Version | ||
description: "Version of the attester slashing being submitted." | ||
tags: | ||
- Beacon | ||
requestBody: | ||
nflaig marked this conversation as resolved.
Show resolved
Hide resolved
|
||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
anyOf: | ||
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/AttesterSlashing' | ||
- $ref: '../../../beacon-node-oapi.yaml#/components/schemas/Electra.AttesterSlashing' | ||
responses: | ||
"200": | ||
description: Success | ||
"400": | ||
description: "Invalid attester slashing" | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../../../beacon-node-oapi.yaml#/components/schemas/ErrorMessage" | ||
example: | ||
code: 400 | ||
message: "Invalid attester slashing, it will never pass validation so it's rejected" | ||
"500": | ||
$ref: '../../../beacon-node-oapi.yaml#/components/responses/InternalError' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.