mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-27 14:58:46 +00:00
rename EIP4844
> Deneb
for light client (#4713)
* rename `EIP4844` > `Deneb` for light client * regenerate test logs
This commit is contained in:
parent
8fd3723e82
commit
57b2151f95
@ -2034,7 +2034,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
|
|||||||
+ Testing Withdrawal OK
|
+ Testing Withdrawal OK
|
||||||
```
|
```
|
||||||
OK: 49/49 Fail: 0/49 Skip: 0/49
|
OK: 49/49 Fail: 0/49 Skip: 0/49
|
||||||
## EF - EIP4844 - Unittests - Light client - Sync protocol [Preset: mainnet]
|
## EF - Deneb - Unittests - Light client - Sync protocol [Preset: mainnet]
|
||||||
```diff
|
```diff
|
||||||
+ process_light_client_update_finality_updated OK
|
+ process_light_client_update_finality_updated OK
|
||||||
+ process_light_client_update_timeout OK
|
+ process_light_client_update_timeout OK
|
||||||
|
@ -2210,7 +2210,7 @@ OK: 5/5 Fail: 0/5 Skip: 0/5
|
|||||||
+ Testing Withdrawal OK
|
+ Testing Withdrawal OK
|
||||||
```
|
```
|
||||||
OK: 49/49 Fail: 0/49 Skip: 0/49
|
OK: 49/49 Fail: 0/49 Skip: 0/49
|
||||||
## EF - EIP4844 - Unittests - Light client - Sync protocol [Preset: minimal]
|
## EF - Deneb - Unittests - Light client - Sync protocol [Preset: minimal]
|
||||||
```diff
|
```diff
|
||||||
+ process_light_client_update_finality_updated OK
|
+ process_light_client_update_finality_updated OK
|
||||||
+ process_light_client_update_timeout OK
|
+ process_light_client_update_timeout OK
|
||||||
|
@ -531,10 +531,9 @@ proc new*(T: type BeaconChainDB,
|
|||||||
"lc_capella_headers"
|
"lc_capella_headers"
|
||||||
else:
|
else:
|
||||||
"",
|
"",
|
||||||
eip4844Headers:
|
denebHeaders:
|
||||||
if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
||||||
# TODO: We should probably rename this to match the official fork name
|
"lc_deneb_headers"
|
||||||
"lc_eip4844_headers"
|
|
||||||
else:
|
else:
|
||||||
"",
|
"",
|
||||||
altairCurrentBranches: "lc_altair_current_branches",
|
altairCurrentBranches: "lc_altair_current_branches",
|
||||||
@ -542,7 +541,7 @@ proc new*(T: type BeaconChainDB,
|
|||||||
legacyAltairBestUpdates: "lc_altair_best_updates",
|
legacyAltairBestUpdates: "lc_altair_best_updates",
|
||||||
bestUpdates: "lc_best_updates",
|
bestUpdates: "lc_best_updates",
|
||||||
sealedPeriods: "lc_sealed_periods")).expectDb()
|
sealedPeriods: "lc_sealed_periods")).expectDb()
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
|
|
||||||
var blobs : KvStoreRef
|
var blobs : KvStoreRef
|
||||||
if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
|
||||||
|
@ -27,14 +27,14 @@ logScope: topics = "lcdata"
|
|||||||
# Mainnet data size (all columns):
|
# Mainnet data size (all columns):
|
||||||
# - Altair: ~38 KB per `SyncCommitteePeriod` (~1.0 MB per month)
|
# - Altair: ~38 KB per `SyncCommitteePeriod` (~1.0 MB per month)
|
||||||
# - Capella: ~222 KB per `SyncCommitteePeriod` (~6.1 MB per month)
|
# - Capella: ~222 KB per `SyncCommitteePeriod` (~6.1 MB per month)
|
||||||
# - EIP4844: ~230 KB per `SyncCommitteePeriod` (~6.3 MB per month)
|
# - Deneb: ~230 KB per `SyncCommitteePeriod` (~6.3 MB per month)
|
||||||
#
|
#
|
||||||
# `lc_altair_current_branches` holds merkle proofs needed to
|
# `lc_altair_current_branches` holds merkle proofs needed to
|
||||||
# construct `LightClientBootstrap` objects.
|
# construct `LightClientBootstrap` objects.
|
||||||
# SSZ because this data does not compress well, and because this data
|
# SSZ because this data does not compress well, and because this data
|
||||||
# needs to be bundled together with other data to fulfill requests.
|
# needs to be bundled together with other data to fulfill requests.
|
||||||
# Mainnet data size (all columns):
|
# Mainnet data size (all columns):
|
||||||
# - Altair ... EIP4844: ~42 KB per `SyncCommitteePeriod` (~1.1 MB per month)
|
# - Altair ... Deneb: ~42 KB per `SyncCommitteePeriod` (~1.1 MB per month)
|
||||||
#
|
#
|
||||||
# `lc_altair_sync_committees` contains a copy of finalized sync committees.
|
# `lc_altair_sync_committees` contains a copy of finalized sync committees.
|
||||||
# They are initially populated from the main DAG (usually a fast state access).
|
# They are initially populated from the main DAG (usually a fast state access).
|
||||||
@ -42,7 +42,7 @@ logScope: topics = "lcdata"
|
|||||||
# SSZ because this data does not compress well, and because this data
|
# SSZ because this data does not compress well, and because this data
|
||||||
# needs to be bundled together with other data to fulfill requests.
|
# needs to be bundled together with other data to fulfill requests.
|
||||||
# Mainnet data size (all columns):
|
# Mainnet data size (all columns):
|
||||||
# - Altair ... EIP4844: ~32 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
# - Altair ... Deneb: ~32 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
||||||
#
|
#
|
||||||
# `lc_best_updates` holds full `LightClientUpdate` objects in SSZ form.
|
# `lc_best_updates` holds full `LightClientUpdate` objects in SSZ form.
|
||||||
# These objects are frequently queried in bulk, but there is only one per
|
# These objects are frequently queried in bulk, but there is only one per
|
||||||
@ -58,7 +58,7 @@ logScope: topics = "lcdata"
|
|||||||
# Mainnet data size (all columns):
|
# Mainnet data size (all columns):
|
||||||
# - Altair: ~33 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
# - Altair: ~33 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
||||||
# - Capella: ~34 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
# - Capella: ~34 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
||||||
# - EIP4844: ~34 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
# - Deneb: ~34 KB per `SyncCommitteePeriod` (~0.9 MB per month)
|
||||||
#
|
#
|
||||||
# `lc_sealed_periods` contains the sync committee periods for which
|
# `lc_sealed_periods` contains the sync committee periods for which
|
||||||
# full light client data was imported. Data for these periods may no longer
|
# full light client data was imported. Data for these periods may no longer
|
||||||
@ -675,7 +675,7 @@ func keepPeriodsFrom*(
|
|||||||
type LightClientDataDBNames* = object
|
type LightClientDataDBNames* = object
|
||||||
altairHeaders*: string
|
altairHeaders*: string
|
||||||
capellaHeaders*: string
|
capellaHeaders*: string
|
||||||
eip4844Headers*: string
|
denebHeaders*: string
|
||||||
altairCurrentBranches*: string
|
altairCurrentBranches*: string
|
||||||
altairSyncCommittees*: string
|
altairSyncCommittees*: string
|
||||||
legacyAltairBestUpdates*: string
|
legacyAltairBestUpdates*: string
|
||||||
@ -685,7 +685,7 @@ type LightClientDataDBNames* = object
|
|||||||
proc initLightClientDataDB*(
|
proc initLightClientDataDB*(
|
||||||
backend: SqStoreRef,
|
backend: SqStoreRef,
|
||||||
names: LightClientDataDBNames): KvResult[LightClientDataDB] =
|
names: LightClientDataDBNames): KvResult[LightClientDataDB] =
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
let
|
let
|
||||||
headers = [
|
headers = [
|
||||||
# LightClientDataFork.None
|
# LightClientDataFork.None
|
||||||
@ -696,9 +696,9 @@ proc initLightClientDataDB*(
|
|||||||
# LightClientDataFork.Capella
|
# LightClientDataFork.Capella
|
||||||
? backend.initHeadersStore(
|
? backend.initHeadersStore(
|
||||||
names.capellaHeaders, "capella.LightClientHeader"),
|
names.capellaHeaders, "capella.LightClientHeader"),
|
||||||
# LightClientDataFork.EIP4844
|
# LightClientDataFork.Deneb
|
||||||
? backend.initHeadersStore(
|
? backend.initHeadersStore(
|
||||||
names.eip4844Headers, "eip4844.LightClientHeader")
|
names.denebHeaders, "deneb.LightClientHeader")
|
||||||
]
|
]
|
||||||
currentBranches =
|
currentBranches =
|
||||||
? backend.initCurrentBranchesStore(names.altairCurrentBranches)
|
? backend.initCurrentBranchesStore(names.altairCurrentBranches)
|
||||||
|
@ -347,7 +347,7 @@ proc installMessageValidators*(
|
|||||||
withLcDataFork(lcDataForkAtStateFork(stateFork)):
|
withLcDataFork(lcDataForkAtStateFork(stateFork)):
|
||||||
when lcDataFork > LightClientDataFork.None:
|
when lcDataFork > LightClientDataFork.None:
|
||||||
let
|
let
|
||||||
contextFork = stateFork # Copy to avoid capturing `EIP4844` (Nim 1.6)
|
contextFork = stateFork # Copy to avoid capturing `Deneb` (Nim 1.6)
|
||||||
digest = forkDigests[].atStateFork(contextFork)
|
digest = forkDigests[].atStateFork(contextFork)
|
||||||
|
|
||||||
lightClient.network.addValidator(
|
lightClient.network.addValidator(
|
||||||
|
@ -111,7 +111,6 @@ type
|
|||||||
kzgs*: KZGCommitments
|
kzgs*: KZGCommitments
|
||||||
blobs*: Blobs
|
blobs*: Blobs
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#executionpayloadheader
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#executionpayloadheader
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#executionpayloadheader
|
||||||
ExecutionPayloadHeader* = object
|
ExecutionPayloadHeader* = object
|
||||||
parent_hash*: Eth2Digest
|
parent_hash*: Eth2Digest
|
||||||
@ -552,7 +551,7 @@ func shortLog*(v: ExecutionPayload): auto =
|
|||||||
num_withdrawals: len(v.withdrawals)
|
num_withdrawals: len(v.withdrawals)
|
||||||
)
|
)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/sync-protocol.md#get_lc_execution_root
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/sync-protocol.md#modified-get_lc_execution_root
|
||||||
func get_lc_execution_root*(
|
func get_lc_execution_root*(
|
||||||
header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest =
|
header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest =
|
||||||
let epoch = header.beacon.slot.epoch
|
let epoch = header.beacon.slot.epoch
|
||||||
@ -581,7 +580,7 @@ func get_lc_execution_root*(
|
|||||||
|
|
||||||
ZERO_HASH
|
ZERO_HASH
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/sync-protocol.md#is_valid_light_client_header
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/sync-protocol.md#modified-is_valid_light_client_header
|
||||||
func is_valid_light_client_header*(
|
func is_valid_light_client_header*(
|
||||||
header: LightClientHeader, cfg: RuntimeConfig): bool =
|
header: LightClientHeader, cfg: RuntimeConfig): bool =
|
||||||
let epoch = header.beacon.slot.epoch
|
let epoch = header.beacon.slot.epoch
|
||||||
@ -602,8 +601,8 @@ func is_valid_light_client_header*(
|
|||||||
get_subtree_index(EXECUTION_PAYLOAD_INDEX),
|
get_subtree_index(EXECUTION_PAYLOAD_INDEX),
|
||||||
header.beacon.body_root)
|
header.beacon.body_root)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_header_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-light-client-data
|
||||||
func upgrade_lc_header_to_eip4844*(
|
func upgrade_lc_header_to_deneb*(
|
||||||
pre: capella.LightClientHeader): LightClientHeader =
|
pre: capella.LightClientHeader): LightClientHeader =
|
||||||
LightClientHeader(
|
LightClientHeader(
|
||||||
beacon: pre.beacon,
|
beacon: pre.beacon,
|
||||||
@ -625,41 +624,41 @@ func upgrade_lc_header_to_eip4844*(
|
|||||||
withdrawals_root: pre.execution.withdrawals_root),
|
withdrawals_root: pre.execution.withdrawals_root),
|
||||||
execution_branch: pre.execution_branch)
|
execution_branch: pre.execution_branch)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_bootstrap_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-light-client-data
|
||||||
func upgrade_lc_bootstrap_to_eip4844*(
|
func upgrade_lc_bootstrap_to_deneb*(
|
||||||
pre: capella.LightClientBootstrap): LightClientBootstrap =
|
pre: capella.LightClientBootstrap): LightClientBootstrap =
|
||||||
LightClientBootstrap(
|
LightClientBootstrap(
|
||||||
header: upgrade_lc_header_to_eip4844(pre.header),
|
header: upgrade_lc_header_to_deneb(pre.header),
|
||||||
current_sync_committee: pre.current_sync_committee,
|
current_sync_committee: pre.current_sync_committee,
|
||||||
current_sync_committee_branch: pre.current_sync_committee_branch)
|
current_sync_committee_branch: pre.current_sync_committee_branch)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_update_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-light-client-data
|
||||||
func upgrade_lc_update_to_eip4844*(
|
func upgrade_lc_update_to_deneb*(
|
||||||
pre: capella.LightClientUpdate): LightClientUpdate =
|
pre: capella.LightClientUpdate): LightClientUpdate =
|
||||||
LightClientUpdate(
|
LightClientUpdate(
|
||||||
attested_header: upgrade_lc_header_to_eip4844(pre.attested_header),
|
attested_header: upgrade_lc_header_to_deneb(pre.attested_header),
|
||||||
next_sync_committee: pre.next_sync_committee,
|
next_sync_committee: pre.next_sync_committee,
|
||||||
next_sync_committee_branch: pre.next_sync_committee_branch,
|
next_sync_committee_branch: pre.next_sync_committee_branch,
|
||||||
finalized_header: upgrade_lc_header_to_eip4844(pre.finalized_header),
|
finalized_header: upgrade_lc_header_to_deneb(pre.finalized_header),
|
||||||
finality_branch: pre.finality_branch,
|
finality_branch: pre.finality_branch,
|
||||||
sync_aggregate: pre.sync_aggregate,
|
sync_aggregate: pre.sync_aggregate,
|
||||||
signature_slot: pre.signature_slot)
|
signature_slot: pre.signature_slot)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_finality_update_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-light-client-data
|
||||||
func upgrade_lc_finality_update_to_eip4844*(
|
func upgrade_lc_finality_update_to_deneb*(
|
||||||
pre: capella.LightClientFinalityUpdate): LightClientFinalityUpdate =
|
pre: capella.LightClientFinalityUpdate): LightClientFinalityUpdate =
|
||||||
LightClientFinalityUpdate(
|
LightClientFinalityUpdate(
|
||||||
attested_header: upgrade_lc_header_to_eip4844(pre.attested_header),
|
attested_header: upgrade_lc_header_to_deneb(pre.attested_header),
|
||||||
finalized_header: upgrade_lc_header_to_eip4844(pre.finalized_header),
|
finalized_header: upgrade_lc_header_to_deneb(pre.finalized_header),
|
||||||
finality_branch: pre.finality_branch,
|
finality_branch: pre.finality_branch,
|
||||||
sync_aggregate: pre.sync_aggregate,
|
sync_aggregate: pre.sync_aggregate,
|
||||||
signature_slot: pre.signature_slot)
|
signature_slot: pre.signature_slot)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_optimistic_update_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-light-client-data
|
||||||
func upgrade_lc_optimistic_update_to_eip4844*(
|
func upgrade_lc_optimistic_update_to_deneb*(
|
||||||
pre: capella.LightClientOptimisticUpdate): LightClientOptimisticUpdate =
|
pre: capella.LightClientOptimisticUpdate): LightClientOptimisticUpdate =
|
||||||
LightClientOptimisticUpdate(
|
LightClientOptimisticUpdate(
|
||||||
attested_header: upgrade_lc_header_to_eip4844(pre.attested_header),
|
attested_header: upgrade_lc_header_to_deneb(pre.attested_header),
|
||||||
sync_aggregate: pre.sync_aggregate,
|
sync_aggregate: pre.sync_aggregate,
|
||||||
signature_slot: pre.signature_slot)
|
signature_slot: pre.signature_slot)
|
||||||
|
|
||||||
@ -706,20 +705,20 @@ chronicles.formatIt LightClientUpdate: shortLog(it)
|
|||||||
chronicles.formatIt LightClientFinalityUpdate: shortLog(it)
|
chronicles.formatIt LightClientFinalityUpdate: shortLog(it)
|
||||||
chronicles.formatIt LightClientOptimisticUpdate: shortLog(it)
|
chronicles.formatIt LightClientOptimisticUpdate: shortLog(it)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/fork.md#upgrade_lc_store_to_eip4844
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/fork.md#upgrading-the-store
|
||||||
func upgrade_lc_store_to_eip4844*(
|
func upgrade_lc_store_to_deneb*(
|
||||||
pre: capella.LightClientStore): LightClientStore =
|
pre: capella.LightClientStore): LightClientStore =
|
||||||
let best_valid_update =
|
let best_valid_update =
|
||||||
if pre.best_valid_update.isNone:
|
if pre.best_valid_update.isNone:
|
||||||
Opt.none(LightClientUpdate)
|
Opt.none(LightClientUpdate)
|
||||||
else:
|
else:
|
||||||
Opt.some upgrade_lc_update_to_eip4844(pre.best_valid_update.get)
|
Opt.some upgrade_lc_update_to_deneb(pre.best_valid_update.get)
|
||||||
LightClientStore(
|
LightClientStore(
|
||||||
finalized_header: upgrade_lc_header_to_eip4844(pre.finalized_header),
|
finalized_header: upgrade_lc_header_to_deneb(pre.finalized_header),
|
||||||
current_sync_committee: pre.current_sync_committee,
|
current_sync_committee: pre.current_sync_committee,
|
||||||
next_sync_committee: pre.next_sync_committee,
|
next_sync_committee: pre.next_sync_committee,
|
||||||
best_valid_update: best_valid_update,
|
best_valid_update: best_valid_update,
|
||||||
optimistic_header: upgrade_lc_header_to_eip4844(pre.optimistic_header),
|
optimistic_header: upgrade_lc_header_to_deneb(pre.optimistic_header),
|
||||||
previous_max_active_participants: pre.previous_max_active_participants,
|
previous_max_active_participants: pre.previous_max_active_participants,
|
||||||
current_max_active_participants: pre.current_max_active_participants)
|
current_max_active_participants: pre.current_max_active_participants)
|
||||||
|
|
||||||
|
@ -904,9 +904,9 @@ func forkVersion*(cfg: RuntimeConfig, consensusFork: ConsensusFork): Version =
|
|||||||
of ConsensusFork.Deneb: cfg.DENEB_FORK_VERSION
|
of ConsensusFork.Deneb: cfg.DENEB_FORK_VERSION
|
||||||
|
|
||||||
func lcDataForkAtStateFork*(stateFork: ConsensusFork): LightClientDataFork =
|
func lcDataForkAtStateFork*(stateFork: ConsensusFork): LightClientDataFork =
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
if stateFork >= ConsensusFork.Deneb:
|
if stateFork >= ConsensusFork.Deneb:
|
||||||
LightClientDataFork.EIP4844
|
LightClientDataFork.Deneb
|
||||||
elif stateFork >= ConsensusFork.Capella:
|
elif stateFork >= ConsensusFork.Capella:
|
||||||
LightClientDataFork.Capella
|
LightClientDataFork.Capella
|
||||||
elif stateFork >= ConsensusFork.Altair:
|
elif stateFork >= ConsensusFork.Altair:
|
||||||
|
@ -16,7 +16,7 @@ type
|
|||||||
None = 0, # only use non-0 in DB to detect accidentally uninitialized data
|
None = 0, # only use non-0 in DB to detect accidentally uninitialized data
|
||||||
Altair = 1,
|
Altair = 1,
|
||||||
Capella = 2,
|
Capella = 2,
|
||||||
EIP4844 = 3
|
Deneb = 3
|
||||||
|
|
||||||
ForkyLightClientHeader* =
|
ForkyLightClientHeader* =
|
||||||
altair.LightClientHeader |
|
altair.LightClientHeader |
|
||||||
@ -72,8 +72,8 @@ type
|
|||||||
altairData*: altair.LightClientHeader
|
altairData*: altair.LightClientHeader
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientHeader
|
capellaData*: capella.LightClientHeader
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientHeader
|
denebData*: deneb.LightClientHeader
|
||||||
|
|
||||||
ForkedLightClientBootstrap* = object
|
ForkedLightClientBootstrap* = object
|
||||||
case kind*: LightClientDataFork
|
case kind*: LightClientDataFork
|
||||||
@ -83,8 +83,8 @@ type
|
|||||||
altairData*: altair.LightClientBootstrap
|
altairData*: altair.LightClientBootstrap
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientBootstrap
|
capellaData*: capella.LightClientBootstrap
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientBootstrap
|
denebData*: deneb.LightClientBootstrap
|
||||||
|
|
||||||
ForkedLightClientUpdate* = object
|
ForkedLightClientUpdate* = object
|
||||||
case kind*: LightClientDataFork
|
case kind*: LightClientDataFork
|
||||||
@ -94,8 +94,8 @@ type
|
|||||||
altairData*: altair.LightClientUpdate
|
altairData*: altair.LightClientUpdate
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientUpdate
|
capellaData*: capella.LightClientUpdate
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientUpdate
|
denebData*: deneb.LightClientUpdate
|
||||||
|
|
||||||
ForkedLightClientFinalityUpdate* = object
|
ForkedLightClientFinalityUpdate* = object
|
||||||
case kind*: LightClientDataFork
|
case kind*: LightClientDataFork
|
||||||
@ -105,8 +105,8 @@ type
|
|||||||
altairData*: altair.LightClientFinalityUpdate
|
altairData*: altair.LightClientFinalityUpdate
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientFinalityUpdate
|
capellaData*: capella.LightClientFinalityUpdate
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientFinalityUpdate
|
denebData*: deneb.LightClientFinalityUpdate
|
||||||
|
|
||||||
ForkedLightClientOptimisticUpdate* = object
|
ForkedLightClientOptimisticUpdate* = object
|
||||||
case kind*: LightClientDataFork
|
case kind*: LightClientDataFork
|
||||||
@ -116,8 +116,8 @@ type
|
|||||||
altairData*: altair.LightClientOptimisticUpdate
|
altairData*: altair.LightClientOptimisticUpdate
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientOptimisticUpdate
|
capellaData*: capella.LightClientOptimisticUpdate
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientOptimisticUpdate
|
denebData*: deneb.LightClientOptimisticUpdate
|
||||||
|
|
||||||
SomeForkedLightClientUpdateWithSyncCommittee* =
|
SomeForkedLightClientUpdateWithSyncCommittee* =
|
||||||
ForkedLightClientUpdate
|
ForkedLightClientUpdate
|
||||||
@ -143,14 +143,14 @@ type
|
|||||||
altairData*: altair.LightClientStore
|
altairData*: altair.LightClientStore
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
capellaData*: capella.LightClientStore
|
capellaData*: capella.LightClientStore
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
eip4844Data*: deneb.LightClientStore
|
denebData*: deneb.LightClientStore
|
||||||
|
|
||||||
func lcDataForkAtEpoch*(
|
func lcDataForkAtEpoch*(
|
||||||
cfg: RuntimeConfig, epoch: Epoch): LightClientDataFork =
|
cfg: RuntimeConfig, epoch: Epoch): LightClientDataFork =
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
if epoch >= cfg.DENEB_FORK_EPOCH:
|
if epoch >= cfg.DENEB_FORK_EPOCH:
|
||||||
LightClientDataFork.EIP4844
|
LightClientDataFork.Deneb
|
||||||
elif epoch >= cfg.CAPELLA_FORK_EPOCH:
|
elif epoch >= cfg.CAPELLA_FORK_EPOCH:
|
||||||
LightClientDataFork.Capella
|
LightClientDataFork.Capella
|
||||||
elif epoch >= cfg.ALTAIR_FORK_EPOCH:
|
elif epoch >= cfg.ALTAIR_FORK_EPOCH:
|
||||||
@ -186,10 +186,10 @@ template kind*(
|
|||||||
deneb.LightClientFinalityUpdate |
|
deneb.LightClientFinalityUpdate |
|
||||||
deneb.LightClientOptimisticUpdate |
|
deneb.LightClientOptimisticUpdate |
|
||||||
deneb.LightClientStore]): LightClientDataFork =
|
deneb.LightClientStore]): LightClientDataFork =
|
||||||
LightClientDataFork.EIP4844
|
LightClientDataFork.Deneb
|
||||||
|
|
||||||
template LightClientHeader*(kind: static LightClientDataFork): auto =
|
template LightClientHeader*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientHeader]
|
typedesc[deneb.LightClientHeader]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientHeader]
|
typedesc[capella.LightClientHeader]
|
||||||
@ -199,7 +199,7 @@ template LightClientHeader*(kind: static LightClientDataFork): auto =
|
|||||||
static: raiseAssert "Unreachable"
|
static: raiseAssert "Unreachable"
|
||||||
|
|
||||||
template LightClientBootstrap*(kind: static LightClientDataFork): auto =
|
template LightClientBootstrap*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientBootstrap]
|
typedesc[deneb.LightClientBootstrap]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientBootstrap]
|
typedesc[capella.LightClientBootstrap]
|
||||||
@ -209,7 +209,7 @@ template LightClientBootstrap*(kind: static LightClientDataFork): auto =
|
|||||||
static: raiseAssert "Unreachable"
|
static: raiseAssert "Unreachable"
|
||||||
|
|
||||||
template LightClientUpdate*(kind: static LightClientDataFork): auto =
|
template LightClientUpdate*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientUpdate]
|
typedesc[deneb.LightClientUpdate]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientUpdate]
|
typedesc[capella.LightClientUpdate]
|
||||||
@ -219,7 +219,7 @@ template LightClientUpdate*(kind: static LightClientDataFork): auto =
|
|||||||
static: raiseAssert "Unreachable"
|
static: raiseAssert "Unreachable"
|
||||||
|
|
||||||
template LightClientFinalityUpdate*(kind: static LightClientDataFork): auto =
|
template LightClientFinalityUpdate*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientFinalityUpdate]
|
typedesc[deneb.LightClientFinalityUpdate]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientFinalityUpdate]
|
typedesc[capella.LightClientFinalityUpdate]
|
||||||
@ -229,7 +229,7 @@ template LightClientFinalityUpdate*(kind: static LightClientDataFork): auto =
|
|||||||
static: raiseAssert "Unreachable"
|
static: raiseAssert "Unreachable"
|
||||||
|
|
||||||
template LightClientOptimisticUpdate*(kind: static LightClientDataFork): auto =
|
template LightClientOptimisticUpdate*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientOptimisticUpdate]
|
typedesc[deneb.LightClientOptimisticUpdate]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientOptimisticUpdate]
|
typedesc[capella.LightClientOptimisticUpdate]
|
||||||
@ -239,7 +239,7 @@ template LightClientOptimisticUpdate*(kind: static LightClientDataFork): auto =
|
|||||||
static: raiseAssert "Unreachable"
|
static: raiseAssert "Unreachable"
|
||||||
|
|
||||||
template LightClientStore*(kind: static LightClientDataFork): auto =
|
template LightClientStore*(kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
typedesc[deneb.LightClientStore]
|
typedesc[deneb.LightClientStore]
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
typedesc[capella.LightClientStore]
|
typedesc[capella.LightClientStore]
|
||||||
@ -298,9 +298,9 @@ template Forked*(x: typedesc[ForkyLightClientStore]): auto =
|
|||||||
|
|
||||||
template withAll*(
|
template withAll*(
|
||||||
x: typedesc[LightClientDataFork], body: untyped): untyped =
|
x: typedesc[LightClientDataFork], body: untyped): untyped =
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
block:
|
block:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
body
|
body
|
||||||
block:
|
block:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -315,8 +315,8 @@ template withAll*(
|
|||||||
template withLcDataFork*(
|
template withLcDataFork*(
|
||||||
x: LightClientDataFork, body: untyped): untyped =
|
x: LightClientDataFork, body: untyped): untyped =
|
||||||
case x
|
case x
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -331,9 +331,9 @@ template withLcDataFork*(
|
|||||||
template withForkyHeader*(
|
template withForkyHeader*(
|
||||||
x: ForkedLightClientHeader, body: untyped): untyped =
|
x: ForkedLightClientHeader, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyHeader: untyped {.inject, used.} = x.eip4844Data
|
template forkyHeader: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -350,9 +350,9 @@ template withForkyHeader*(
|
|||||||
template withForkyBootstrap*(
|
template withForkyBootstrap*(
|
||||||
x: ForkedLightClientBootstrap, body: untyped): untyped =
|
x: ForkedLightClientBootstrap, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyBootstrap: untyped {.inject, used.} = x.eip4844Data
|
template forkyBootstrap: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -369,9 +369,9 @@ template withForkyBootstrap*(
|
|||||||
template withForkyUpdate*(
|
template withForkyUpdate*(
|
||||||
x: ForkedLightClientUpdate, body: untyped): untyped =
|
x: ForkedLightClientUpdate, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyUpdate: untyped {.inject, used.} = x.eip4844Data
|
template forkyUpdate: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -388,9 +388,9 @@ template withForkyUpdate*(
|
|||||||
template withForkyFinalityUpdate*(
|
template withForkyFinalityUpdate*(
|
||||||
x: ForkedLightClientFinalityUpdate, body: untyped): untyped =
|
x: ForkedLightClientFinalityUpdate, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyFinalityUpdate: untyped {.inject, used.} = x.eip4844Data
|
template forkyFinalityUpdate: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -407,9 +407,9 @@ template withForkyFinalityUpdate*(
|
|||||||
template withForkyOptimisticUpdate*(
|
template withForkyOptimisticUpdate*(
|
||||||
x: ForkedLightClientOptimisticUpdate, body: untyped): untyped =
|
x: ForkedLightClientOptimisticUpdate, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyOptimisticUpdate: untyped {.inject, used.} = x.eip4844Data
|
template forkyOptimisticUpdate: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -426,9 +426,9 @@ template withForkyOptimisticUpdate*(
|
|||||||
template withForkyObject*(
|
template withForkyObject*(
|
||||||
x: SomeForkedLightClientObject, body: untyped): untyped =
|
x: SomeForkedLightClientObject, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyObject: untyped {.inject, used.} = x.eip4844Data
|
template forkyObject: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -445,9 +445,9 @@ template withForkyObject*(
|
|||||||
template withForkyStore*(
|
template withForkyStore*(
|
||||||
x: ForkedLightClientStore, body: untyped): untyped =
|
x: ForkedLightClientStore, body: untyped): untyped =
|
||||||
case x.kind
|
case x.kind
|
||||||
of LightClientDataFork.EIP4844:
|
of LightClientDataFork.Deneb:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.EIP4844
|
const lcDataFork {.inject, used.} = LightClientDataFork.Deneb
|
||||||
template forkyStore: untyped {.inject, used.} = x.eip4844Data
|
template forkyStore: untyped {.inject, used.} = x.denebData
|
||||||
body
|
body
|
||||||
of LightClientDataFork.Capella:
|
of LightClientDataFork.Capella:
|
||||||
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
const lcDataFork {.inject, used.} = LightClientDataFork.Capella
|
||||||
@ -587,8 +587,8 @@ template forky*(
|
|||||||
SomeForkedLightClientObject |
|
SomeForkedLightClientObject |
|
||||||
ForkedLightClientStore,
|
ForkedLightClientStore,
|
||||||
kind: static LightClientDataFork): untyped =
|
kind: static LightClientDataFork): untyped =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
x.eip4844Data
|
x.denebData
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
x.capellaData
|
x.capellaData
|
||||||
elif kind == LightClientDataFork.Altair:
|
elif kind == LightClientDataFork.Altair:
|
||||||
@ -620,15 +620,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_header_to_capella(
|
capellaData: upgrade_lc_header_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientHeader(
|
x = ForkedLightClientHeader(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_header_to_eip4844(
|
denebData: upgrade_lc_header_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migrateToDataFork*(
|
func migrateToDataFork*(
|
||||||
@ -655,15 +655,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_bootstrap_to_capella(
|
capellaData: upgrade_lc_bootstrap_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientBootstrap(
|
x = ForkedLightClientBootstrap(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_bootstrap_to_eip4844(
|
denebData: upgrade_lc_bootstrap_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migrateToDataFork*(
|
func migrateToDataFork*(
|
||||||
@ -690,15 +690,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_update_to_capella(
|
capellaData: upgrade_lc_update_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientUpdate(
|
x = ForkedLightClientUpdate(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_update_to_eip4844(
|
denebData: upgrade_lc_update_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migrateToDataFork*(
|
func migrateToDataFork*(
|
||||||
@ -725,15 +725,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_finality_update_to_capella(
|
capellaData: upgrade_lc_finality_update_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientFinalityUpdate(
|
x = ForkedLightClientFinalityUpdate(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_finality_update_to_eip4844(
|
denebData: upgrade_lc_finality_update_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migrateToDataFork*(
|
func migrateToDataFork*(
|
||||||
@ -760,15 +760,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_optimistic_update_to_capella(
|
capellaData: upgrade_lc_optimistic_update_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientOptimisticUpdate(
|
x = ForkedLightClientOptimisticUpdate(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_optimistic_update_to_eip4844(
|
denebData: upgrade_lc_optimistic_update_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migrateToDataFork*(
|
func migrateToDataFork*(
|
||||||
@ -795,15 +795,15 @@ func migrateToDataFork*(
|
|||||||
capellaData: upgrade_lc_store_to_capella(
|
capellaData: upgrade_lc_store_to_capella(
|
||||||
x.forky(LightClientDataFork.Altair)))
|
x.forky(LightClientDataFork.Altair)))
|
||||||
|
|
||||||
# Upgrade to EIP4844
|
# Upgrade to Deneb
|
||||||
when newKind >= LightClientDataFork.EIP4844:
|
when newKind >= LightClientDataFork.Deneb:
|
||||||
if x.kind == LightClientDataFork.Capella:
|
if x.kind == LightClientDataFork.Capella:
|
||||||
x = ForkedLightClientStore(
|
x = ForkedLightClientStore(
|
||||||
kind: LightClientDataFork.EIP4844,
|
kind: LightClientDataFork.Deneb,
|
||||||
eip4844Data: upgrade_lc_store_to_eip4844(
|
denebData: upgrade_lc_store_to_deneb(
|
||||||
x.forky(LightClientDataFork.Capella)))
|
x.forky(LightClientDataFork.Capella)))
|
||||||
|
|
||||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
static: doAssert LightClientDataFork.high == LightClientDataFork.Deneb
|
||||||
doAssert x.kind == newKind
|
doAssert x.kind == newKind
|
||||||
|
|
||||||
func migratingToDataFork*[
|
func migratingToDataFork*[
|
||||||
@ -868,8 +868,8 @@ func toCapellaLightClientHeader(
|
|||||||
execution_branch: blck.message.body.build_proof(
|
execution_branch: blck.message.body.build_proof(
|
||||||
capella.EXECUTION_PAYLOAD_INDEX).get)
|
capella.EXECUTION_PAYLOAD_INDEX).get)
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.1/specs/eip4844/light-client/full-node.md#block_to_light_client_header
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/light-client/full-node.md#modified-block_to_light_client_header
|
||||||
func toEIP4844LightClientHeader(
|
func toDenebLightClientHeader(
|
||||||
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
||||||
phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock |
|
phase0.SignedBeaconBlock | phase0.TrustedSignedBeaconBlock |
|
||||||
altair.SignedBeaconBlock | altair.TrustedSignedBeaconBlock |
|
altair.SignedBeaconBlock | altair.TrustedSignedBeaconBlock |
|
||||||
@ -884,7 +884,7 @@ func toEIP4844LightClientHeader(
|
|||||||
deneb.LightClientHeader(
|
deneb.LightClientHeader(
|
||||||
beacon: blck.message.toBeaconBlockHeader())
|
beacon: blck.message.toBeaconBlockHeader())
|
||||||
|
|
||||||
func toEIP4844LightClientHeader(
|
func toDenebLightClientHeader(
|
||||||
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
||||||
capella.SignedBeaconBlock | capella.TrustedSignedBeaconBlock
|
capella.SignedBeaconBlock | capella.TrustedSignedBeaconBlock
|
||||||
): deneb.LightClientHeader =
|
): deneb.LightClientHeader =
|
||||||
@ -910,7 +910,7 @@ func toEIP4844LightClientHeader(
|
|||||||
execution_branch: blck.message.body.build_proof(
|
execution_branch: blck.message.body.build_proof(
|
||||||
capella.EXECUTION_PAYLOAD_INDEX).get)
|
capella.EXECUTION_PAYLOAD_INDEX).get)
|
||||||
|
|
||||||
func toEIP4844LightClientHeader(
|
func toDenebLightClientHeader(
|
||||||
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
blck: # `SomeSignedBeaconBlock` doesn't work here (Nim 1.6)
|
||||||
deneb.SignedBeaconBlock | deneb.TrustedSignedBeaconBlock
|
deneb.SignedBeaconBlock | deneb.TrustedSignedBeaconBlock
|
||||||
): deneb.LightClientHeader =
|
): deneb.LightClientHeader =
|
||||||
@ -945,8 +945,8 @@ func toLightClientHeader*(
|
|||||||
capella.SignedBeaconBlock | capella.TrustedSignedBeaconBlock |
|
capella.SignedBeaconBlock | capella.TrustedSignedBeaconBlock |
|
||||||
deneb.SignedBeaconBlock | deneb.TrustedSignedBeaconBlock,
|
deneb.SignedBeaconBlock | deneb.TrustedSignedBeaconBlock,
|
||||||
kind: static LightClientDataFork): auto =
|
kind: static LightClientDataFork): auto =
|
||||||
when kind == LightClientDataFork.EIP4844:
|
when kind == LightClientDataFork.Deneb:
|
||||||
blck.toEIP4844LightClientHeader()
|
blck.toDenebLightClientHeader()
|
||||||
elif kind == LightClientDataFork.Capella:
|
elif kind == LightClientDataFork.Capella:
|
||||||
blck.toCapellaLightClientHeader()
|
blck.toCapellaLightClientHeader()
|
||||||
elif kind == LightClientDataFork.Altair:
|
elif kind == LightClientDataFork.Altair:
|
||||||
|
@ -27,7 +27,7 @@ suite "Light client" & preset():
|
|||||||
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
||||||
res.BELLATRIX_FORK_EPOCH = 2.Epoch
|
res.BELLATRIX_FORK_EPOCH = 2.Epoch
|
||||||
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
|
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
|
||||||
# $eip4844ImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
|
# $denebImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
|
||||||
res
|
res
|
||||||
altairStartSlot = cfg.ALTAIR_FORK_EPOCH.start_slot
|
altairStartSlot = cfg.ALTAIR_FORK_EPOCH.start_slot
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ suite "Light client processor" & preset():
|
|||||||
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
||||||
res.BELLATRIX_FORK_EPOCH = 2.Epoch
|
res.BELLATRIX_FORK_EPOCH = 2.Epoch
|
||||||
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
|
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
|
||||||
# $eip4844ImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
|
# $denebImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
|
||||||
res
|
res
|
||||||
|
|
||||||
const numValidators = SLOTS_PER_EPOCH
|
const numValidators = SLOTS_PER_EPOCH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user