Skip to content

Commit 9b2e81e

Browse files
committed
Merge remote-tracking branch 'origin/unstable' into startup-stuff
2 parents 904a0f6 + 4b024bd commit 9b2e81e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+967
-295
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,6 @@ jobs:
246246
nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE "${executable}"
247247
done
248248
249-
- name: Build with custom SECONDS_PER_SLOT
250-
run: |
251-
source env.sh
252-
nim c --passC:-fsyntax-only --noLinking:on -d:chronicles_log_level=TRACE -d:SECONDS_PER_SLOT=1 beacon_chain/nimbus_beacon_node
253-
254249
lint:
255250
name: "Lint"
256251
runs-on: ubuntu-latest

AllTests-mainnet.md

Lines changed: 601 additions & 57 deletions
Large diffs are not rendered by default.

ConsensusSpecPreset-mainnet.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,6 +3798,8 @@ ConsensusSpecPreset-mainnet
37983798
```
37993799
## EF - Gloas - Operations - Execution Payload [Preset: mainnet]
38003800
```diff
3801+
+ [Invalid] EF - Gloas - Operations - Execution Payload - invalid_correct_input__execution_i OK
3802+
+ [Invalid] EF - Gloas - Operations - Execution Payload - invalid_exceed_max_blobs_per_block OK
38013803
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_executio OK
38023804
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_invalid_ OK
38033805
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_be OK
@@ -3809,12 +3811,24 @@ ConsensusSpecPreset-mainnet
38093811
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_pr OK
38103812
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_sl OK
38113813
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_ti OK
3814+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_blob_tx_type OK
3815+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_block_hash OK
3816+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_commitment OK
3817+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_commitments_order OK
3818+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_1_byt OK
3819+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_1_ext OK
3820+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_32_ex OK
3821+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_empty OK
3822+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_no_blobs_but OK
3823+
+ [Valid] EF - Gloas - Operations - Execution Payload - no_commitments_for_transactions OK
3824+
+ [Valid] EF - Gloas - Operations - Execution Payload - no_transactions_with_commitments OK
38123825
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_large_pa OK
38133826
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_max_blob OK
38143827
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_self_bui OK
38153828
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_valid OK
38163829
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_with_blo OK
38173830
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_with_exe OK
3831+
+ [Valid] EF - Gloas - Operations - Execution Payload - zeroed_commitment OK
38183832
```
38193833
## EF - Gloas - Operations - Execution Payload Bid [Preset: mainnet]
38203834
```diff

ConsensusSpecPreset-minimal.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,6 +4052,8 @@ ConsensusSpecPreset-minimal
40524052
```
40534053
## EF - Gloas - Operations - Execution Payload [Preset: minimal]
40544054
```diff
4055+
+ [Invalid] EF - Gloas - Operations - Execution Payload - invalid_correct_input__execution_i OK
4056+
+ [Invalid] EF - Gloas - Operations - Execution Payload - invalid_exceed_max_blobs_per_block OK
40554057
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_executio OK
40564058
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_invalid_ OK
40574059
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_be OK
@@ -4063,12 +4065,24 @@ ConsensusSpecPreset-minimal
40634065
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_pr OK
40644066
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_sl OK
40654067
+ [Invalid] EF - Gloas - Operations - Execution Payload - process_execution_payload_wrong_ti OK
4068+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_blob_tx_type OK
4069+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_block_hash OK
4070+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_commitment OK
4071+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_commitments_order OK
4072+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_1_byt OK
4073+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_1_ext OK
4074+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_32_ex OK
4075+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_length_empty OK
4076+
+ [Valid] EF - Gloas - Operations - Execution Payload - incorrect_transaction_no_blobs_but OK
4077+
+ [Valid] EF - Gloas - Operations - Execution Payload - no_commitments_for_transactions OK
4078+
+ [Valid] EF - Gloas - Operations - Execution Payload - no_transactions_with_commitments OK
40664079
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_large_pa OK
40674080
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_max_blob OK
40684081
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_self_bui OK
40694082
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_valid OK
40704083
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_with_blo OK
40714084
+ [Valid] EF - Gloas - Operations - Execution Payload - process_execution_payload_with_exe OK
4085+
+ [Valid] EF - Gloas - Operations - Execution Payload - zeroed_commitment OK
40724086
```
40734087
## EF - Gloas - Operations - Execution Payload Bid [Preset: minimal]
40744088
```diff
@@ -4430,7 +4444,7 @@ ConsensusSpecPreset-minimal
44304444
+ Light client - Data collection - minimal/capella/light_client/data_collection/pyspec_tests OK
44314445
+ Light client - Data collection - minimal/deneb/light_client/data_collection/pyspec_tests/l OK
44324446
+ Light client - Data collection - minimal/electra/light_client/data_collection/pyspec_tests OK
4433-
+ Light client - Data collection - minimal/fulu/light_client/data_collection/pyspec_tests/li OK
4447+
Light client - Data collection - minimal/fulu/light_client/data_collection/pyspec_tests/li Skip
44344448
```
44354449
## EF - Light client - Single merkle proof [Preset: minimal]
44364450
```diff
@@ -4494,10 +4508,10 @@ ConsensusSpecPreset-minimal
44944508
+ Light client - Sync - minimal/electra/light_client/sync/pyspec_tests/light_client_sync OK
44954509
+ Light client - Sync - minimal/electra/light_client/sync/pyspec_tests/light_client_sync_no_ OK
44964510
+ Light client - Sync - minimal/electra/light_client/sync/pyspec_tests/supply_sync_committee OK
4497-
+ Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/advance_finality_without OK
4498-
+ Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/light_client_sync OK
4499-
+ Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/light_client_sync_no_for OK
4500-
+ Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/supply_sync_committee_fr OK
4511+
Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/advance_finality_without Skip
4512+
Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/light_client_sync Skip
4513+
Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/light_client_sync_no_for Skip
4514+
Light client - Sync - minimal/fulu/light_client/sync/pyspec_tests/supply_sync_committee_fr Skip
45014515
```
45024516
## EF - Light client - Update ranking [Preset: minimal]
45034517
```diff

