fill some capella/EIP4844 missing implementations (#4585)
This commit is contained in:
parent
eb56762d41
commit
956aee2d35
|
@ -392,14 +392,10 @@ iterator getBlockIds*(
|
|||
# `case` ensures we're on a fork for which the `PartialBeaconState`
|
||||
# definition is consistent
|
||||
case db.cfg.stateForkAtEpoch(slot.epoch)
|
||||
of ConsensusFork.Phase0, ConsensusFork.Altair, ConsensusFork.Bellatrix:
|
||||
of ConsensusFork.Phase0 .. ConsensusFork.EIP4844:
|
||||
let stateSlot = (slot.era() + 1).start_slot()
|
||||
if not getPartialState(db, historical_roots, stateSlot, state[]):
|
||||
state = nil # No `return` in iterators
|
||||
of ConsensusFork.Capella:
|
||||
debugRaiseAssert $capellaImplementationMissing & ": era_db.nim: getBlockIds"
|
||||
of ConsensusFork.EIP4844:
|
||||
debugRaiseAssert $eip4844ImplementationMissing & ": era_db.nim: getBlockIds"
|
||||
|
||||
if state == nil:
|
||||
break
|
||||
|
|
|
@ -56,7 +56,7 @@ type
|
|||
message*: BLSToExecutionChange
|
||||
signature*: ValidatorSig
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#historicalsummary
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/capella/beacon-chain.md#historicalsummary
|
||||
HistoricalSummary* = object
|
||||
# `HistoricalSummary` matches the components of the phase0
|
||||
# `HistoricalBatch` making the two hash_tree_root-compatible.
|
||||
|
@ -83,7 +83,7 @@ type
|
|||
transactions*: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]
|
||||
withdrawals*: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] # [New in Capella]
|
||||
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/capella/beacon-chain.md#executionpayloadheader
|
||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/capella/beacon-chain.md#executionpayloadheader
|
||||
ExecutionPayloadHeader* = object
|
||||
parent_hash*: Eth2Digest
|
||||
fee_recipient*: ExecutionAddress
|
||||
|
|
|
@ -268,7 +268,8 @@ proc collectEpochRewardsAndPenalties*(
|
|||
|
||||
proc collectEpochRewardsAndPenalties*(
|
||||
rewardsAndPenalties: var seq[RewardsAndPenalties],
|
||||
state: var (altair.BeaconState | bellatrix.BeaconState | capella.BeaconState),
|
||||
state: var (altair.BeaconState | bellatrix.BeaconState |
|
||||
capella.BeaconState | eip4844.BeaconState),
|
||||
cache: var StateCache, cfg: RuntimeConfig, flags: UpdateFlags) =
|
||||
if get_current_epoch(state) == GENESIS_EPOCH:
|
||||
return
|
||||
|
|
|
@ -1035,11 +1035,8 @@ proc cmdValidatorDb(conf: DbConf, cfg: RuntimeConfig) =
|
|||
if nextSlot.is_epoch:
|
||||
withState(tmpState[]):
|
||||
var stateData = newClone(forkyState.data)
|
||||
when stateFork == ConsensusFork.EIP4844:
|
||||
debugRaiseAssert $eip4844ImplementationMissing & ": ncli_db.nim:cmdValidatorDb"
|
||||
else:
|
||||
rewardsAndPenalties.collectEpochRewardsAndPenalties(
|
||||
stateData[], cache, cfg, flags)
|
||||
rewardsAndPenalties.collectEpochRewardsAndPenalties(
|
||||
stateData[], cache, cfg, flags)
|
||||
|
||||
let res = process_slots(cfg, tmpState[], nextSlot, cache, forkedInfo, flags)
|
||||
doAssert res.isOk, "Slot processing can't fail with correct inputs"
|
||||
|
|
Loading…
Reference in New Issue