Skip to content

Commit

Permalink
adding get_extended_sample_count docsstring
Browse files Browse the repository at this point in the history
Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
  • Loading branch information
cskiraly committed Jun 27, 2024
1 parent 78b583d commit 1ad381d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock,
```python
def get_extended_sample_count(allowed_failures: uint64) -> uint64:
assert 0 <= allowed_failures <= NUMBER_OF_COLUMNS // 2
"""
Return the sample count if allowing failures.
This helper demonstrates how to calculate the number of columns to query per slot when
allowing given number of failures, assuming uniform random selection without replacement.
Nested functions are direct replacements of Python library functions math.comb and
scipy.stats.hypergeom.cdf, with the same signatures.
"""

def math_comb(n: int, k: int) -> int:
if not 0 <= k <= n:
Expand Down

0 comments on commit 1ad381d

Please sign in to comment.