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 new metadatav3 field custody_subnet_count to GET node/identity API #6348

Closed
jimmygchen opened this issue Sep 4, 2024 · 5 comments
Closed
Assignees
Labels
das Data Availability Sampling HTTP-API

Comments

@jimmygchen
Copy link
Member

Description

The custody_subnet_count field has been added to MetaDataV3, but we don't return it in the HTTP api yet and should be added:

metadata: api_types::MetaData {
seq_number: *meta_data.seq_number(),
attnets: format!(
"0x{}",
hex::encode(meta_data.attnets().clone().into_bytes()),
),
syncnets: format!(
"0x{}",
hex::encode(
meta_data
.syncnets()
.cloned()
.unwrap_or_default()
.into_bytes()
)
),
},

@jimmygchen jimmygchen added das Data Availability Sampling HTTP-API labels Sep 4, 2024
@Gua00va
Copy link
Contributor

Gua00va commented Nov 10, 2024

Can would like to work on this

@Gua00va
Copy link
Contributor

Gua00va commented Nov 10, 2024

@jimmygchen how are the getter methods for MetaData struct generated? I see we are using these directly when genrating the API response but can't seem to figure out where these are coming from.

@jimmygchen
Copy link
Member Author

Hi @Gua00va sorry about the delayed response

The getter method are generated using superstruct macros as defined here:

#[superstruct(
variants(V1, V2, V3),
variant_attributes(
derive(Encode, Decode, Clone, Debug, PartialEq, Serialize),
serde(bound = "E: EthSpec", deny_unknown_fields),
)
)]
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(bound = "E: EthSpec")]
pub struct MetaData<E: EthSpec> {
/// A sequential counter indicating when data gets modified.
pub seq_number: u64,
/// The persistent attestation subnet bitfield.
pub attnets: EnrAttestationBitfield<E>,
/// The persistent sync committee bitfield.
#[superstruct(only(V2, V3))]
pub syncnets: EnrSyncCommitteeBitfield<E>,
#[superstruct(only(V3))]
pub custody_subnet_count: u64,
}

The guide I think above explains how it works and how to use them. Let me know if you need any help.

@jimmygchen
Copy link
Member Author

Hi @Gua00va
I'm going to pick this up since we are going to need this soon and we haven't heard back - thanks for your interest though!

@jimmygchen
Copy link
Member Author

Completed in #6827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
das Data Availability Sampling HTTP-API
Projects
None yet
Development

No branches or pull requests

2 participants