Skip to content

Conversation

pls148
Copy link
Contributor

@pls148 pls148 commented Oct 1, 2025

This PR:

  • Adds support for genesis -> da_committees
  • Parsing of da_committees
  • EpochCommittees now holds da_committees as data instead of known_da_nodes

This PR does not:

  • Actually do anything with the new data

Key places to review:

Example da_committees in data/genesis/X.toml:

[da_committees]
0.3 = {
    0 = [
        { stake_table_key = "BLS_VER_KEY~bQszS-QKYvUij2g20VqS8asttGSb95NrTu2PUj0uMh1CBUxNy1FqyPDjZqB29M7ZbjWqj79QkEOWkpga84AmDYUeTuWmy-0P1AdKHD3ehc-dKvei78BDj5USwXPJiDUlCxvYs_9rWYhagaq-5_LXENr78xel17spftNd5MA1Mw5U", state_ver_key = "SCHNORR_VER_KEY~lJqDaVZyM0hWP2Br52IX5FeE-dCAIC-dPX7bL5-qUx-vjbunwe-ENOeZxj6FuOyvDCFzoGeP7yZ0fM995qF-CRE", stake = 1 }
    ]
}

@pls148 pls148 force-pushed the ps/load-da-committee branch 9 times, most recently from 9c100c2 to 99589b4 Compare October 2, 2025 01:17
[(TYPES::Epoch::new(0), self.known_da_nodes.clone())].into()
} else {
if !self.known_da_nodes.is_empty() {
tracing::warn!(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could be an error

or arguably even a panic -- I think it might be preferable to call this a misconfiguration and immediately panic vs. try to resolve the ambiguity

let da_members = da_committees
.get(&Epoch::new(0))
.cloned()
.unwrap_or_default(); // For testing reasons, we want to support being given an empty map
Copy link
Contributor

Choose a reason for hiding this comment

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

or_default means return an empty vec here right? I think it would be better to panic, since an empty DA committee is always a (fatal) error

#[serde(default)]
pub upgrades: BTreeMap<Version, Upgrade>,
#[serde(default)]
pub da_committees: Option<BTreeMap<TomlKeyU64, Vec<PeerConfigData>>>,
Copy link
Contributor

Choose a reason for hiding this comment

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

A BTreeMap can be null right? do we need to make this an Option?

Copy link
Contributor

Choose a reason for hiding this comment

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

also is there a reason it needs to be in both HotShotConfig and Genesis?

do we use it out of HotShotConfig anywhere? (I think it's fine to leave it in both even if we only use it out of genesis, just wondering)

@pls148 pls148 force-pushed the ps/load-da-committee branch 3 times, most recently from 10bf649 to ca9dcbd Compare October 4, 2025 00:33
known_nodes_with_stake: Vec<PeerConfig<SeqTypes>>,
known_da_nodes: Vec<PeerConfig<SeqTypes>>,
#[serde(default)]
da_committees: BTreeMap<Version, BTreeMap<u64, Vec<PeerConfig<SeqTypes>>>>,
Copy link
Contributor

@ss-es ss-es Oct 6, 2025

Choose a reason for hiding this comment

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

I think the inner BTreeMap is unnecessary -- this should just be a BTreeMap<Version, (u64, PeerConfig<SeqTypes>)>

maybe @bfish713 can comment, but I think it's unlikely that we'd schedule an upgrade with multiple DA committees that take effect at different points in the future? and it definitely complicates the logic

@pls148 pls148 force-pushed the ps/load-da-committee branch from ca9dcbd to a09bb19 Compare October 6, 2025 22:02
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