From 68ce45b3058186ff9e8bdecb19d51327851a4259 Mon Sep 17 00:00:00 2001 From: djrtwo Date: Tue, 23 May 2023 13:52:36 -0600 Subject: [PATCH] move epoch subscription length to config --- configs/mainnet.yaml | 2 ++ configs/minimal.yaml | 2 ++ presets/mainnet/phase0.yaml | 5 ----- presets/minimal/phase0.yaml | 5 ----- specs/phase0/p2p-interface.md | 7 +------ 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 1a1537b26d..baf489739e 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -102,6 +102,8 @@ DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa GOSSIP_MAX_SIZE: 1048576 # `2**10` (= 1024) MAX_REQUEST_BLOCKS: 1024 +# `2**8` (= 256) +EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 # `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 33024, ~5 months) MIN_EPOCHS_FOR_BLOCK_REQUESTS: 33024 # `2**20` (=1048576, 1 MiB) diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 32d5682a82..43f1fc83fa 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -103,6 +103,8 @@ DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890 GOSSIP_MAX_SIZE: 1048576 # `2**10` (= 1024) MAX_REQUEST_BLOCKS: 1024 +# `2**8` (= 256) +EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 # [customized] `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 272) MIN_EPOCHS_FOR_BLOCK_REQUESTS: 272 # `2**20` (=1048576, 1 MiB) diff --git a/presets/mainnet/phase0.yaml b/presets/mainnet/phase0.yaml index c84a935954..02bc96c8cd 100644 --- a/presets/mainnet/phase0.yaml +++ b/presets/mainnet/phase0.yaml @@ -86,8 +86,3 @@ MAX_ATTESTATIONS: 128 MAX_DEPOSITS: 16 # 2**4 (= 16) MAX_VOLUNTARY_EXITS: 16 - -# Networking -# --------------------------------------------------------------- -# 2**8 (= 256) -EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 diff --git a/presets/minimal/phase0.yaml b/presets/minimal/phase0.yaml index c55f7de7b7..e7028f5a42 100644 --- a/presets/minimal/phase0.yaml +++ b/presets/minimal/phase0.yaml @@ -86,8 +86,3 @@ MAX_ATTESTATIONS: 128 MAX_DEPOSITS: 16 # 2**4 (= 16) MAX_VOLUNTARY_EXITS: 16 - -# Networking -# --------------------------------------------------------------- -# 2**8 (= 256) -EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 diff --git a/specs/phase0/p2p-interface.md b/specs/phase0/p2p-interface.md index 3b8a91cc94..de3e0e529c 100644 --- a/specs/phase0/p2p-interface.md +++ b/specs/phase0/p2p-interface.md @@ -22,7 +22,6 @@ It consists of four main sections: - [Consensus-layer network interaction domains](#consensus-layer-network-interaction-domains) - [Custom types](#custom-types) - [Constants](#constants) - - [Preset](#preset) - [Configuration](#configuration) - [MetaData](#metadata) - [The gossip domain: gossipsub](#the-gossip-domain-gossipsub) @@ -184,11 +183,6 @@ We define the following Python custom types for type hinting and readability: | - | - | :-: | :-: | | `NODE_ID_BITS` | `256` | The bit length of uint256 is 256 | -### Preset -| Name | Value | Unit | Duration | -| - | - | :-: | :-: | -| `EPOCHS_PER_SUBNET_SUBSCRIPTION` | `2**8` (= 256) | epochs | ~27 hours | - ### Configuration This section outlines configurations that are used in this spec. @@ -197,6 +191,7 @@ This section outlines configurations that are used in this spec. |---|---|---| | `GOSSIP_MAX_SIZE` | `2**20` (= 1048576, 1 MiB) | The maximum allowed size of uncompressed gossip messages. | | `MAX_REQUEST_BLOCKS` | `2**10` (= 1024) | Maximum number of blocks in a single request | +| `EPOCHS_PER_SUBNET_SUBSCRIPTION` | `2**8` (= 256) | Number of epochs on a subnet subscription (~27 hours) | | `MIN_EPOCHS_FOR_BLOCK_REQUESTS` | `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 33024, ~5 months) | The minimum epoch range over which a node must serve blocks | | `MAX_CHUNK_SIZE` | `2**20` (=1048576, 1 MiB) | The maximum allowed size of uncompressed req/resp chunked responses. | | `TTFB_TIMEOUT` | `5` | The maximum duration in **seconds** to wait for first byte of request response (time-to-first-byte). |