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

Make execution_optimistic required field in GetProposerDuties #7054

Conversation

StefanBratanov
Copy link
Contributor

@StefanBratanov StefanBratanov commented Apr 18, 2023

PR Description

  • Make execution_optimistic a required field so it is included even when the value is false (consistent with sync and attester duties)
  • Change order in the sync and attester duties endpoints to be consistent with the spec
  • Removed finalized field from PostAttesterDuties since it was not in the spec

Fixed Issue(s)

fixes #7053

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.

@mehdi-aouadi
Copy link
Contributor

Since it's not a spec requirement and we want it to be included anyway maybe we could add a test then

@StefanBratanov
Copy link
Contributor Author

Since it's not a spec requirement and we want it to be included anyway maybe we could add a test then

There are already tests. I just changed the expected json.

@StefanBratanov StefanBratanov force-pushed the execution_optimistic_get_proposer_duties branch from 8b7dda3 to 33bf9f3 Compare April 19, 2023 08:49
@zilm13
Copy link
Contributor

zilm13 commented Apr 19, 2023

At first I don't see finalized in duties spec, am I missing something in spec?
https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/duties/attester.yaml#L42-L58
Everything else looks good

@StefanBratanov
Copy link
Contributor Author

At first I don't see finalized in duties spec, am I missing something in spec? https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/duties/attester.yaml#L42-L58 Everything else looks good

Good point. Seems to be part of this PR ethereum/beacon-APIs#254 but it is not added to the attester duties response and I don't think it is relevant to it as well. So removed it. @rolfyone any thoughts on this?

Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

LGTM

@StefanBratanov StefanBratanov merged commit ff126f8 into Consensys:master Apr 19, 2023
@StefanBratanov StefanBratanov deleted the execution_optimistic_get_proposer_duties branch April 19, 2023 14:47
@rolfyone
Copy link
Contributor

Sorry,
The main issue here is its effectively a breaking change, because initially the api had it not required... so if we ever do call a server that doesn't return it we'd break...

my preference would have been we kept the optional and defaulted the second part to false so that we always had a value, but the structure sees it as optional still...

@StefanBratanov
Copy link
Contributor Author

StefanBratanov commented Apr 19, 2023

Sorry, The main issue here is its effectively a breaking change, because initially the api had it not required... so if we ever do call a server that doesn't return it we'd break...

my preference would have been we kept the optional and defaulted the second part to false so that we always had a value, but the structure sees it as optional still...

Hmm not sure, we are only modifying the json type definition of the API response. The VC which can call different servers uses a jackson class to deserialise and that can still parse without that field exisiting. I think main ambition was to make it consistent with the sync duties and attester duties response which had the field as required.

@rolfyone
Copy link
Contributor

if this is server side purely, we're probably ok. it's fine to send all the time, just if we're using this object to receive a response it needs to be optional... hope that clarifies...

@StefanBratanov
Copy link
Contributor Author

Yeah, we use this class for deserialisation https://github.com/ConsenSys/teku/blob/master/data/serializer/src/main/java/tech/pegasys/teku/api/response/v1/validator/GetProposerDutiesResponse.java

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.

Make execution_optimistic required field in GetProposerDuties
4 participants