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

Include meta data in BlockSelector result #5067

Merged
merged 3 commits into from
Mar 1, 2022

Conversation

ajsutton
Copy link
Contributor

PR Description

Update BlockSelector to return the requests block/blocks along with the metadata for those blocks (currently milestone and if optimistic sync affects the result).

While currently the metadata is immediately discarded, this will allow us to gradually migrate the REST APIs that return block data to use the attached metadata instead of recalculating it in a way that may be inconsistent because of concurrent changes to the optimistic sync state or chain head.

Fixed Issue(s)

#4968

Documentation

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

Changelog

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

@ajsutton ajsutton marked this pull request as ready for review March 1, 2022 00:05
import java.util.Objects;
import tech.pegasys.teku.spec.SpecMilestone;

public class ObjectAndMetaData<T> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This class is more generic than we need right now but the next step is to add beacon state with metadata and we don't want to have two separate definitions of the metadata so introducing a class that can be shared now. Little bit of a YAGNI violation but I'm feeling lucky. :)

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.

LGTM

@ajsutton ajsutton enabled auto-merge (squash) March 1, 2022 04:57
@ajsutton ajsutton merged commit af4ab06 into Consensys:master Mar 1, 2022
@ajsutton ajsutton deleted the block-selector-metadata branch March 1, 2022 06:04
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.

2 participants