mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 06:46:10 +00:00
more eip4844 -> deneb module references (#4690)
This commit is contained in:
parent
d9e938ef02
commit
ea060de6d4
@ -402,7 +402,7 @@ func covers*(
|
||||
|
||||
false
|
||||
|
||||
from ../spec/datatypes/eip4844 import HashedBeaconState, shortLog
|
||||
from ../spec/datatypes/deneb import HashedBeaconState, shortLog
|
||||
|
||||
proc addForkChoice*(pool: var AttestationPool,
|
||||
epochRef: EpochRef,
|
||||
@ -483,7 +483,7 @@ func init(T: type AttestationCache, state: phase0.HashedBeaconState): T =
|
||||
func init(
|
||||
T: type AttestationCache,
|
||||
state: altair.HashedBeaconState | bellatrix.HashedBeaconState |
|
||||
capella.HashedBeaconState | eip4844.HashedBeaconState,
|
||||
capella.HashedBeaconState | deneb.HashedBeaconState,
|
||||
cache: var StateCache): T =
|
||||
# Load attestations that are scheduled for being given rewards for
|
||||
let
|
||||
@ -581,7 +581,7 @@ proc getAttestationsForBlock*(pool: var AttestationPool,
|
||||
when state is phase0.HashedBeaconState:
|
||||
AttestationCache.init(state)
|
||||
elif state is altair.HashedBeaconState or state is bellatrix.HashedBeaconState or
|
||||
state is capella.HashedBeaconState or state is eip4844.HashedBeaconState:
|
||||
state is capella.HashedBeaconState or state is deneb.HashedBeaconState:
|
||||
AttestationCache.init(state, cache)
|
||||
else:
|
||||
static: doAssert false
|
||||
@ -645,7 +645,7 @@ proc getAttestationsForBlock*(pool: var AttestationPool,
|
||||
when state is altair.HashedBeaconState or
|
||||
state is bellatrix.HashedBeaconState or
|
||||
state is capella.HashedBeaconState or
|
||||
state is eip4844.HashedBeaconState:
|
||||
state is deneb.HashedBeaconState:
|
||||
MAX_ATTESTATIONS
|
||||
elif state is phase0.HashedBeaconState:
|
||||
state.data.previous_epoch_attestations.maxLen -
|
||||
|
@ -16,7 +16,7 @@ import
|
||||
"."/[block_dag, blockchain_dag, blockchain_dag_light_client]
|
||||
|
||||
from ../spec/datatypes/capella import asSigVerified, asTrusted, shortLog
|
||||
from ../spec/datatypes/eip4844 import asSigVerified, asTrusted, shortLog
|
||||
from ../spec/datatypes/deneb import asSigVerified, asTrusted, shortLog
|
||||
|
||||
export results, signatures_batch, block_dag, blockchain_dag
|
||||
|
||||
|
@ -18,7 +18,7 @@ import
|
||||
".."/[beacon_chain_db, era_db],
|
||||
"."/[block_pools_types, block_quarantine]
|
||||
|
||||
from ../spec/datatypes/eip4844 import shortLog
|
||||
from ../spec/datatypes/deneb import shortLog
|
||||
|
||||
export
|
||||
eth2_merkleization, eth2_ssz_serialization,
|
||||
@ -213,7 +213,7 @@ proc getForkedBlock*(db: BeaconChainDB, root: Eth2Digest):
|
||||
# When we only have a digest, we don't know which fork it's from so we try
|
||||
# them one by one - this should be used sparingly
|
||||
static: doAssert high(ConsensusFork) == ConsensusFork.EIP4844
|
||||
if (let blck = db.getBlock(root, eip4844.TrustedSignedBeaconBlock);
|
||||
if (let blck = db.getBlock(root, deneb.TrustedSignedBeaconBlock);
|
||||
blck.isSome()):
|
||||
ok(ForkedTrustedSignedBeaconBlock.init(blck.get()))
|
||||
elif (let blck = db.getBlock(root, capella.TrustedSignedBeaconBlock);
|
||||
@ -909,7 +909,7 @@ proc applyBlock(
|
||||
dag.cfg, state, data, cache, info,
|
||||
dag.updateFlags + {slotProcessed}, noRollback)
|
||||
of ConsensusFork.EIP4844:
|
||||
let data = getBlock(dag, bid, eip4844.TrustedSignedBeaconBlock).valueOr:
|
||||
let data = getBlock(dag, bid, deneb.TrustedSignedBeaconBlock).valueOr:
|
||||
return err("Block load failed")
|
||||
state_transition(
|
||||
dag.cfg, state, data, cache, info,
|
||||
|
@ -11,7 +11,7 @@ import
|
||||
# Status libraries
|
||||
stew/bitops2,
|
||||
# Beacon chain internals
|
||||
../spec/datatypes/[phase0, altair, bellatrix, capella, eip4844],
|
||||
../spec/datatypes/[phase0, altair, bellatrix, capella, deneb],
|
||||
../beacon_chain_db_light_client,
|
||||
"."/[block_pools_types, blockchain_dag]
|
||||
|
||||
@ -19,13 +19,13 @@ logScope: topics = "chaindag_lc"
|
||||
|
||||
type
|
||||
HashedBeaconStateWithSyncCommittee =
|
||||
eip4844.HashedBeaconState |
|
||||
deneb.HashedBeaconState |
|
||||
capella.HashedBeaconState |
|
||||
bellatrix.HashedBeaconState |
|
||||
altair.HashedBeaconState
|
||||
|
||||
TrustedSignedBeaconBlockWithSyncAggregate =
|
||||
eip4844.TrustedSignedBeaconBlock |
|
||||
deneb.TrustedSignedBeaconBlock |
|
||||
capella.TrustedSignedBeaconBlock |
|
||||
bellatrix.TrustedSignedBeaconBlock |
|
||||
altair.TrustedSignedBeaconBlock
|
||||
@ -780,7 +780,7 @@ proc processNewBlockForLightClient*(
|
||||
if signedBlock.message.slot < dag.lcDataStore.cache.tailSlot:
|
||||
return
|
||||
|
||||
when signedBlock is eip4844.TrustedSignedBeaconBlock:
|
||||
when signedBlock is deneb.TrustedSignedBeaconBlock:
|
||||
dag.cacheLightClientData(state.eip4844Data, signedBlock.toBlockId())
|
||||
dag.createLightClientUpdates(state.eip4844Data, signedBlock, parentBid)
|
||||
elif signedBlock is capella.TrustedSignedBeaconBlock:
|
||||
|
@ -261,7 +261,7 @@ macro getSymbolFromForkModule(fork: static ConsensusFork,
|
||||
of ConsensusFork.Altair: "altair"
|
||||
of ConsensusFork.Bellatrix: "bellatrix"
|
||||
of ConsensusFork.Capella: "capella"
|
||||
of ConsensusFork.EIP4844: "eip4844"
|
||||
of ConsensusFork.EIP4844: "deneb"
|
||||
newDotExpr(ident moduleName, ident symbolName)
|
||||
|
||||
template BeaconStateType*(fork: static ConsensusFork): auto =
|
||||
|
@ -200,7 +200,7 @@ template LightClientHeader*(kind: static LightClientDataFork): auto =
|
||||
|
||||
template LightClientBootstrap*(kind: static LightClientDataFork): auto =
|
||||
when kind == LightClientDataFork.EIP4844:
|
||||
typedesc[eip4844.LightClientBootstrap]
|
||||
typedesc[deneb.LightClientBootstrap]
|
||||
elif kind == LightClientDataFork.Capella:
|
||||
typedesc[capella.LightClientBootstrap]
|
||||
elif kind == LightClientDataFork.Altair:
|
||||
@ -230,7 +230,7 @@ template LightClientFinalityUpdate*(kind: static LightClientDataFork): auto =
|
||||
|
||||
template LightClientOptimisticUpdate*(kind: static LightClientDataFork): auto =
|
||||
when kind == LightClientDataFork.EIP4844:
|
||||
typedesc[eip4844.LightClientOptimisticUpdate]
|
||||
typedesc[deneb.LightClientOptimisticUpdate]
|
||||
elif kind == LightClientDataFork.Capella:
|
||||
typedesc[capella.LightClientOptimisticUpdate]
|
||||
elif kind == LightClientDataFork.Altair:
|
||||
|
@ -909,7 +909,7 @@ proc process_block*(
|
||||
? process_withdrawals(state, blck.body.execution_payload)
|
||||
? process_execution_payload(
|
||||
state, blck.body.execution_payload,
|
||||
func(_: eip4844.ExecutionPayload): bool = true) # [Modified in EIP-4844]
|
||||
func(_: deneb.ExecutionPayload): bool = true) # [Modified in Deneb]
|
||||
? process_randao(state, blck.body, flags, cache)
|
||||
? process_eth1_data(state, blck.body)
|
||||
|
||||
|
@ -65,7 +65,7 @@ type
|
||||
from ../../beacon_chain/spec/datatypes/capella import
|
||||
BeaconBlock, BeaconState, SignedBeaconBlock
|
||||
|
||||
from ../../beacon_chain/spec/datatypes/eip4844 import
|
||||
from ../../beacon_chain/spec/datatypes/deneb import
|
||||
BeaconBlock, BeaconState, SignedBeaconBlock
|
||||
|
||||
proc initialLoad(
|
||||
@ -81,8 +81,8 @@ proc initialLoad(
|
||||
path/"anchor_block.ssz_snappy",
|
||||
SSZ, BlockType)
|
||||
|
||||
when BlockType is eip4844.BeaconBlock:
|
||||
let signedBlock = ForkedSignedBeaconBlock.init(eip4844.SignedBeaconBlock(
|
||||
when BlockType is deneb.BeaconBlock:
|
||||
let signedBlock = ForkedSignedBeaconBlock.init(deneb.SignedBeaconBlock(
|
||||
message: blck,
|
||||
# signature: - unused as it's trusted
|
||||
root: hash_tree_root(blck)
|
||||
@ -177,7 +177,7 @@ proc loadOps(path: string, fork: ConsensusFork): seq[Operation] =
|
||||
of ConsensusFork.EIP4844:
|
||||
let blck = parseTest(
|
||||
path/filename & ".ssz_snappy",
|
||||
SSZ, eip4844.SignedBeaconBlock
|
||||
SSZ, deneb.SignedBeaconBlock
|
||||
)
|
||||
result.add Operation(kind: opOnBlock,
|
||||
blck: ForkedSignedBeaconBlock.init(blck))
|
||||
@ -237,8 +237,8 @@ proc stepOnBlock(
|
||||
type TrustedBlock = bellatrix.TrustedSignedBeaconBlock
|
||||
elif signedBlock is capella.SignedBeaconBlock:
|
||||
type TrustedBlock = capella.TrustedSignedBeaconBlock
|
||||
elif signedBlock is eip4844.SignedBeaconBlock:
|
||||
type TrustedBlock = eip4844.TrustedSignedBeaconBlock
|
||||
elif signedBlock is deneb.SignedBeaconBlock:
|
||||
type TrustedBlock = deneb.TrustedSignedBeaconBlock
|
||||
else:
|
||||
doAssert false, "Unknown TrustedSignedBeaconBlock fork"
|
||||
|
||||
@ -338,7 +338,7 @@ proc doRunTest(path: string, fork: ConsensusFork) =
|
||||
let stores =
|
||||
case fork
|
||||
of ConsensusFork.EIP4844:
|
||||
initialLoad(path, db, eip4844.BeaconState, eip4844.BeaconBlock)
|
||||
initialLoad(path, db, deneb.BeaconState, deneb.BeaconBlock)
|
||||
of ConsensusFork.Capella:
|
||||
initialLoad(path, db, capella.BeaconState, capella.BeaconBlock)
|
||||
of ConsensusFork.Bellatrix:
|
||||
|
Loading…
x
Reference in New Issue
Block a user