rename most eip4844Data to denebData (#4693)

This commit is contained in:
tersec 2023-03-04 22:23:52 +00:00 committed by GitHub
parent 3b41e6a0e7
commit e3d96ef147
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 54 additions and 54 deletions

View File

@ -781,8 +781,8 @@ proc processNewBlockForLightClient*(
return return
when signedBlock is deneb.TrustedSignedBeaconBlock: when signedBlock is deneb.TrustedSignedBeaconBlock:
dag.cacheLightClientData(state.eip4844Data, signedBlock.toBlockId()) dag.cacheLightClientData(state.denebData, signedBlock.toBlockId())
dag.createLightClientUpdates(state.eip4844Data, signedBlock, parentBid) dag.createLightClientUpdates(state.denebData, signedBlock, parentBid)
elif signedBlock is capella.TrustedSignedBeaconBlock: elif signedBlock is capella.TrustedSignedBeaconBlock:
dag.cacheLightClientData(state.capellaData, signedBlock.toBlockId()) dag.cacheLightClientData(state.capellaData, signedBlock.toBlockId())
dag.createLightClientUpdates(state.capellaData, signedBlock, parentBid) dag.createLightClientUpdates(state.capellaData, signedBlock, parentBid)

View File

@ -1162,7 +1162,7 @@ proc writeValue*[
writer.writeField("block_header", value.capellaData) writer.writeField("block_header", value.capellaData)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
writer.writeField("version", forkIdentifier "deneb") writer.writeField("version", forkIdentifier "deneb")
writer.writeField("block_header", value.eip4844Data) writer.writeField("block_header", value.denebData)
writer.endRecord() writer.endRecord()
proc writeValue*[ proc writeValue*[
@ -1192,7 +1192,7 @@ proc writeValue*[
writer.writeField("data", value.capellaData) writer.writeField("data", value.capellaData)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
writer.writeField("version", forkIdentifier "deneb") writer.writeField("version", forkIdentifier "deneb")
writer.writeField("data", value.eip4844Data) writer.writeField("data", value.denebData)
writer.endRecord() writer.endRecord()
## RestPublishedBeaconBlockBody ## RestPublishedBeaconBlockBody
@ -1671,7 +1671,7 @@ proc writeValue*(writer: var JsonWriter[RestJson],
writer.writeField("data", value.capellaData) writer.writeField("data", value.capellaData)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
writer.writeField("version", "deneb") writer.writeField("version", "deneb")
writer.writeField("data", value.eip4844Data) writer.writeField("data", value.denebData)
writer.endRecord() writer.endRecord()
# ForkedHashedBeaconState is used where a `ForkedBeaconState` normally would # ForkedHashedBeaconState is used where a `ForkedBeaconState` normally would
@ -1767,14 +1767,14 @@ proc readValue*(reader: var JsonReader[RestJson],
toValue(capellaData) toValue(capellaData)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
try: try:
tmp[].eip4844Data.data = RestJson.decode( tmp[].denebData.data = RestJson.decode(
string(data.get()), string(data.get()),
deneb.BeaconState, deneb.BeaconState,
requireAllFields = true, requireAllFields = true,
allowUnknownFields = true) allowUnknownFields = true)
except SerializationError: except SerializationError:
reader.raiseUnexpectedValue("Incorrect EIP4844 beacon state format") reader.raiseUnexpectedValue("Incorrect EIP4844 beacon state format")
toValue(eip4844Data) toValue(denebData)
proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconState) proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconState)
{.raises: [IOError, Defect].} = {.raises: [IOError, Defect].} =
@ -1794,7 +1794,7 @@ proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconStat
writer.writeField("data", value.capellaData.data) writer.writeField("data", value.capellaData.data)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
writer.writeField("version", "deneb") writer.writeField("version", "deneb")
writer.writeField("data", value.eip4844Data.data) writer.writeField("data", value.denebData.data)
writer.endRecord() writer.endRecord()
## Web3SignerRequest ## Web3SignerRequest

View File

@ -68,7 +68,7 @@ type
of ConsensusFork.Altair: altairData*: altair.HashedBeaconState of ConsensusFork.Altair: altairData*: altair.HashedBeaconState
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.HashedBeaconState of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.HashedBeaconState
of ConsensusFork.Capella: capellaData*: capella.HashedBeaconState of ConsensusFork.Capella: capellaData*: capella.HashedBeaconState
of ConsensusFork.Deneb: eip4844Data*: deneb.HashedBeaconState of ConsensusFork.Deneb: denebData*: deneb.HashedBeaconState
ForkyExecutionPayload* = ForkyExecutionPayload* =
bellatrix.ExecutionPayload | bellatrix.ExecutionPayload |
@ -138,7 +138,7 @@ type
of ConsensusFork.Altair: altairData*: altair.BeaconBlock of ConsensusFork.Altair: altairData*: altair.BeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.BeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.BeaconBlock
of ConsensusFork.Capella: capellaData*: capella.BeaconBlock of ConsensusFork.Capella: capellaData*: capella.BeaconBlock
of ConsensusFork.Deneb: eip4844Data*: deneb.BeaconBlock of ConsensusFork.Deneb: denebData*: deneb.BeaconBlock
Web3SignerForkedBeaconBlock* = object Web3SignerForkedBeaconBlock* = object
case kind*: ConsensusFork case kind*: ConsensusFork
@ -146,7 +146,7 @@ type
of ConsensusFork.Altair: altairData*: altair.BeaconBlock of ConsensusFork.Altair: altairData*: altair.BeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: BeaconBlockHeader of ConsensusFork.Bellatrix: bellatrixData*: BeaconBlockHeader
of ConsensusFork.Capella: capellaData*: BeaconBlockHeader of ConsensusFork.Capella: capellaData*: BeaconBlockHeader
of ConsensusFork.Deneb: eip4844Data*: BeaconBlockHeader of ConsensusFork.Deneb: denebData*: BeaconBlockHeader
ForkedBlindedBeaconBlock* = object ForkedBlindedBeaconBlock* = object
case kind*: ConsensusFork case kind*: ConsensusFork
@ -154,7 +154,7 @@ type
of ConsensusFork.Altair: altairData*: altair.BeaconBlock of ConsensusFork.Altair: altairData*: altair.BeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.BlindedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.BlindedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella_mev.BlindedBeaconBlock of ConsensusFork.Capella: capellaData*: capella_mev.BlindedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: capella_mev.BlindedBeaconBlock of ConsensusFork.Deneb: denebData*: capella_mev.BlindedBeaconBlock
ForkedTrustedBeaconBlock* = object ForkedTrustedBeaconBlock* = object
case kind*: ConsensusFork case kind*: ConsensusFork
@ -162,7 +162,7 @@ type
of ConsensusFork.Altair: altairData*: altair.TrustedBeaconBlock of ConsensusFork.Altair: altairData*: altair.TrustedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.TrustedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.TrustedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella.TrustedBeaconBlock of ConsensusFork.Capella: capellaData*: capella.TrustedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: deneb.TrustedBeaconBlock of ConsensusFork.Deneb: denebData*: deneb.TrustedBeaconBlock
ForkySignedBeaconBlock* = ForkySignedBeaconBlock* =
phase0.SignedBeaconBlock | phase0.SignedBeaconBlock |
@ -177,7 +177,7 @@ type
of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.SignedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.SignedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella.SignedBeaconBlock of ConsensusFork.Capella: capellaData*: capella.SignedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: deneb.SignedBeaconBlock of ConsensusFork.Deneb: denebData*: deneb.SignedBeaconBlock
ForkySignedBlindedBeaconBlock* = ForkySignedBlindedBeaconBlock* =
phase0.SignedBeaconBlock | phase0.SignedBeaconBlock |
@ -191,7 +191,7 @@ type
of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.SignedBlindedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.SignedBlindedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella_mev.SignedBlindedBeaconBlock of ConsensusFork.Capella: capellaData*: capella_mev.SignedBlindedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: capella_mev.SignedBlindedBeaconBlock of ConsensusFork.Deneb: denebData*: capella_mev.SignedBlindedBeaconBlock
ForkySigVerifiedSignedBeaconBlock* = ForkySigVerifiedSignedBeaconBlock* =
phase0.SigVerifiedSignedBeaconBlock | phase0.SigVerifiedSignedBeaconBlock |
@ -220,7 +220,7 @@ type
of ConsensusFork.Altair: altairData*: altair.MsgTrustedSignedBeaconBlock of ConsensusFork.Altair: altairData*: altair.MsgTrustedSignedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.MsgTrustedSignedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.MsgTrustedSignedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella.MsgTrustedSignedBeaconBlock of ConsensusFork.Capella: capellaData*: capella.MsgTrustedSignedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: deneb.MsgTrustedSignedBeaconBlock of ConsensusFork.Deneb: denebData*: deneb.MsgTrustedSignedBeaconBlock
ForkedTrustedSignedBeaconBlock* = object ForkedTrustedSignedBeaconBlock* = object
case kind*: ConsensusFork case kind*: ConsensusFork
@ -228,7 +228,7 @@ type
of ConsensusFork.Altair: altairData*: altair.TrustedSignedBeaconBlock of ConsensusFork.Altair: altairData*: altair.TrustedSignedBeaconBlock
of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.TrustedSignedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix.TrustedSignedBeaconBlock
of ConsensusFork.Capella: capellaData*: capella.TrustedSignedBeaconBlock of ConsensusFork.Capella: capellaData*: capella.TrustedSignedBeaconBlock
of ConsensusFork.Deneb: eip4844Data*: deneb.TrustedSignedBeaconBlock of ConsensusFork.Deneb: denebData*: deneb.TrustedSignedBeaconBlock
SomeForkySignedBeaconBlock* = SomeForkySignedBeaconBlock* =
ForkySignedBeaconBlock | ForkySignedBeaconBlock |
@ -312,7 +312,7 @@ func new*(T: type ForkedHashedBeaconState, data: capella.BeaconState):
data: data, root: hash_tree_root(data))) data: data, root: hash_tree_root(data)))
func new*(T: type ForkedHashedBeaconState, data: deneb.BeaconState): func new*(T: type ForkedHashedBeaconState, data: deneb.BeaconState):
ref ForkedHashedBeaconState = ref ForkedHashedBeaconState =
(ref T)(kind: ConsensusFork.Deneb, eip4844Data: deneb.HashedBeaconState( (ref T)(kind: ConsensusFork.Deneb, denebData: deneb.HashedBeaconState(
data: data, root: hash_tree_root(data))) data: data, root: hash_tree_root(data)))
template init*(T: type ForkedBeaconBlock, blck: phase0.BeaconBlock): T = template init*(T: type ForkedBeaconBlock, blck: phase0.BeaconBlock): T =
@ -324,7 +324,7 @@ template init*(T: type ForkedBeaconBlock, blck: bellatrix.BeaconBlock): T =
template init*(T: type ForkedBeaconBlock, blck: capella.BeaconBlock): T = template init*(T: type ForkedBeaconBlock, blck: capella.BeaconBlock): T =
T(kind: ConsensusFork.Capella, capellaData: blck) T(kind: ConsensusFork.Capella, capellaData: blck)
template init*(T: type ForkedBeaconBlock, blck: deneb.BeaconBlock): T = template init*(T: type ForkedBeaconBlock, blck: deneb.BeaconBlock): T =
T(kind: ConsensusFork.Deneb, eip4844Data: blck) T(kind: ConsensusFork.Deneb, denebData: blck)
template init*(T: type ForkedTrustedBeaconBlock, blck: phase0.TrustedBeaconBlock): T = template init*(T: type ForkedTrustedBeaconBlock, blck: phase0.TrustedBeaconBlock): T =
T(kind: ConsensusFork.Phase0, phase0Data: blck) T(kind: ConsensusFork.Phase0, phase0Data: blck)
@ -344,7 +344,7 @@ template init*(T: type ForkedSignedBeaconBlock, blck: bellatrix.SignedBeaconBloc
template init*(T: type ForkedSignedBeaconBlock, blck: capella.SignedBeaconBlock): T = template init*(T: type ForkedSignedBeaconBlock, blck: capella.SignedBeaconBlock): T =
T(kind: ConsensusFork.Capella, capellaData: blck) T(kind: ConsensusFork.Capella, capellaData: blck)
template init*(T: type ForkedSignedBeaconBlock, blck: deneb.SignedBeaconBlock): T = template init*(T: type ForkedSignedBeaconBlock, blck: deneb.SignedBeaconBlock): T =
T(kind: ConsensusFork.Deneb, eip4844Data: blck) T(kind: ConsensusFork.Deneb, denebData: blck)
func init*(T: type ForkedSignedBeaconBlock, forked: ForkedBeaconBlock, func init*(T: type ForkedSignedBeaconBlock, forked: ForkedBeaconBlock,
blockRoot: Eth2Digest, signature: ValidatorSig): T = blockRoot: Eth2Digest, signature: ValidatorSig): T =
@ -371,9 +371,9 @@ func init*(T: type ForkedSignedBeaconBlock, forked: ForkedBeaconBlock,
signature: signature)) signature: signature))
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
T(kind: ConsensusFork.Deneb, T(kind: ConsensusFork.Deneb,
eip4844Data: deneb.SignedBeaconBlock(message: forked.eip4844Data, denebData: deneb.SignedBeaconBlock(message: forked.denebData,
root: blockRoot, root: blockRoot,
signature: signature)) signature: signature))
func init*(T: type ForkedSignedBlindedBeaconBlock, func init*(T: type ForkedSignedBlindedBeaconBlock,
forked: ForkedBlindedBeaconBlock, blockRoot: Eth2Digest, forked: ForkedBlindedBeaconBlock, blockRoot: Eth2Digest,
@ -400,8 +400,8 @@ func init*(T: type ForkedSignedBlindedBeaconBlock,
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
discard $denebImplementationMissing & "forks.nim:init(T: type ForkedSignedBlindedBeaconBlock)" discard $denebImplementationMissing & "forks.nim:init(T: type ForkedSignedBlindedBeaconBlock)"
T(kind: ConsensusFork.Deneb, T(kind: ConsensusFork.Deneb,
eip4844Data: capella_mev.SignedBlindedBeaconBlock(message: forked.eip4844Data, denebData: capella_mev.SignedBlindedBeaconBlock(message: forked.denebData,
signature: signature)) signature: signature))
template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: phase0.MsgTrustedSignedBeaconBlock): T = template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: phase0.MsgTrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Phase0, phase0Data: blck) T(kind: ConsensusFork.Phase0, phase0Data: blck)
@ -412,7 +412,7 @@ template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: bellatrix.MsgTru
template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: capella.MsgTrustedSignedBeaconBlock): T = template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: capella.MsgTrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Capella, capellaData: blck) T(kind: ConsensusFork.Capella, capellaData: blck)
template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: deneb.MsgTrustedSignedBeaconBlock): T = template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: deneb.MsgTrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Deneb, eip4844Data: blck) T(kind: ConsensusFork.Deneb, eip4844Data: blck)
template init*(T: type ForkedTrustedSignedBeaconBlock, blck: phase0.TrustedSignedBeaconBlock): T = template init*(T: type ForkedTrustedSignedBeaconBlock, blck: phase0.TrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Phase0, phase0Data: blck) T(kind: ConsensusFork.Phase0, phase0Data: blck)
@ -423,7 +423,7 @@ template init*(T: type ForkedTrustedSignedBeaconBlock, blck: bellatrix.TrustedSi
template init*(T: type ForkedTrustedSignedBeaconBlock, blck: capella.TrustedSignedBeaconBlock): T = template init*(T: type ForkedTrustedSignedBeaconBlock, blck: capella.TrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Capella, capellaData: blck) T(kind: ConsensusFork.Capella, capellaData: blck)
template init*(T: type ForkedTrustedSignedBeaconBlock, blck: deneb.TrustedSignedBeaconBlock): T = template init*(T: type ForkedTrustedSignedBeaconBlock, blck: deneb.TrustedSignedBeaconBlock): T =
T(kind: ConsensusFork.Deneb, eip4844Data: blck) T(kind: ConsensusFork.Deneb, denebData: blck)
template toString*(kind: ConsensusFork): string = template toString*(kind: ConsensusFork): string =
case kind case kind
@ -526,7 +526,7 @@ template withState*(x: ForkedHashedBeaconState, body: untyped): untyped =
case x.kind case x.kind
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const stateFork {.inject, used.} = ConsensusFork.Deneb const stateFork {.inject, used.} = ConsensusFork.Deneb
template forkyState: untyped {.inject, used.} = x.eip4844Data template forkyState: untyped {.inject, used.} = x.denebData
body body
of ConsensusFork.Capella: of ConsensusFork.Capella:
const stateFork {.inject, used.} = ConsensusFork.Capella const stateFork {.inject, used.} = ConsensusFork.Capella
@ -578,7 +578,7 @@ func assign*(tgt: var ForkedHashedBeaconState, src: ForkedHashedBeaconState) =
if tgt.kind == src.kind: if tgt.kind == src.kind:
case tgt.kind case tgt.kind
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
assign(tgt.eip4844Data, src.eip4844Data): assign(tgt.denebData, src.denebData):
of ConsensusFork.Capella: of ConsensusFork.Capella:
assign(tgt.capellaData, src.capellaData): assign(tgt.capellaData, src.capellaData):
of ConsensusFork.Bellatrix: of ConsensusFork.Bellatrix:
@ -599,7 +599,7 @@ template getStateField*(x: ForkedHashedBeaconState, y: untyped): untyped =
# ``` # ```
# Without `unsafeAddr`, the `validators` list would be copied to a temporary variable. # Without `unsafeAddr`, the `validators` list would be copied to a temporary variable.
(case x.kind (case x.kind
of ConsensusFork.Deneb: unsafeAddr x.eip4844Data.data.y of ConsensusFork.Deneb: unsafeAddr x.denebData.data.y
of ConsensusFork.Capella: unsafeAddr x.capellaData.data.y of ConsensusFork.Capella: unsafeAddr x.capellaData.data.y
of ConsensusFork.Bellatrix: unsafeAddr x.bellatrixData.data.y of ConsensusFork.Bellatrix: unsafeAddr x.bellatrixData.data.y
of ConsensusFork.Altair: unsafeAddr x.altairData.data.y of ConsensusFork.Altair: unsafeAddr x.altairData.data.y
@ -722,7 +722,7 @@ template withBlck*(
body body
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const stateFork {.inject, used.} = ConsensusFork.Deneb const stateFork {.inject, used.} = ConsensusFork.Deneb
template blck: untyped {.inject.} = x.eip4844Data template blck: untyped {.inject.} = x.denebData
body body
func proposer_index*(x: ForkedBeaconBlock): uint64 = func proposer_index*(x: ForkedBeaconBlock): uint64 =
@ -743,7 +743,7 @@ template getForkedBlockField*(
of ConsensusFork.Altair: unsafeAddr x.altairData.message.y of ConsensusFork.Altair: unsafeAddr x.altairData.message.y
of ConsensusFork.Bellatrix: unsafeAddr x.bellatrixData.message.y of ConsensusFork.Bellatrix: unsafeAddr x.bellatrixData.message.y
of ConsensusFork.Capella: unsafeAddr x.capellaData.message.y of ConsensusFork.Capella: unsafeAddr x.capellaData.message.y
of ConsensusFork.Deneb: unsafeAddr x.eip4844Data.message.y)[] of ConsensusFork.Deneb: unsafeAddr x.denebData.message.y)[]
template signature*(x: ForkedSignedBeaconBlock | template signature*(x: ForkedSignedBeaconBlock |
ForkedMsgTrustedSignedBeaconBlock | ForkedMsgTrustedSignedBeaconBlock |
@ -786,8 +786,8 @@ template withStateAndBlck*(
case s.kind case s.kind
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const stateFork {.inject.} = ConsensusFork.Deneb const stateFork {.inject.} = ConsensusFork.Deneb
template forkyState: untyped {.inject.} = s.eip4844Data template forkyState: untyped {.inject.} = s.denebData
template blck: untyped {.inject.} = b.eip4844Data template blck: untyped {.inject.} = b.denebData
body body
of ConsensusFork.Capella: of ConsensusFork.Capella:
const stateFork {.inject.} = ConsensusFork.Capella const stateFork {.inject.} = ConsensusFork.Capella

View File

@ -212,7 +212,7 @@ func maybeUpgradeStateToEIP4844(
let newState = upgrade_to_eip4844(cfg, state.capellaData.data) let newState = upgrade_to_eip4844(cfg, state.capellaData.data)
state = (ref ForkedHashedBeaconState)( state = (ref ForkedHashedBeaconState)(
kind: ConsensusFork.Deneb, kind: ConsensusFork.Deneb,
eip4844Data: deneb.HashedBeaconState( denebData: deneb.HashedBeaconState(
root: hash_tree_root(newState[]), data: newState[]))[] root: hash_tree_root(newState[]), data: newState[]))[]
func maybeUpgradeState*( func maybeUpgradeState*(
@ -607,7 +607,7 @@ proc makeBeaconBlock*[T: bellatrix.ExecutionPayload | capella.ExecutionPayload |
of ConsensusFork.Phase0, ConsensusFork.Altair, of ConsensusFork.Phase0, ConsensusFork.Altair,
ConsensusFork.Bellatrix, ConsensusFork.Capella: ConsensusFork.Bellatrix, ConsensusFork.Capella:
raiseAssert "Attempt to use EIP4844 payload with non-EIP4844 state" raiseAssert "Attempt to use EIP4844 payload with non-EIP4844 state"
of ConsensusFork.Deneb: makeBeaconBlock(eip4844) of ConsensusFork.Deneb: makeBeaconBlock(deneb)
# workaround for https://github.com/nim-lang/Nim/issues/20900 rather than have # workaround for https://github.com/nim-lang/Nim/issues/20900 rather than have
# these be default arguments # these be default arguments

View File

@ -464,7 +464,7 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
Web3SignerForkedBeaconBlock( Web3SignerForkedBeaconBlock(
kind: ConsensusFork.Deneb, kind: ConsensusFork.Deneb,
eip4844Data: blck.eip4844Data.toBeaconBlockHeader) denebData: blck.denebData.toBeaconBlockHeader)
request = Web3SignerRequest.init( request = Web3SignerRequest.init(
fork, genesis_validators_root, web3SignerBlock) fork, genesis_validators_root, web3SignerBlock)
@ -506,7 +506,7 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
Web3SignerForkedBeaconBlock( Web3SignerForkedBeaconBlock(
kind: ConsensusFork.Deneb, kind: ConsensusFork.Deneb,
eip4844Data: blck.eip4844Data.toBeaconBlockHeader) denebData: blck.denebData.toBeaconBlockHeader)
request = Web3SignerRequest.init( request = Web3SignerRequest.init(
fork, genesis_validators_root, web3SignerBlock) fork, genesis_validators_root, web3SignerBlock)

View File

@ -85,7 +85,7 @@ template saveSSZFile(filename: string, value: ForkedHashedBeaconState) =
of ConsensusFork.Altair: SSZ.saveFile(filename, value.altairData.data) of ConsensusFork.Altair: SSZ.saveFile(filename, value.altairData.data)
of ConsensusFork.Bellatrix: SSZ.saveFile(filename, value.bellatrixData.data) of ConsensusFork.Bellatrix: SSZ.saveFile(filename, value.bellatrixData.data)
of ConsensusFork.Capella: SSZ.saveFile(filename, value.capellaData.data) of ConsensusFork.Capella: SSZ.saveFile(filename, value.capellaData.data)
of ConsensusFork.Deneb: SSZ.saveFile(filename, value.eip4844Data.data) of ConsensusFork.Deneb: SSZ.saveFile(filename, value.denebData.data)
proc loadFile(filename: string, T: type): T = proc loadFile(filename: string, T: type): T =
let let

View File

@ -501,7 +501,7 @@ cli do(slots = SLOTS_PER_EPOCH * 6,
elif T is capella.SignedBeaconBlock: elif T is capella.SignedBeaconBlock:
addr state.capellaData addr state.capellaData
elif T is eip4844.SignedBeaconBlock: elif T is eip4844.SignedBeaconBlock:
addr state.eip4844Data addr state.denebData
else: else:
static: doAssert false static: doAssert false
message = makeBeaconBlock( message = makeBeaconBlock(

View File

@ -205,9 +205,9 @@ cli do(validatorsDir: string, secretsDir: string,
validators[proposer]).toValidatorSig()) validators[proposer]).toValidatorSig())
dump(".", signedBlock) dump(".", signedBlock)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
blockRoot = hash_tree_root(message.eip4844Data) blockRoot = hash_tree_root(message.denebData)
let signedBlock = eip4844.SignedBeaconBlock( let signedBlock = eip4844.SignedBeaconBlock(
message: message.eip4844Data, message: message.denebData,
root: blockRoot, root: blockRoot,
signature: get_block_signature( signature: get_block_signature(
fork, genesis_validators_root, slot, blockRoot, fork, genesis_validators_root, slot, blockRoot,

View File

@ -131,8 +131,8 @@ proc loadForkedState*(
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
let state = newClone(parseTest(path, SSZ, deneb.BeaconState)) let state = newClone(parseTest(path, SSZ, deneb.BeaconState))
forkedState = (ref ForkedHashedBeaconState)(kind: ConsensusFork.Deneb) forkedState = (ref ForkedHashedBeaconState)(kind: ConsensusFork.Deneb)
forkedState.eip4844Data.data = state[] forkedState.denebData.data = state[]
forkedState.eip4844Data.root = hash_tree_root(state[]) forkedState.denebData.root = hash_tree_root(state[])
of ConsensusFork.Capella: of ConsensusFork.Capella:
let state = newClone(parseTest(path, SSZ, capella.BeaconState)) let state = newClone(parseTest(path, SSZ, capella.BeaconState))
forkedState = (ref ForkedHashedBeaconState)(kind: ConsensusFork.Capella) forkedState = (ref ForkedHashedBeaconState)(kind: ConsensusFork.Capella)

View File

@ -444,8 +444,8 @@ suite "Beacon chain DB" & preset():
let db = makeTestDB(SLOTS_PER_EPOCH) let db = makeTestDB(SLOTS_PER_EPOCH)
for state in testStatesEIP4844: for state in testStatesEIP4844:
let root = state[].eip4844Data.root let root = state[].denebData.root
db.putState(root, state[].eip4844Data.data) db.putState(root, state[].denebData.data)
check: check:
db.containsState(root) db.containsState(root)
@ -543,8 +543,8 @@ suite "Beacon chain DB" & preset():
let stateBuffer = (eip4844.BeaconStateRef)() let stateBuffer = (eip4844.BeaconStateRef)()
for state in testStatesEIP4844: for state in testStatesEIP4844:
let root = state[].eip4844Data.root let root = state[].denebData.root
db.putState(root, state[].eip4844Data.data) db.putState(root, state[].denebData.data)
check: check:
db.getState(root, stateBuffer[], noRollback) db.getState(root, stateBuffer[], noRollback)
@ -666,7 +666,7 @@ suite "Beacon chain DB" & preset():
dag = init(ChainDAGRef, defaultRuntimeConfig, db, validatorMonitor, {}) dag = init(ChainDAGRef, defaultRuntimeConfig, db, validatorMonitor, {})
state = (ref ForkedHashedBeaconState)( state = (ref ForkedHashedBeaconState)(
kind: ConsensusFork.Deneb, kind: ConsensusFork.Deneb,
eip4844Data: eip4844.HashedBeaconState(data: eip4844.BeaconState( denebData: eip4844.HashedBeaconState(data: eip4844.BeaconState(
slot: 10.Slot))) slot: 10.Slot)))
root = Eth2Digest() root = Eth2Digest()
@ -678,8 +678,8 @@ suite "Beacon chain DB" & preset():
assign(state[], restoreAddr[]) assign(state[], restoreAddr[])
check: check:
state[].eip4844Data.data.slot == 10.Slot state[].denebData.data.slot == 10.Slot
not db.getState(root, state[].eip4844Data.data, restore) not db.getState(root, state[].denebData.data, restore)
# assign() has switched the case object fork # assign() has switched the case object fork
state[].kind == ConsensusFork.Phase0 state[].kind == ConsensusFork.Phase0

View File

@ -213,7 +213,7 @@ suite "Gossip validation - Extra": # Not based on preset config
dag.addHeadBlock(verifier, blck.capellaData, nilCallback) dag.addHeadBlock(verifier, blck.capellaData, nilCallback)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const nilCallback = OnEIP4844BlockAdded(nil) const nilCallback = OnEIP4844BlockAdded(nil)
dag.addHeadBlock(verifier, blck.eip4844Data, nilCallback) dag.addHeadBlock(verifier, blck.denebData, nilCallback)
check: added.isOk() check: added.isOk()
dag.updateHead(added[], quarantine[], []) dag.updateHead(added[], quarantine[], [])
dag dag

View File

@ -78,7 +78,7 @@ suite "Light client" & preset():
dag.addHeadBlock(verifier, blck.capellaData, nilCallback) dag.addHeadBlock(verifier, blck.capellaData, nilCallback)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const nilCallback = OnEIP4844BlockAdded(nil) const nilCallback = OnEIP4844BlockAdded(nil)
dag.addHeadBlock(verifier, blck.eip4844Data, nilCallback) dag.addHeadBlock(verifier, blck.denebData, nilCallback)
check: added.isOk() check: added.isOk()
dag.updateHead(added[], quarantine, []) dag.updateHead(added[], quarantine, [])

View File

@ -65,7 +65,7 @@ suite "Light client processor" & preset():
dag.addHeadBlock(verifier, blck.capellaData, nilCallback) dag.addHeadBlock(verifier, blck.capellaData, nilCallback)
of ConsensusFork.Deneb: of ConsensusFork.Deneb:
const nilCallback = OnEIP4844BlockAdded(nil) const nilCallback = OnEIP4844BlockAdded(nil)
dag.addHeadBlock(verifier, blck.eip4844Data, nilCallback) dag.addHeadBlock(verifier, blck.denebData, nilCallback)
doAssert added.isOk() doAssert added.isOk()
dag.updateHead(added[], quarantine[], []) dag.updateHead(added[], quarantine[], [])