Skip to content

Commit

Permalink
move epoch subscription length to config
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed May 23, 2023
1 parent f87e143 commit 68ce45b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
2 changes: 2 additions & 0 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions presets/mainnet/phase0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions presets/minimal/phase0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions specs/phase0/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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). |
Expand Down

0 comments on commit 68ce45b

Please sign in to comment.