Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove CGC from data_availability checker #7033

Merged
merged 17 commits into from
Mar 26, 2025

Conversation

dapplion
Copy link
Collaborator

Issue Addressed

Validator custody makes the CGC and set of sampling columns dynamic. Right now this information is stored twice:

  • in the data availability checker
  • in the network globals

If that state becomes dynamic we must make sure it is in sync updating it twice, or guarding it behind a mutex. However, I noted that we don't really have to keep the CGC inside the data availability checker. All consumers can actually read it from the network globals, and we can update make_available to read the expected count of data columns from the block.

@dapplion dapplion added the das Data Availability Sampling label Feb 24, 2025
@dapplion dapplion requested a review from jxs as a code owner February 24, 2025 23:40
@dapplion dapplion added the ready-for-review The code is ready for review label Feb 24, 2025
@@ -145,13 +152,16 @@ impl<E: EthSpec> RpcBlock<E> {
Ok(Self {
block_root,
block: inner,
// Block is before PeerDAS
custody_columns_count: 0,
})
}

Copy link
Member

Choose a reason for hiding this comment

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

might be worth having consistent terminology for:

  1. Blocks
  2. Post-Deneb Blocks (blocks with blobs)
  3. Post-PeerDAS Blocks (blocks with custody columns)

Not sure what terminology that would be, but if we don't already have one / can't think of one, we should at least rename the above new function to something like new_with_blobs or something.

Copy link
Collaborator Author

@dapplion dapplion Mar 9, 2025

Choose a reason for hiding this comment

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

I want to get rid of RpcBlock completely, so this assignment here will become irrelevant. Instead have a chain segment as an enum as you suggest

Copy link
Member

@ethDreamer ethDreamer left a comment

Choose a reason for hiding this comment

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

some tests still need to be fixed

@@ -33,6 +33,8 @@ pub struct NetworkGlobals<E: EthSpec> {
/// The computed sampling subnets and columns is stored to avoid re-computing.
pub sampling_subnets: HashSet<DataColumnSubnetId>,
pub sampling_columns: HashSet<ColumnIndex>,
/// Constant custody group count (CGC) set at startup
custody_group_count: u64,
Copy link
Member

Choose a reason for hiding this comment

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

You think it might be worth using one naming convention (like custody_group_count) everywhere instead of also using custody_columns_count?

Copy link
Member

Choose a reason for hiding this comment

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

Also this isn't behind any RwLock or anything but it was my understanding that this could change as the node synced more columns / added more validators? Or is that just not implemented yet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not implemented yet

@ethDreamer ethDreamer 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 Mar 11, 2025
@dapplion dapplion 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 Mar 12, 2025
@dapplion dapplion requested a review from ethDreamer March 13, 2025 14:02
Copy link

mergify bot commented Mar 13, 2025

This pull request has merge conflicts. Could you please resolve them @dapplion? 🙏

@dapplion
Copy link
Collaborator Author

CI passing now

Copy link

mergify bot commented Mar 24, 2025

This pull request has merge conflicts. Could you please resolve them @dapplion? 🙏

Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

@dapplion this is looking good! and thanks for the first round of review @ethDreamer 🙏
I've added a few comments. Let me know what you think!

@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 Mar 24, 2025
Copy link
Member

@jimmygchen jimmygchen left a comment

Choose a reason for hiding this comment

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

LGTM! be great to test this on a peerdas local devnet before merging.

@jimmygchen jimmygchen added ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Mar 26, 2025
@jimmygchen
Copy link
Member

I've tested this locally with Kurtosis and is working as expected.

mergify bot added a commit that referenced this pull request Mar 26, 2025
Copy link

mergify bot commented Mar 26, 2025

This pull request has been removed from the queue for the following reason: pull request dequeued.

Pull request #7033 has been dequeued. The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. (details: 1 review requesting changes and 1 approving review by reviewers with write access.)

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.

If you want to requeue this pull request, you can post a @mergifyio requeue comment.

@jimmygchen jimmygchen dismissed ethDreamer’s stale review March 26, 2025 04:44

Comments addressed

mergify bot added a commit that referenced this pull request Mar 26, 2025
@mergify mergify bot merged commit 6f31d44 into sigp:unstable Mar 26, 2025
31 checks passed
@dapplion dapplion deleted the dedup-cgc-block branch March 26, 2025 13:24
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
das Data Availability Sampling ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants