Skip to content

Commit

Permalink
Merge pull request #3994 from jtraglia/fulu
Browse files Browse the repository at this point in the history
Make initial Fulu spec
  • Loading branch information
jtraglia authored Dec 12, 2024
2 parents d8276ac + deb5241 commit fef87e7
Show file tree
Hide file tree
Showing 47 changed files with 212 additions and 214 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
command: make citest fork=electra
- store_test_results:
path: tests/core/pyspec/test-reports
test-whisk:
test-fulu:
docker:
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
Expand All @@ -165,10 +165,10 @@ jobs:
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=whisk
command: make citest fork=fulu
- store_test_results:
path: tests/core/pyspec/test-reports
test-eip7594:
test-whisk:
docker:
- image: cimg/python:3.12.4
working_directory: ~/specs-repo
Expand All @@ -178,7 +178,7 @@ jobs:
- restore_pyspec_cached_venv
- run:
name: Run py-tests
command: make citest fork=eip7594
command: make citest fork=whisk
- store_test_results:
path: tests/core/pyspec/test-reports
table_of_contents:
Expand Down Expand Up @@ -239,10 +239,10 @@ workflows:
- test-electra:
requires:
- install_pyspec_test
- test-whisk:
- test-fulu:
requires:
- install_pyspec_test
- test-eip7594:
- test-whisk:
requires:
- install_pyspec_test
- table_of_contents
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
needs: [lint,codespell,table_of_contents]
strategy:
matrix:
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "whisk", "eip7594"]
version: ["phase0", "altair", "bellatrix", "capella", "deneb", "electra", "fulu", "whisk"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ tests/core/pyspec/eth2spec/bellatrix/
tests/core/pyspec/eth2spec/capella/
tests/core/pyspec/eth2spec/deneb/
tests/core/pyspec/eth2spec/electra/
tests/core/pyspec/eth2spec/fulu/
tests/core/pyspec/eth2spec/whisk/
tests/core/pyspec/eth2spec/eip7594/
tests/core/pyspec/eth2spec/eip6800/
tests/core/pyspec/eth2spec/eip7732/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/*/*.md) \
$(wildcard $(SPEC_DIR)/_features/*/*/*.md) \
$(wildcard $(SSZ_DIR)/*.md)

ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra whisk eip6800 eip7594 eip7732
ALL_EXECUTABLE_SPEC_NAMES = phase0 altair bellatrix capella deneb electra fulu whisk eip6800 eip7732
# The parameters for commands. Use `foreach` to avoid listing specs again.
COVERAGE_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), --cov=eth2spec.$S.$(TEST_PRESET_TYPE))
PYLINT_SCOPE := $(foreach S,$(ALL_EXECUTABLE_SPEC_NAMES), ./eth2spec/$S)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Features are researched and developed in parallel, and then consolidated into se
| Seq. | Code Name | Fork Epoch | Specs |
| - | - | - | - |
| 5 | **Electra** | TBD | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/electra/beacon-chain.md)</li><li>[Electra fork](specs/electra/fork.md)</li></ul><li>Additions</li><ul><li>[Light client sync protocol changes](specs/electra/light-client/sync-protocol.md) ([fork](specs/electra/light-client/fork.md), [networking](specs/electra/light-client/p2p-interface.md))</li><li>[Honest validator guide changes](specs/electra/validator.md)</li><li>[P2P networking](specs/electra/p2p-interface.md)</li></ul></ul> |
| 6 | **Fulu** | TBD | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/fulu/beacon-chain.md)</li><li>[Fulu fork](specs/fulu/fork.md)</li><li>[Data availability sampling core](specs/fulu/das-core.md)</li><li>[Polynomial commitments sampling](specs/fulu/polynomial-commitments-sampling.md)</li><li>[Fork choice changes](specs/fulu/fork-choice.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/fulu/validator.md)</li><li>[P2P networking](specs/fulu/p2p-interface.md)</li><li>[Peer sampling](specs/fulu/peer-sampling.md)</li></ul></ul> |

### Outdated Specifications

Expand Down
28 changes: 14 additions & 14 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ DENEB_FORK_EPOCH: 269568 # March 13, 2024, 01:55:35pm UTC
# Electra
ELECTRA_FORK_VERSION: 0x05000000
ELECTRA_FORK_EPOCH: 18446744073709551615 # temporary stub
# EIP7594
EIP7594_FORK_VERSION: 0x06000000 # temporary stub
EIP7594_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x06000000
FULU_FORK_EPOCH: 18446744073709551615 # temporary stub
# WHISK
WHISK_FORK_VERSION: 0x08000000 # temporary stub
WHISK_FORK_EPOCH: 18446744073709551615
Expand Down Expand Up @@ -167,23 +167,23 @@ MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7594
# Fulu
NUMBER_OF_COLUMNS: 128
NUMBER_OF_CUSTODY_GROUPS: 128
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4
TARGET_BLOBS_PER_BLOCK_EIP7594: 9
MAX_BLOBS_PER_BLOCK_EIP7594: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594`
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536
TARGET_BLOBS_PER_BLOCK_FULU: 9
MAX_BLOBS_PER_BLOCK_FULU: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_FULU`
MAX_REQUEST_BLOB_SIDECARS_FULU: 1536

# Whisk
# `Epoch(2**8)`
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256
# `Epoch(2)`
WHISK_PROPOSER_SELECTION_GAP: 2

# EIP7732
MAX_REQUEST_PAYLOADS: 128
24 changes: 12 additions & 12 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ DENEB_FORK_EPOCH: 18446744073709551615
# Electra
ELECTRA_FORK_VERSION: 0x05000001
ELECTRA_FORK_EPOCH: 18446744073709551615
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615
# Fulu
FULU_FORK_VERSION: 0x06000001
FULU_FORK_EPOCH: 18446744073709551615
# WHISK
WHISK_FORK_VERSION: 0x08000001
WHISK_FORK_EPOCH: 18446744073709551615
Expand Down Expand Up @@ -168,21 +168,21 @@ MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152

# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7594
# Fulu
NUMBER_OF_COLUMNS: 128
NUMBER_OF_CUSTODY_GROUPS: 128
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4
TARGET_BLOBS_PER_BLOCK_EIP7594: 9
MAX_BLOBS_PER_BLOCK_EIP7594: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594`
MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536
TARGET_BLOBS_PER_BLOCK_FULU: 9
MAX_BLOBS_PER_BLOCK_FULU: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_FULU`
MAX_REQUEST_BLOB_SIDECARS_FULU: 1536

# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
WHISK_PROPOSER_SELECTION_GAP: 1

# EIP7732
MAX_REQUEST_PAYLOADS: 128
2 changes: 1 addition & 1 deletion presets/mainnet/eip7594.yaml → presets/mainnet/fulu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Mainnet preset - EIP7594
# Mainnet preset - FULU

# Misc
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion presets/minimal/eip7594.yaml → presets/minimal/fulu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Minimal preset - EIP7594
# Minimal preset - FULU

# Misc
# ---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pysetup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CAPELLA = 'capella'
DENEB = 'deneb'
ELECTRA = 'electra'
EIP7594 = 'eip7594'
FULU = 'fulu'
EIP6800 = 'eip6800'
WHISK = 'whisk'
EIP7732 = 'eip7732'
Expand Down
4 changes: 2 additions & 2 deletions pysetup/md_doc_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
CAPELLA,
DENEB,
ELECTRA,
FULU,
WHISK,
EIP7594,
EIP6800,
EIP7732,
)
Expand All @@ -21,8 +21,8 @@
CAPELLA: BELLATRIX,
DENEB: CAPELLA,
ELECTRA: DENEB,
FULU: ELECTRA,
WHISK: CAPELLA,
EIP7594: ELECTRA,
EIP6800: DENEB,
EIP7732: ELECTRA,
}
Expand Down
4 changes: 2 additions & 2 deletions pysetup/spec_builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from .capella import CapellaSpecBuilder
from .deneb import DenebSpecBuilder
from .electra import ElectraSpecBuilder
from .fulu import FuluSpecBuilder
from .whisk import WhiskSpecBuilder
from .eip7594 import EIP7594SpecBuilder
from .eip6800 import EIP6800SpecBuilder
from .eip7732 import EIP7732SpecBuilder

Expand All @@ -14,6 +14,6 @@
builder.fork: builder
for builder in (
Phase0SpecBuilder, AltairSpecBuilder, BellatrixSpecBuilder, CapellaSpecBuilder, DenebSpecBuilder,
ElectraSpecBuilder, WhiskSpecBuilder, EIP7594SpecBuilder, EIP6800SpecBuilder, EIP7732SpecBuilder,
ElectraSpecBuilder, FuluSpecBuilder, WhiskSpecBuilder, EIP6800SpecBuilder, EIP7732SpecBuilder,
)
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Dict

from .base import BaseSpecBuilder
from ..constants import EIP7594
from ..constants import FULU


class EIP7594SpecBuilder(BaseSpecBuilder):
fork: str = EIP7594
class FuluSpecBuilder(BaseSpecBuilder):
fork: str = FULU

@classmethod
def imports(cls, preset_name: str):
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_run_docker_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


# Set variables
ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "whisk" "eip7594")
ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "fulu" "whisk")
TEST_PRESET_TYPE=minimal
FORK_TO_TEST=phase0
WORKDIR="//consensus-specs//tests//core//pyspec"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EIP7594 -- The Beacon Chain
# Fulu -- The Beacon Chain

**Notice**: This document is a work-in-progress for researchers and implementers.

Expand Down Expand Up @@ -27,8 +27,8 @@

| Name | Value | Description |
| - | - | - |
| `TARGET_BLOBS_PER_BLOCK_EIP7594` | `uint64(9)` | *[New in EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_EIP7594` |
| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(12)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |
| `TARGET_BLOBS_PER_BLOCK_FULU` | `uint64(9)` | *[New in Fulu:EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_FULU` |
| `MAX_BLOBS_PER_BLOCK_FULU` | `uint64(12)` | *[New in Fulu:EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |

#### Execution payload

Expand All @@ -45,7 +45,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
# Verify timestamp
assert payload.timestamp == compute_timestamp_at_slot(state, state.slot)
# Verify commitments are under limit
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_EIP7594 # [Modified in EIP7594]
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_FULU # [Modified in Fulu:EIP7594]
# Verify the execution payload is valid
versioned_hashes = [kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments]
assert execution_engine.verify_and_notify_new_payload(
Expand All @@ -54,7 +54,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_FULU, # [Modified in Fulu:EIP7594]
)
)
# Cache execution payload header
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EIP-7594 -- Data Availability Sampling Core
# Fulu -- Data Availability Sampling Core

**Notice**: This document is a work-in-progress for researchers and implementers.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EIP-7594 -- Fork Choice
# Fulu -- Fork Choice

## Table of contents
<!-- TOC -->
Expand All @@ -16,7 +16,7 @@

## Introduction

This is the modification of the fork choice accompanying EIP-7594.
This is the modification of the fork choice accompanying Fulu.

## Helpers

Expand Down Expand Up @@ -67,7 +67,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
)
assert store.finalized_checkpoint.root == finalized_checkpoint_block

# [Modified in EIP7594]
# [Modified in Fulu:EIP7594]
assert is_data_available(hash_tree_root(block))

# Check the block is valid and compute the post-state
Expand Down
Loading

0 comments on commit fef87e7

Please sign in to comment.