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

Align PeerDAS sampling_size comparison units #4060

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

jimmygchen
Copy link
Contributor

The current sampling size logic mixes different units - SAMPLES_PER_SLOT is measured in column samples, while custody_group_count refers to custody groups:

At each slot, a node advertising custody_group_count downloads a minimum of sampling_size = max(SAMPLES_PER_SLOT, custody_group_count) total custody groups.

This discrepancy causes issues when NUMBER_OF_COLUMNS does not exactly match NUMBER_OF_CUSTODY_GROUPS, potentially leading to incorrect sampling_size.

This PR converts the custody_group_count to column count.

@jimmygchen
Copy link
Contributor Author

I'm not entirely sure if this change is correct, but I think we need to make sure the units used here are consistent.

Alternatively, we may want to change SAMPLES_PER_SLOT to mean "Number of custody groups a node queries per slot" instead - given that the two other custody configs both use custody groups as units:

| Name | Value | Description |
| - | - | - |
| `SAMPLES_PER_SLOT` | `8` | Number of `DataColumnSidecar` random samples a node queries per slot |
| `NUMBER_OF_CUSTODY_GROUPS` | `128` | Number of custody groups available for nodes to custody |
| `CUSTODY_REQUIREMENT` | `4` | Minimum number of custody groups an honest node custodies and serves samples from |

@jimmygchen jimmygchen changed the title Fix PeerDAS sampling_size logic Align PeerDAS sampling_size comparison units Dec 18, 2024
@ppopth
Copy link
Member

ppopth commented Dec 18, 2024

SAMPLES_PER_SLOT to mean "Number of custody groups a node queries per slot"

The unit of samples should be columns, since we do columns. Think of peer sampling, you sample columns, not custody groups.

Copy link
Member

@ppopth ppopth left a comment

Choose a reason for hiding this comment

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

Looks good to me

@hwwhww hwwhww added the EIP-7594 PeerDAS label Dec 18, 2024
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
@jtraglia jtraglia merged commit e6bddd9 into ethereum:dev Dec 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EIP-7594 PeerDAS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants