Skip to content

Commit

Permalink
fixup! EIP-7594: Decouple network subnets from das-core
Browse files Browse the repository at this point in the history
  • Loading branch information
ppopth committed Jul 27, 2024
1 parent 5e91577 commit 4c8aee5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ The following values are (non-configurable) constants used throughout the specif
| Name | Value | Description |
| - | - | - |
| `SAMPLES_PER_SLOT` | `8` | Number of `DataColumnSidecar` random samples a node queries per slot |
| `NUMBER_OF_CUSTODY_GROUPS` | `32` | Number of column groups nodes will custody. |
| `NUMBER_OF_CUSTODY_GROUPS` | `32` | Number of column groups available for nodes to custody |
| `CUSTODY_REQUIREMENT` | `1` | Minimum number of custody groups an honest node custodies and serves samples from |
| `TARGET_NUMBER_OF_PEERS` | `70` | Suggested minimum peer count |

Expand Down Expand Up @@ -136,6 +136,7 @@ def get_custody_groups(node_id: NodeID, custody_group_count: uint64) -> Sequence

```python
def compute_columns_for_custody_group(custody_group: CustodyIndex) -> Sequence[ColumnIndex]:
assert custody_group < NUMBER_OF_CUSTODY_GROUPS
columns_per_group = NUMBER_OF_COLUMNS // NUMBER_OF_CUSTODY_GROUPS
return sorted([
ColumnIndex(NUMBER_OF_CUSTODY_GROUPS * i + custody_group)
Expand Down Expand Up @@ -271,7 +272,7 @@ def get_extended_sample_count(allowed_failures: uint64) -> uint64:

### Custody requirement

Columns are grouped in custody groups. Nodes custodying a custody group are supposed to custody all the columns in that group.
Columns are grouped into custody groups. Nodes custodying a custody group MUST custody all the columns in that group.

Each node downloads and custodies a minimum of `CUSTODY_REQUIREMENT` custody groups per slot. The particular custody groups that the node is required to custody are selected pseudo-randomly (more on this below).

Expand Down
4 changes: 2 additions & 2 deletions specs/_features/eip7594/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
| Name | Value | Description |
| - | - | - |
| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `128` | The number of data column sidecar subnets used in the gossipsub protocol |
| `MAX_REQUEST_DATA_COLUMN_SIDECARS` | `MAX_REQUEST_BLOCKS_DENEB * NUMBER_OF_COLUMNS` | Maximum number of data column sidecars in a single request |
| `MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS` | `2**12` (= 4096 epochs, ~18 days) | The minimum epoch range over which a node must serve data column sidecars |
| `MAX_REQUEST_DATA_COLUMN_SIDECARS` | `MAX_REQUEST_BLOCKS_DENEB * NUMBER_OF_COLUMNS` | Maximum number of data column sidecars in a single request |
| `MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS` | `2**12` (= 4096 epochs, ~18 days) | The minimum epoch range over which a node must serve data column sidecars |

### Containers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ def test_get_custody_columns_custody_size_more_than_number_of_groups(spec):
node_id = 1
custody_group_count = spec.config.NUMBER_OF_CUSTODY_GROUPS + 1
expect_assertion_error(lambda: spec.get_custody_groups(node_id, custody_group_count))


@with_eip7594_and_later
@spec_test
@single_phase
def test_compute_columns_for_custody_group_out_of_bound_custody_group(spec):
expect_assertion_error(lambda: spec.compute_columns_for_custody_group(spec.config.NUMBER_OF_CUSTODY_GROUPS))
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `compute_columns_for_custody_group` tests

`compute_columns_for_custody_group` tests provide sanity check of the correctness of `compute_columns_for_custody_group` helper.
`compute_columns_for_custody_group` tests provide sanity checks for the correctness of the `compute_columns_for_custody_group` helper function.

## Test case format

Expand Down
2 changes: 1 addition & 1 deletion tests/formats/networking/get_custody_groups.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `get_custody_groups` tests

`get_custody_groups` tests provide sanity check of the correctness of `get_custody_groups` helper.
`get_custody_groups` tests provide sanity checks for the correctness of the `get_custody_groups` helper function.

## Test case format

Expand Down

0 comments on commit 4c8aee5

Please sign in to comment.