beacon_chain/beacon_clock.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ proc init*(
4141
timeParams: TimeParams,
4242
genesis_time: uint64): Opt[T] =
4343
let
44-
SECONDS_PER_SLOT = timeParams.SECONDS_PER_SLOT
45-
MIN_GENESIS_TIME = GENESIS_SLOT * SECONDS_PER_SLOT
44+
MIN_GENESIS_TIME = GENESIS_SLOT * timeParams.SLOT_DURATION.seconds.uint64
4645
MAX_GENESIS_TIME =
4746
# Since we'll be converting beacon time differences to nanoseconds,
4847
# the time can't be outrageously far from now
4948
getTime().toUnix().uint64 +
5049
100'u64 * 365'u64 * 24'u64 * 60'u64 * 60'u64
51-
if SECONDS_PER_SLOT notin MIN_SECONDS_PER_SLOT .. MAX_SECONDS_PER_SLOT or
50+
if timeParams.SLOT_DURATION notin MIN_SLOT_DURATION .. MAX_SLOT_DURATION or
5251
genesis_time notin MIN_GENESIS_TIME .. MAX_GENESIS_TIME:
5352
Opt.none(BeaconClock)
5453
else:
5554
let
5655
unixGenesis = fromUnix(genesis_time.int64)
5756
# GENESIS_SLOT offsets slot time, but to simplify calculations, we apply
5857
# that offset to genesis instead of applying it at every time conversion
59-
unixGenesisOffset = times.seconds(int(GENESIS_SLOT * SECONDS_PER_SLOT))
58+
unixGenesisOffset = times.seconds(
59+
(GENESIS_SLOT.int64 * timeParams.SLOT_DURATION).seconds)
6060

