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