From 9872d38732e5614b5069f045cadc635a1eb470bc Mon Sep 17 00:00:00 2001 From: fradamt Date: Wed, 7 Aug 2024 17:58:20 +0200 Subject: [PATCH 1/2] basic validator custody --- configs/mainnet.yaml | 6 ++++-- configs/minimal.yaml | 6 ++++-- specs/_features/eip7594/das-core.md | 19 +++++++++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 39904616b2..9722a81004 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -159,10 +159,12 @@ WHISK_PROPOSER_SELECTION_GAP: 2 # EIP7594 NUMBER_OF_COLUMNS: 128 MAX_CELLS_IN_EXTENDED_MATRIX: 768 -DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 +DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 -CUSTODY_REQUIREMENT: 1 +CUSTODY_REQUIREMENT: 4 +VALIDATOR_CUSTODY_REQUIREMENT: 8 +BALANCE_PER_ADDITIONAL_CUSTODY_SUBNET: 32000000000 # 2**5 * 10**9 (= 32,000,000,000) TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 8ba65cec09..3cba49dea1 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -158,10 +158,12 @@ WHISK_PROPOSER_SELECTION_GAP: 1 # EIP7594 NUMBER_OF_COLUMNS: 128 MAX_CELLS_IN_EXTENDED_MATRIX: 768 -DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 +DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 -CUSTODY_REQUIREMENT: 1 +CUSTODY_REQUIREMENT: 4 +VALIDATOR_CUSTODY_REQUIREMENT: 8 +BALANCE_PER_ADDITIONAL_CUSTODY_SUBNET: 32000000000 # 2**5 * 10**9 (= 32,000,000,000) TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 97bce0d0eb..1b07f935bf 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -75,14 +75,16 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | -| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `32` | The number of data column sidecar subnets used in the gossipsub protocol | +| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `128` | The number of data column sidecar subnets used in the gossipsub protocol | ### Custody setting | Name | Value | Description | | - | - | - | | `SAMPLES_PER_SLOT` | `8` | Number of `DataColumnSidecar` random samples a node queries per slot | -| `CUSTODY_REQUIREMENT` | `1` | Minimum number of subnets an honest node custodies and serves samples from | +| `CUSTODY_REQUIREMENT` | `4` | Minimum number of subnets an honest node custodies and serves samples from | +| `VALIDATOR_CUSTODY_REQUIREMENT` | `8` | Minimum number of subnets an honest node with validators attached custodies and serves samples from | +| `BALANCE_PER_ADDITIONAL_CUSTODY_SUBNET` | `Gwei(32 * 10**9)` | Balance increment corresponding to one additional subnet to custody | | `TARGET_NUMBER_OF_PEERS` | `70` | Suggested minimum peer count | ### Containers @@ -279,6 +281,19 @@ A node *may* choose to custody and serve more than the minimum honesty requireme A node stores the custodied columns for the duration of the pruning period and responds to peer requests for samples on those columns. +### Validator custody + +A node with validators attached downloads and custodies a higher minimum of subnets per slot, determined by `get_validators_custody_requirement(state, validator_indices)`. Here, `state` is the current `BeaconState` and `validator_indices` is the list of indices corresponding to validators attached to the node. Any node with at least one validator attached, and with the sum of the balances of all attached validators being `total_node_balance`, downloads and custodies `total_node_balance // BALANCE_PER_ADDITIONAL_CUSTODY_SUBNET` subnets per slot, with a minimum of `VALIDATOR_CUSTODY_REQUIREMENT` and of course a maximum of `DATA_COLUMN_SIDECAR_SUBNET_COUNT`. + +```python +def get_validators_custody_requirement(state: BeaconState, validator_indices: Sequence[ValidatorIndex]) -> uint64: + total_node_balance = sum(state.balances[index] for index in validator_indices) + count = total_node_balance // BALANCE_PER_ADDITIONAL_CUSTODY_SUBNET + return min(max(count, VALIDATOR_CUSTODY_REQUIREMENT), DATA_COLUMN_SIDECAR_SUBNET_COUNT) +``` + +This higher custody is advertised in the node's ENR by setting a higher `custody_subnet_count`. As with the regular custody requirement, a node with validators *may* still choose to custody, advertise and serve more than this minimum. + ### Public, deterministic selection The particular columns that a node custodies are selected pseudo-randomly as a function (`get_custody_columns`) of the node-id and custody size -- importantly this function can be run by any party as the inputs are all public. From ea91275055bdeb6ac1e4d3ccccd9ce71e93bcff3 Mon Sep 17 00:00:00 2001 From: fradamt Date: Wed, 7 Aug 2024 18:35:13 +0200 Subject: [PATCH 2/2] doctoc --- specs/_features/eip7594/das-core.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 1b07f935bf..5ea4eb383e 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -26,6 +26,7 @@ - [`get_extended_sample_count`](#get_extended_sample_count) - [Custody](#custody) - [Custody requirement](#custody-requirement) + - [Validator custody](#validator-custody) - [Public, deterministic selection](#public-deterministic-selection) - [Peer discovery](#peer-discovery) - [Extended data](#extended-data)