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-v3 for custody subnet count #6486

Merged
merged 5 commits into from
Aug 12, 2024
Merged

Conversation

agnxsh
Copy link
Contributor

@agnxsh agnxsh commented Aug 11, 2024

This PR adds metadata V3 for custody_subnet_count, keeping metadata V2 compatible.

Copy link

github-actions bot commented Aug 11, 2024

Unit Test Results

       6 files     658 suites   12m 29s ⏱️
2 984 tests 2 636 ✔️ 348 💤 0
9 499 runs  9 143 ✔️ 356 💤 0

Results for commit bfa7d5d.

♻️ This comment has been updated with latest results.

@@ -175,10 +175,14 @@ p2pProtocol PeerSync(version = 1,
{.libp2pProtocol("metadata", 1).} =
raise newException(InvalidInputsError, "GetMetaData v1 unsupported")

proc getMetadata_v2(peer: Peer): altair.MetaData
proc getMetadata_v2(peer: Peer): eip7594.MetaData
Copy link
Contributor

Choose a reason for hiding this comment

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

The v2 endpoint is still defined to return an altair.MetaData. One way to do this is construct an altair.MetaData from the internal eip7594.MetaData

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that should be ideal. ok

@@ -9,7 +9,7 @@

import
std/[sequtils],
"."/[base, deneb],
"."/[base, deneb, altair],
Copy link
Contributor

Choose a reason for hiding this comment

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

Usually the codebase uses either the fork order (base, altair, deneb) or alphabetical (altair, base, deneb), but here fork order seems to be usual

@@ -2082,7 +2082,7 @@ proc updatePeerMetadata(node: Eth2Node, peerId: PeerId) {.async: (raises: [Cance

let
peer = node.getPeer(peerId)
newMetadataRes = await peer.getMetadata_v2()
newMetadataRes = await peer.getMetadata_v3()
Copy link
Contributor

Choose a reason for hiding this comment

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

This unconditional replacement of the v2 endpoint with the v3 endpoint only works if all the other peers also support it. This might be true for the PeerDAS devnets, in which case, ok. But it's not something ultimately mergeable into Nimbus unstable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree on this, I can probably write it in a way to support v2 as well.

@agnxsh agnxsh merged commit 1ebba1f into peerdas-p2p Aug 12, 2024
10 of 14 checks passed
@agnxsh agnxsh deleted the agnxsh/metadata-v3 branch August 12, 2024 15:57
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