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

add Electra attester slashing schema #8478

Merged

Conversation

mehdi-aouadi
Copy link
Contributor

@mehdi-aouadi mehdi-aouadi commented Jul 26, 2024

PR Description

Separate the AttesterSlashing and IndexedAttestation schemas based on the milestone: Phase0 and Electra

Fixed Issue(s)

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Copy link
Contributor

@gfukushima gfukushima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this solve an issue that I had postponed for a little later. And it does with a lot more simplicity than my approach was going for. Although this is not a very extensible approach (for future forks) I don't think we going changing this attestation related classes so soon...

@mehdi-aouadi mehdi-aouadi self-assigned this Jul 29, 2024
@mehdi-aouadi mehdi-aouadi force-pushed the 8122-update-open-api-definition branch from 548ab74 to 9017a57 Compare July 29, 2024 16:01
@mehdi-aouadi mehdi-aouadi marked this pull request as ready for review July 29, 2024 16:26
@mehdi-aouadi mehdi-aouadi requested a review from gfukushima July 29, 2024 16:26
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request introduces schema separation for AttesterSlashing and IndexedAttestation based on the Ethereum 2.0 milestones Phase0 and Electra.

  • Schema Updates:

    • Added AttesterSlashingElectra.json and AttesterSlashingPhase0.json in data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/.
    • Removed AttesterSlashing.json to avoid redundancy.
  • File Modifications:

    • Updated multiple BeaconBlockBody JSON files to reference AttesterSlashingPhase0 or AttesterSlashingElectra schemas.
    • Modified JsonTypeDefinitionBeaconRestApi.java to use schemaCache for schema definitions.
  • Handler Changes:

    • Updated GetAttesterSlashings.java and PostAttesterSlashing.java to use SchemaDefinitionCache.
  • Test Adjustments:

    • Updated test files to align with the new schema separation, ensuring accurate validation and comparison.
  • Java Class Modifications:

    • Introduced isElectra parameter in AttesterSlashing.java and IndexedAttestation.java to dynamically set schema names based on the milestone.

30 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do see this as a step down the road, but definitely in the right direction i think...
LGTM overall.

@mehdi-aouadi mehdi-aouadi force-pushed the 8122-update-open-api-definition branch from 5d86270 to ebf58f4 Compare July 30, 2024 11:50
@mehdi-aouadi mehdi-aouadi enabled auto-merge (squash) July 30, 2024 12:10
@mehdi-aouadi mehdi-aouadi merged commit b79c3bb into Consensys:master Jul 30, 2024
15 of 16 checks passed
@mehdi-aouadi mehdi-aouadi deleted the 8122-update-open-api-definition branch July 30, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants