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

PeerDAS sampling clarifications #3782

Merged
merged 16 commits into from
Jun 27, 2024
Merged

Conversation

cskiraly
Copy link
Contributor

This is to clarify sample selection and sample query based on previous discussions.

  • clarify randomization in sample selection
  • explicitly allow false positive threshold based LossyDAS
  • separate description of sample selection from the sample query process
  • recommend randomization for load balancing
  • clarify the case of sample column already in custody

Note: I think some of SHOULD might be elevated to a MUST here. I was not doing it as the baseline used SHOULD, but I think some of this behaviour should be mandated, even if we can't enforce it.

cskiraly added 2 commits May 28, 2024 13:54
- describe sample selection
- describe sample queries

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Clarify that what matters is the false positive threshold, allowing
different sampling strategies as protocol compliant behavior.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
specs/_features/eip7594/das-core.md Outdated Show resolved Hide resolved
specs/_features/eip7594/das-core.md Outdated Show resolved Hide resolved
specs/_features/eip7594/das-core.md Outdated Show resolved Hide resolved
specs/_features/eip7594/das-core.md Show resolved Hide resolved
specs/_features/eip7594/das-core.md Outdated Show resolved Hide resolved
@hwwhww hwwhww added the EIP-7594 PeerDAS label May 28, 2024
hwwhww and others added 6 commits May 28, 2024 22:57
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
While the technique was introduced as LossyDAS, we don't need the name
in the specification itself.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
add LossyDAS sample count generation helper function

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Importing scipy is not preferred. This is a self-contained
version. Eventually an import of math and use of math.comb
makes it simpler.
Solving other formatting issues as well.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
@cskiraly
Copy link
Contributor Author

types, type conversions, and tests and look good to me, thanks!

cskiraly and others added 3 commits June 27, 2024 09:30
Co-authored-by: Pop Chunhapanya <haxx.pop@gmail.com>
Here we assume uniform random selection without replacement.
If other methods are used, the target false positive threshold
is the main rule to follow.

Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
@cskiraly
Copy link
Contributor Author

There is no unique naming convention for these. We follow the naming of the direct replacement scipy.stats.hypergeom.cdf function.
I've added docstring in 1ad381d to clarify. Not adding per-parameter comments, since it is not really done in other parts of the spec.

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


```python
def get_extended_sample_count(allowed_failures: uint64) -> uint64:
assert 0 <= allowed_failures <= NUMBER_OF_COLUMNS // 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Never seen a function docstring below the asserts. Do we do this elsewhere in the specs?

Copy link
Contributor

Choose a reason for hiding this comment

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

we did in phase0 process_attestation:

assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot <= data.slot + SLOTS_PER_EPOCH

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've moved it, although a bit late. Anyway, if needed, here it is 195ec21

@hwwhww hwwhww merged commit 0a49572 into ethereum:dev Jun 27, 2024
26 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.

6 participants