6161
Opt.some T(
6262
timeParams: timeParams,

beacon_chain/fork_choice/fork_choice.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func contains*(self: ForkChoiceBackend, block_root: Eth2Digest): bool =
196196
proc update_time*(
197197
self: var ForkChoice, dag: ChainDAGRef, time: BeaconTime): FcResult[void] =
198198
# `time` is the wall time, meaning it changes on every call typically
199-
let step_size = seconds(dag.timeParams.SECONDS_PER_SLOT.int64)
199+
let step_size = dag.timeParams.SLOT_DURATION
200200
if time > self.checkpoints.time:
201201
let
202202
preSlot = self.checkpoints.time.slotOrZero(dag.timeParams)

beacon_chain/gossip_processing/batch_validation.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ proc processBatch(
285285

286286
let
287287
startTick = Moment.now()
288-
slotDuration = batchCrypto.timeParams.SECONDS_PER_SLOT.int64.seconds
288+
slotDuration = batchCrypto.timeParams.SLOT_DURATION
289289

290290
# If the hardware is too slow to keep up or an event caused a temporary
291291
# buildup of signature verification tasks, the batch will be dropped so as to

beacon_chain/gossip_processing/gossip_validation.nim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ proc validateDataColumnSidecar*(
600600
template block_header: untyped = data_column_sidecar.signed_block_header.message
601601
# [REJECT] The sidecar is valid as verified by verify_data_column_sidecar(sidecar)
602602
block:
603-
let v = verify_data_column_sidecar(data_column_sidecar)
603+
let v = verify_data_column_sidecar(dag.cfg, data_column_sidecar)
604604
if v.isErr:
605605
return dag.checkedReject(v.error)
606606

@@ -732,7 +732,7 @@ proc validateDataColumnSidecar*(
732732

733733
# [REJECT] The sidecar is valid as verified by verify_data_column_sidecar
734734
block:
735-
let v = verify_data_column_sidecar(data_column_sidecar)
735+
let v = verify_data_column_sidecar(dag.cfg, data_column_sidecar)
736736
if v.isErr:
737737
return dag.checkedReject(v.error)
738738

@@ -751,6 +751,9 @@ proc validateDataColumnSidecar*(
751751
# [IGNORE] The sidecar's beacon_block_root has been seen via a valid signed
752752
# execution payload header (builder's bid).
753753
#
754+
# _[REJECT]_ The sidecars's `slot` matches the slot of the block with root
755+
# `beacon_block_root`.
756+
#
754757
# [REJECT] The hash of the sidecar's kzg_commitments matches the
755758
# blob_kzg_commitments_root in the corresponding builder's bid for
756759
# sidecar.beacon_block_root.

beacon_chain/networking/eth2_network.nim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,8 +2438,7 @@ proc createEth2Node*(
24382438
historyGossip = 3,
24392439
fanoutTTL = chronos.seconds(60),
24402440
# 2 epochs matching maximum valid attestation lifetime
2441-
seenTTL = chronos.seconds(int(
2442-
cfg.timeParams.SECONDS_PER_SLOT * SLOTS_PER_EPOCH * 2)),
2441+
seenTTL = cfg.timeParams.SLOT_DURATION * (SLOTS_PER_EPOCH * 2).int64,
24432442
gossipThreshold = -4000,
24442443
publishThreshold = -8000,
24452444
graylistThreshold = -16000, # also disconnect threshold

beacon_chain/networking/topic_params.nim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ type
2929
dampeningFactor: float64
3030

3131
func slotsDuration(timeParams: TimeParams, number: int): chronos.Duration =
32-
chronos.seconds(int64(timeParams.SECONDS_PER_SLOT) * number)
32+
timeParams.SLOT_DURATION * number
3333

3434
func epochsDuration(timeParams: TimeParams, number: int): chronos.Duration =
35-
chronos.seconds(int64(timeParams.SECONDS_PER_SLOT * SLOTS_PER_EPOCH) * number)
35+
timeParams.SLOT_DURATION * (SLOTS_PER_EPOCH.int64 * number)
3636

3737
const
3838
GossipD = 8
@@ -90,7 +90,7 @@ const
9090
BlsToExecutionChangeWeight)
9191

9292
func DecayInterval(timeParams: TimeParams): Duration =
93-
chronos.seconds(int64(timeParams.SECONDS_PER_SLOT))
93+
timeParams.SLOT_DURATION
9494

9595
func InvalidMessageDecayPeriod(timeParams: TimeParams): Duration =
9696
timeParams.epochsDuration(50)
@@ -152,7 +152,7 @@ func topicParams(
152152
meshMessageInfo: Opt[MeshMessageInfo] = Opt.none(MeshMessageInfo)
153153
): TopicParams =
154154
let
155-
timeInMeshCap = float64(3600) / float64(timeParams.SECONDS_PER_SLOT)
155+
timeInMeshCap = float64(3600) / float64(timeParams.SLOT_DURATION.seconds)
156156
firstMessageDeliveriesDecay =
157157
timeParams.scoreParameterDecay(firstMessageDecayTime)
158158
firstMessageDeliveriesCap =
@@ -165,7 +165,7 @@ func topicParams(
165165
timeInMeshWeight:
166166
MaxInMeshScore / timeInMeshCap,
167167
timeInMeshQuantum:
168-
chronos.seconds(int64(timeParams.SECONDS_PER_SLOT)),
168+
timeParams.SLOT_DURATION,
169169
timeInMeshCap:
170170
timeInMeshCap,
171171
firstMessageDeliveriesDecay:
@@ -228,7 +228,7 @@ func topicParams(
228228
timeInMeshWeight:
229229
MaxInMeshScore / timeInMeshCap,
230230
timeInMeshQuantum:
231-
chronos.seconds(int64(timeParams.SECONDS_PER_SLOT)),
231+
timeParams.SLOT_DURATION,
232232
timeInMeshCap:
233233
timeInMeshCap,
234234
firstMessageDeliveriesDecay:

0 commit comments

Comments
 (0)