Skip to content

Soft fork gossip topic activation and deactivation #5899

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

Closed
wants to merge 2 commits into from

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented Jun 6, 2024

Issue Addressed

PeerDAS requires new features not available in current gossip topic machinery:

  • Unsubscribe from a topic kind at a fork boundary (so far we only added)
  • Change core topics at an epoch that does not align with a ForkName fork
  • Change core topics without changing fork-digest

Most of the changes from this PR can be back-ported to unstable but I want to make sure they align with what we need for PeerDAS

Proposed Changes

  • Move logic to compute what to subscribe to the function core_topics_to_subscribe(epoch, opts). It consolidates logic that is fork dependant with other user options like subscribe-all-subnets. The previous approach was very rigid expecting a set of topics for every ForkName. Now the set of topics change depending on peer das epoch
  • Define a list of "fork transitions" which include your beloved altair, capella, etc and now a non-fork transition "peerdas".
  • Add two functions new_topics_to_subscribe_at_epoch and old_topics_to_unsubscribe_at_epoch which diff the output of core_topics_to_subscribe across a "fork transition". Then, at the fork transition epoch subscribe the new topics, and forget the old ones

Closes #5894

@dapplion dapplion requested a review from jimmygchen June 6, 2024 13:23
@jimmygchen jimmygchen added das Data Availability Sampling ready-for-review The code is ready for review labels Jun 7, 2024
@jimmygchen
Copy link
Member

My understanding from latest discussions on ACDC & breakout call is that the plan is to activate PeerDAS at a hard fork (due to consensus changes and ease of coordination), thus PEERDAS_ACTIVATION_EPOCH would be the same as either ELECTRA_FORK_EPOCH or FSTAR_FORK_EPOCH. Therefore topic change could just occur as part of the hard fork transition?

@dapplion
Copy link
Collaborator Author

What consensus changes ?

@jimmygchen
Copy link
Member

Rules to import into fork choice are different (custody columns instead of blobs) and incompatible; and additionally trailing fork choice changes. Are these not consensus changes?

New nodes won't be sharing the same view of the chain as old nodes, isn't that technically a hard fork?

@jimmygchen
Copy link
Member

  • Unsubscribe from a topic kind at a fork boundary (so far we only added)
  • Change core topics at an epoch that does not align with a ForkName fork
  • Change core topics without changing fork-digest

I think these features added could still be quite useful though, regardless of whether we use it for PeerDAS - and maybe we could use it for PeerDAS - I'm just raising what I understood from various discussions.

@dapplion
Copy link
Collaborator Author

fork choice changes are not a consensus change, because you can still interop and only matters in your local view. Fork-choice changes SHOULD be coordinated tho, otherwise weird things can happen, but that's why using an activation epoch is enough

next_epoch: Epoch,
opts: &TopicSubscriptionOpts,
) -> Vec<GossipKind> {
let prev_epoch = next_epoch.saturating_sub(Epoch::new(1));
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this method is called at genesis, but if it is, I don't think it works since you'll never have a different prev_set and next_set

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice pick! Fixed in 6fa81e8

@jimmygchen jimmygchen added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jul 24, 2024
@jimmygchen jimmygchen added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Aug 21, 2024
@mergify mergify bot deleted the branch sigp:das August 27, 2024 04:10
@mergify mergify bot closed this Aug 27, 2024
@michaelsproul michaelsproul reopened this Aug 27, 2024
@michaelsproul
Copy link
Member

Please update to point at unstable by either:

  1. Rebasing on unstable (if your branch has a small number of commits that are easy to tease out), or
  2. Merging origin/das into this PR: git fetch origin; git merge origin/das. This will result in the smallest number of conflict resolutions and is better for branches that already contain merge commits or have extensive history.

@dapplion
Copy link
Collaborator Author

dapplion commented Jan 7, 2025

Obsolete, PeerDAS is part of Fulu

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

Successfully merging this pull request may close these issues.

4 participants