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 Metadata V2 Object and Interface #8962

Merged
merged 11 commits into from
Jun 2, 2021
Merged

Add Metadata V2 Object and Interface #8962

merged 11 commits into from
Jun 2, 2021

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Jun 1, 2021

What type of PR is this?

In Preparation for Altair Hardfork

What does this PR do? Why is it needed?

  • Changes to a metadata interface to account for the multiple metadata types.
  • Adds in a new metadata v1 type in preparation for Altair.
  • Rename Metadata types for proper versioning.
  • Fix references across the repo.

Which issues(s) does this PR fix?

Part of #8638

Other notes for review

@nisdas nisdas requested a review from a team as a code owner June 1, 2021 12:13
@nisdas nisdas requested review from kasey, jmozah and rauljordan June 1, 2021 12:13
@nisdas nisdas added Ready For Review Networking P2P related items labels Jun 1, 2021
@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

Merging #8962 (d0df3c6) into develop (ef20f2d) will decrease coverage by 0.01%.
The diff coverage is 56.00%.

@@             Coverage Diff             @@
##           develop    #8962      +/-   ##
===========================================
- Coverage    60.90%   60.88%   -0.02%     
===========================================
  Files          530      531       +1     
  Lines        37510    37536      +26     
===========================================
+ Hits         22845    22855      +10     
- Misses       11382    11401      +19     
+ Partials      3283     3280       -3     

attnets: Bitvector[ATTESTATION_SUBNET_COUNT]
)
*/
message MetaDataV2 {
Copy link
Member

@terencechain terencechain Jun 1, 2021

Choose a reason for hiding this comment

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

This is not related to this PR, at least by looking at the title and the description. Please update the description

Copy link
Member Author

Choose a reason for hiding this comment

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

done

"google.golang.org/protobuf/proto"
)

// MetadataV1 is a convenience wrapper around our metadata protobuf object.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// MetadataV1 is a convenience wrapper around our metadata protobuf object.
// MetadataV0 is a convenience wrapper around our metadata protobuf object.

I wonder whether using V0 and V1 is better given we mostly start with versioning 0. pb.MetaData without any versioning makes me think it's closer to 0 than to 1 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

good question lol, would technically have to change every reference in that case. I can try and changing it to a 0 and 1 to see how much work it would take.

)

// Metadata returns the interface of a p2p metadata type.
type Metadata interface {
Copy link
Member

Choose a reason for hiding this comment

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

Do you want to add SyncBitfield() as well if you were to include V2 in the same PR

Copy link
Member Author

Choose a reason for hiding this comment

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

For the general metadata interface it should not have anything from V2.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking of adding this in our altair branch instead of here, given that is where it will be used.

@nisdas nisdas changed the title Add Metadata Interface Add Metadata V2 Object and Interface Jun 2, 2021
@nisdas nisdas merged commit 91bd477 into develop Jun 2, 2021
@delete-merged-branch delete-merged-branch bot deleted the addMetadataInterface branch June 2, 2021 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking P2P related items
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants