Skip to content

Commit 3d1038c

Browse files
authored
Merge branch 'unstable' into column-syncer
2 parents 5234990 + c5c5fc9 commit 3d1038c

File tree

14 files changed

+553
-330
lines changed

14 files changed

+553
-330
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,6 @@ jobs:
8989
7z x -y "external/mingw-${{ matrix.target.cpu }}.zip" -oexternal/mingw-${{ matrix.target.cpu }}/
9090
mv external/mingw-${{ matrix.target.cpu }}/**/* ./external/mingw-${{ matrix.target.cpu }}
9191
92-
- name: Restore Nim DLLs dependencies (Windows) from cache
93-
if: runner.os == 'Windows'
94-
id: windows-dlls-cache
95-
uses: actions/cache@v4
96-
with:
97-
path: external/dlls-${{ matrix.target.cpu }}
98-
key: 'dlls-${{ matrix.target.cpu }}'
99-
100-
- name: Install DLLs dependencies (Windows)
101-
if: >
102-
steps.windows-dlls-cache.outputs.cache-hit != 'true' &&
103-
runner.os == 'Windows'
104-
run: |
105-
mkdir -p external
106-
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
107-
7z x -y external/windeps.zip -oexternal/dlls-${{ matrix.target.cpu }}
108-
10992
- name: Path to cached dependencies (Windows)
11093
if: >
11194
runner.os == 'Windows'

AllTests-mainnet.md

Lines changed: 289 additions & 287 deletions
Large diffs are not rendered by default.

ConsensusSpecPreset-mainnet.md

Lines changed: 96 additions & 3 deletions
Large diffs are not rendered by default.

ConsensusSpecPreset-minimal.md

Lines changed: 108 additions & 3 deletions
Large diffs are not rendered by default.

beacon_chain/rpc/rest_config_api.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
302302
Base10.toString(cfg.BALANCE_PER_ADDITIONAL_CUSTODY_GROUP),
303303
# MAX_BLOBS_PER_BLOCK_FULU:
304304
# Base10.toString(cfg.MAX_BLOBS_PER_BLOCK_FULU),
305+
Base10.toString(BALANCE_PER_ADDITIONAL_CUSTODY_GROUP),
305306
# MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:
306307
# Base10.toString(cfg.MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS),
307308

beacon_chain/spec/datatypes/base.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export
7474
tables, results, endians2, json_serialization, sszTypes, beacon_time, crypto,
7575
digest, presets
7676

77-
const SPEC_VERSION* = "1.5.0-beta.5"
77+
const SPEC_VERSION* = "1.6.0-alpha.0"
7878
## Spec version we're aiming to be compatible with, right now
7979

8080
const

beacon_chain/spec/presets.nim

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ const
3838
type
3939
Version* = distinct array[4, byte]
4040
Eth1Address* = web3types.Address
41+
BPOForkInfo* = object
42+
EPOCH*: Epoch
43+
MAX_BLOBS_PER_BLOCK*: uint64
4144

4245
RuntimeConfig* = object
4346
## https://github.com/ethereum/consensus-specs/tree/v1.5.0-beta.2/configs
@@ -136,6 +139,7 @@ type
136139
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP*: uint64
137140
MAX_BLOBS_PER_BLOCK_FULU*: uint64
138141
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS*: uint64
142+
BLOB_SCHEDULE*: seq[BPOForkInfo]
139143

140144
PresetFile* = object
141145
values*: Table[string, string]
@@ -325,6 +329,11 @@ when const_preset == "mainnet":
325329
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000'u64,
326330
MAX_BLOBS_PER_BLOCK_FULU: 12,
327331
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
332+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.0/specs/fulu/das-core.md#get_max_blobs_per_block
333+
# provides sorting rules.
334+
BLOB_SCHEDULE: @[
335+
BPOForkInfo(EPOCH: 364032.Epoch, MAX_BLOBS_PER_BLOCK: 9),
336+
BPOForkInfo(EPOCH: 269568.Epoch, MAX_BLOBS_PER_BLOCK: 6)],
328337
)
329338

330339
elif const_preset == "gnosis":
@@ -660,6 +669,11 @@ elif const_preset == "minimal":
660669
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000'u64,
661670
MAX_BLOBS_PER_BLOCK_FULU: 12,
662671
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096
672+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.0/specs/fulu/das-core.md#get_max_blobs_per_block
673+
# provides sorting rules.
674+
BLOB_SCHEDULE: @[
675+
BPOForkInfo(EPOCH: FAR_FUTURE_EPOCH, MAX_BLOBS_PER_BLOCK: 6),
676+
BPOForkInfo(EPOCH: FAR_FUTURE_EPOCH, MAX_BLOBS_PER_BLOCK: 9)],
663677
)
664678

665679
else:
@@ -887,11 +901,14 @@ proc readRuntimeConfig*(
887901

888902
for name, field in cfg.fieldPairs():
889903
if name in values:
890-
try:
891-
field = parse(typeof(field), values[name])
892-
values.del name
893-
except ValueError:
894-
raise (ref PresetFileError)(msg: "Unable to parse " & name)
904+
when field is seq[BPOForkInfo]:
905+
discard
906+
else:
907+
try:
908+
field = parse(typeof(field), values[name])
909+
values.del name
910+
except ValueError:
911+
raise (ref PresetFileError)(msg: "Unable to parse " & name)
895912

896913
if cfg.PRESET_BASE != const_preset:
897914
raise (ref PresetIncompatibleError)(

beacon_chain/spec/presets/minimal/electra_preset.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# beacon_chain
2-
# Copyright (c) 2024 Status Research & Development GmbH
2+
# Copyright (c) 2024-2025 Status Research & Development GmbH
33
# Licensed and distributed under either of
44
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
55
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@@ -44,10 +44,10 @@ const
4444

4545
# Execution
4646
# ---------------------------------------------------------------
47-
# [customized]
48-
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD* = 4
49-
# [customized] 2**1 (= 2) withdrawal requests
50-
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD* = 2
47+
# 2**13 (= 8,192) deposit requests
48+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD* = 8192
49+
# 2**4 (= 16) withdrawal requests
50+
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD* = 16
5151

5252
# Withdrawals processing
5353
# ---------------------------------------------------------------

beacon_chain/spec/state_transition_block.nim

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import
3232
kzg4844/kzg_abi, kzg4844/kzg
3333

3434
from std/algorithm import fill, sorted
35-
from std/sequtils import count, filterIt, mapIt
35+
from std/sequtils import count, foldl, filterIt, mapIt
3636
from ./datatypes/capella import
3737
BeaconState, MAX_WITHDRAWALS_PER_PAYLOAD, SignedBLSToExecutionChange,
3838
Withdrawal
@@ -687,6 +687,24 @@ type
687687
proposer_slashings*: Gwei
688688
attester_slashings*: Gwei
689689

690+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.0/specs/fulu/das-core.md#get_max_blobs_per_block
691+
func get_max_blobs_per_block(cfg: RuntimeConfig, epoch: Epoch): Opt[uint64] =
692+
## Return the maximum number of blobs that can be included in a block for a
693+
## given epoch.
694+
if not len(cfg.BLOB_SCHEDULE) > 0:
695+
return Opt.none(uint64)
696+
697+
# Spec version of function sorts every time, which should happen only once at
698+
# loading.
699+
for entry in cfg.BLOB_SCHEDULE:
700+
if epoch >= entry.EPOCH:
701+
return Opt.some entry.MAX_BLOBS_PER_BLOCK
702+
703+
# This is effectively a constant per node instance.
704+
Opt.some foldl(
705+
cfg.BLOB_SCHEDULE, min(a, b.MAX_BLOBS_PER_BLOCK),
706+
cfg.BLOB_SCHEDULE[0].MAX_BLOBS_PER_BLOCK)
707+
690708
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.8/specs/phase0/beacon-chain.md#operations
691709
# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.5/specs/capella/beacon-chain.md#modified-process_operations
692710
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.8/specs/electra/beacon-chain.md#modified-process_operations
@@ -1064,7 +1082,7 @@ type SomeFuluBeaconBlockBody =
10641082
fulu.BeaconBlockBody | fulu.SigVerifiedBeaconBlockBody |
10651083
fulu.TrustedBeaconBlockBody
10661084

1067-
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.3/specs/electra/beacon-chain.md#modified-process_execution_payload
1085+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.0/specs/fulu/beacon-chain.md#modified-process_execution_payload
10681086
proc process_execution_payload*(
10691087
cfg: RuntimeConfig, state: var fulu.BeaconState,
10701088
body: SomeFuluBeaconBlockBody,
@@ -1085,8 +1103,11 @@ proc process_execution_payload*(
10851103
if not (payload.timestamp == compute_timestamp_at_slot(state, state.slot)):
10861104
return err("process_execution_payload: invalid timestamp")
10871105

1088-
# [New in Deneb] Verify commitments are under limit
1089-
if not (lenu64(body.blob_kzg_commitments) <= cfg.MAX_BLOBS_PER_BLOCK_FULU):
1106+
# Verify commitments are under limit
1107+
let max_blobs_per_block =
1108+
cfg.get_max_blobs_per_block(get_current_epoch(state)).valueOr:
1109+
return err("process_execution_payload: missing blob schedule")
1110+
if not (lenu64(body.blob_kzg_commitments) <= max_blobs_per_block):
10901111
return err("process_execution_payload: too many KZG commitments")
10911112

10921113
# Verify the execution payload is valid

scripts/mainnet-non-overriden-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,4 @@ SAMPLES_PER_SLOT: 8
173173
CUSTODY_REQUIREMENT: 4
174174
VALIDATOR_CUSTODY_REQUIREMENT: 8
175175
BALANCE_PER_ADDITIONAL_CUSTODY_GROUP: 32000000000
176-
MAX_BLOBS_PER_BLOCK_FULU: 12
177176
MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS: 4096

0 commit comments

Comments
 (0)