mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-24 05:22:03 +00:00
more capella (#4350)
This commit is contained in:
parent
8fa6064b9a
commit
1fceb33b2e
@ -917,13 +917,13 @@ func getSyncCommitteeSubnets(node: BeaconNode, epoch: Epoch): SyncnetBits =
|
|||||||
|
|
||||||
subnets + node.getNextSyncCommitteeSubnets(epoch)
|
subnets + node.getNextSyncCommitteeSubnets(epoch)
|
||||||
|
|
||||||
proc addAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
proc addAltairMessageHandlers(
|
||||||
|
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
||||||
node.addPhase0MessageHandlers(forkDigest, slot)
|
node.addPhase0MessageHandlers(forkDigest, slot)
|
||||||
|
|
||||||
# If this comes online near sync committee period, it'll immediately get
|
# If this comes online near sync committee period, it'll immediately get
|
||||||
# replaced as usual by trackSyncCommitteeTopics, which runs at slot end.
|
# replaced as usual by trackSyncCommitteeTopics, which runs at slot end.
|
||||||
let
|
let syncnets = node.getSyncCommitteeSubnets(slot.epoch)
|
||||||
syncnets = node.getSyncCommitteeSubnets(slot.epoch)
|
|
||||||
|
|
||||||
for subcommitteeIdx in SyncSubcommitteeIndex:
|
for subcommitteeIdx in SyncSubcommitteeIndex:
|
||||||
if syncnets[subcommitteeIdx]:
|
if syncnets[subcommitteeIdx]:
|
||||||
@ -935,6 +935,11 @@ proc addAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest, slot: Sl
|
|||||||
|
|
||||||
node.network.updateSyncnetsMetadata(syncnets)
|
node.network.updateSyncnetsMetadata(syncnets)
|
||||||
|
|
||||||
|
proc addCapellaMessageHandlers(
|
||||||
|
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
||||||
|
node.addAltairMessageHandlers(forkDigest, slot)
|
||||||
|
node.network.subscribe(getBlsToExecutionChangeTopic(forkDigest), basicParams)
|
||||||
|
|
||||||
proc removeAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
proc removeAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
||||||
node.removePhase0MessageHandlers(forkDigest)
|
node.removePhase0MessageHandlers(forkDigest)
|
||||||
|
|
||||||
@ -946,6 +951,10 @@ proc removeAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
|||||||
node.network.unsubscribe(
|
node.network.unsubscribe(
|
||||||
getSyncCommitteeContributionAndProofTopic(forkDigest))
|
getSyncCommitteeContributionAndProofTopic(forkDigest))
|
||||||
|
|
||||||
|
proc removeCapellaMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
|
||||||
|
node.removeAltairMessageHandlers(forkDigest)
|
||||||
|
node.network.unsubscribe(getBlsToExecutionChangeTopic(forkDigest))
|
||||||
|
|
||||||
proc updateSyncCommitteeTopics(node: BeaconNode, slot: Slot) =
|
proc updateSyncCommitteeTopics(node: BeaconNode, slot: Slot) =
|
||||||
template lastSyncUpdate: untyped =
|
template lastSyncUpdate: untyped =
|
||||||
node.consensusManager[].actionTracker.lastSyncUpdate
|
node.consensusManager[].actionTracker.lastSyncUpdate
|
||||||
@ -1082,7 +1091,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
|
|||||||
removePhase0MessageHandlers,
|
removePhase0MessageHandlers,
|
||||||
removeAltairMessageHandlers,
|
removeAltairMessageHandlers,
|
||||||
removeAltairMessageHandlers, # with different forkDigest
|
removeAltairMessageHandlers, # with different forkDigest
|
||||||
if capellaImplementationMissing: removeAltairMessageHandlers else: removeAltairMessageHandlers
|
removeCapellaMessageHandlers
|
||||||
]
|
]
|
||||||
|
|
||||||
for gossipFork in oldGossipForks:
|
for gossipFork in oldGossipForks:
|
||||||
@ -1092,7 +1101,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
|
|||||||
addPhase0MessageHandlers,
|
addPhase0MessageHandlers,
|
||||||
addAltairMessageHandlers,
|
addAltairMessageHandlers,
|
||||||
addAltairMessageHandlers, # with different forkDigest
|
addAltairMessageHandlers, # with different forkDigest
|
||||||
if capellaImplementationMissing: addAltairMessageHandlers else: addAltairMessageHandlers
|
addCapellaMessageHandlers
|
||||||
]
|
]
|
||||||
|
|
||||||
for gossipFork in newGossipForks:
|
for gossipFork in newGossipForks:
|
||||||
|
@ -296,11 +296,8 @@ proc getBlockRefOptimistic*(node: BeaconNode, blck: BlockRef): bool =
|
|||||||
case blck.kind
|
case blck.kind
|
||||||
of BeaconBlockFork.Phase0, BeaconBlockFork.Altair:
|
of BeaconBlockFork.Phase0, BeaconBlockFork.Altair:
|
||||||
false
|
false
|
||||||
of BeaconBlockFork.Bellatrix:
|
of BeaconBlockFork.Bellatrix, BeaconBlockFork.Capella:
|
||||||
node.dag.is_optimistic(blck.root)
|
node.dag.is_optimistic(blck.root)
|
||||||
of BeaconBlockFork.Capella:
|
|
||||||
if true: raiseAssert $capellaImplementationMissing
|
|
||||||
true
|
|
||||||
|
|
||||||
const
|
const
|
||||||
jsonMediaType* = MediaType.init("application/json")
|
jsonMediaType* = MediaType.init("application/json")
|
||||||
|
@ -1075,7 +1075,19 @@ proc readValue*[BlockType: Web3SignerForkedBeaconBlock](
|
|||||||
kind: BeaconBlockFork.Bellatrix,
|
kind: BeaconBlockFork.Bellatrix,
|
||||||
bellatrixData: res.get())
|
bellatrixData: res.get())
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
reader.raiseUnexpectedValue($capellaImplementationMissing)
|
let res =
|
||||||
|
try:
|
||||||
|
some(RestJson.decode(string(data.get()),
|
||||||
|
BeaconBlockHeader,
|
||||||
|
requireAllFields = true,
|
||||||
|
allowUnknownFields = true))
|
||||||
|
except SerializationError:
|
||||||
|
none[BeaconBlockHeader]()
|
||||||
|
if res.isNone():
|
||||||
|
reader.raiseUnexpectedValue("Incorrect capella block format")
|
||||||
|
value = Web3SignerForkedBeaconBlock(
|
||||||
|
kind: BeaconBlockFork.Capella,
|
||||||
|
capellaData: res.get())
|
||||||
|
|
||||||
proc writeValue*[
|
proc writeValue*[
|
||||||
BlockType: Web3SignerForkedBeaconBlock|ForkedBeaconBlock|ForkedBlindedBeaconBlock](
|
BlockType: Web3SignerForkedBeaconBlock|ForkedBeaconBlock|ForkedBlindedBeaconBlock](
|
||||||
@ -1201,6 +1213,7 @@ proc readValue*(reader: var JsonReader[RestJson],
|
|||||||
if voluntary_exits.isNone():
|
if voluntary_exits.isNone():
|
||||||
reader.raiseUnexpectedValue("Field `voluntary_exits` is missing")
|
reader.raiseUnexpectedValue("Field `voluntary_exits` is missing")
|
||||||
|
|
||||||
|
discard $capellaImplementationMissing & ": autodetect via added field"
|
||||||
let bodyKind =
|
let bodyKind =
|
||||||
if execution_payload.isSome() and sync_aggregate.isSome():
|
if execution_payload.isSome() and sync_aggregate.isSome():
|
||||||
BeaconBlockFork.Bellatrix
|
BeaconBlockFork.Bellatrix
|
||||||
@ -1344,7 +1357,15 @@ proc readValue*(reader: var JsonReader[RestJson],
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
reader.raiseUnexpectedValue($capellaImplementationMissing)
|
ForkedBeaconBlock.init(
|
||||||
|
capella.BeaconBlock(
|
||||||
|
slot: slot.get(),
|
||||||
|
proposer_index: proposer_index.get(),
|
||||||
|
parent_root: parent_root.get(),
|
||||||
|
state_root: state_root.get(),
|
||||||
|
body: body.capellaBody
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
## RestPublishedSignedBeaconBlock
|
## RestPublishedSignedBeaconBlock
|
||||||
@ -1483,7 +1504,17 @@ proc readValue*(reader: var JsonReader[RestJson],
|
|||||||
reader.raiseUnexpectedValue("Incorrect bellatrix block format")
|
reader.raiseUnexpectedValue("Incorrect bellatrix block format")
|
||||||
value = ForkedSignedBeaconBlock.init(res.get())
|
value = ForkedSignedBeaconBlock.init(res.get())
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
reader.raiseUnexpectedValue($capellaImplementationMissing)
|
let res =
|
||||||
|
try:
|
||||||
|
some(RestJson.decode(string(data.get()),
|
||||||
|
capella.SignedBeaconBlock,
|
||||||
|
requireAllFields = true,
|
||||||
|
allowUnknownFields = true))
|
||||||
|
except SerializationError:
|
||||||
|
none[capella.SignedBeaconBlock]()
|
||||||
|
if res.isNone():
|
||||||
|
reader.raiseUnexpectedValue("Incorrect capella block format")
|
||||||
|
value = ForkedSignedBeaconBlock.init(res.get())
|
||||||
withBlck(value):
|
withBlck(value):
|
||||||
blck.root = hash_tree_root(blck.message)
|
blck.root = hash_tree_root(blck.message)
|
||||||
|
|
||||||
@ -1584,10 +1615,18 @@ proc readValue*(reader: var JsonReader[RestJson],
|
|||||||
requireAllFields = true,
|
requireAllFields = true,
|
||||||
allowUnknownFields = true)
|
allowUnknownFields = true)
|
||||||
except SerializationError:
|
except SerializationError:
|
||||||
reader.raiseUnexpectedValue("Incorrect altair beacon state format")
|
reader.raiseUnexpectedValue("Incorrect bellatrix beacon state format")
|
||||||
toValue(bellatrixData)
|
toValue(bellatrixData)
|
||||||
of BeaconStateFork.Capella:
|
of BeaconStateFork.Capella:
|
||||||
reader.raiseUnexpectedValue($capellaImplementationMissing)
|
try:
|
||||||
|
tmp[].capellaData.data = RestJson.decode(
|
||||||
|
string(data.get()),
|
||||||
|
capella.BeaconState,
|
||||||
|
requireAllFields = true,
|
||||||
|
allowUnknownFields = true)
|
||||||
|
except SerializationError:
|
||||||
|
reader.raiseUnexpectedValue("Incorrect capella beacon state format")
|
||||||
|
toValue(capellaData)
|
||||||
|
|
||||||
proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconState)
|
proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconState)
|
||||||
{.raises: [IOError, Defect].} =
|
{.raises: [IOError, Defect].} =
|
||||||
@ -2495,7 +2534,14 @@ proc decodeBody*(
|
|||||||
return err("Unexpected deserialization error")
|
return err("Unexpected deserialization error")
|
||||||
ok(RestPublishedSignedBeaconBlock(ForkedSignedBeaconBlock.init(blck)))
|
ok(RestPublishedSignedBeaconBlock(ForkedSignedBeaconBlock.init(blck)))
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
return err($capellaImplementationMissing)
|
let blck =
|
||||||
|
try:
|
||||||
|
SSZ.decode(body.data, capella.SignedBeaconBlock)
|
||||||
|
except SerializationError:
|
||||||
|
return err("Unable to deserialize data")
|
||||||
|
except CatchableError:
|
||||||
|
return err("Unexpected deserialization error")
|
||||||
|
ok(RestPublishedSignedBeaconBlock(ForkedSignedBeaconBlock.init(blck)))
|
||||||
else:
|
else:
|
||||||
return err("Unsupported or invalid content media type")
|
return err("Unsupported or invalid content media type")
|
||||||
|
|
||||||
|
@ -262,10 +262,10 @@ type
|
|||||||
|
|
||||||
RestPublishedBeaconBlockBody* = object
|
RestPublishedBeaconBlockBody* = object
|
||||||
case kind*: BeaconBlockFork
|
case kind*: BeaconBlockFork
|
||||||
of BeaconBlockFork.Phase0: phase0Body*: phase0.BeaconBlockBody
|
of BeaconBlockFork.Phase0: phase0Body*: phase0.BeaconBlockBody
|
||||||
of BeaconBlockFork.Altair: altairBody*: altair.BeaconBlockBody
|
of BeaconBlockFork.Altair: altairBody*: altair.BeaconBlockBody
|
||||||
of BeaconBlockFork.Bellatrix: bellatrixBody*: bellatrix.BeaconBlockBody
|
of BeaconBlockFork.Bellatrix: bellatrixBody*: bellatrix.BeaconBlockBody
|
||||||
of BeaconBlockFork.Capella: cappellaBody*: capella.BeaconBlockBody
|
of BeaconBlockFork.Capella: capellaBody*: capella.BeaconBlockBody
|
||||||
|
|
||||||
RestSpec* = object
|
RestSpec* = object
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/presets/mainnet/phase0.yaml
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/presets/mainnet/phase0.yaml
|
||||||
|
@ -384,9 +384,8 @@ proc emptyPayloadToBlockHeader*(
|
|||||||
fee : some payload.base_fee_per_gas
|
fee : some payload.base_fee_per_gas
|
||||||
)
|
)
|
||||||
|
|
||||||
func build_empty_execution_payload*(
|
func build_empty_execution_payload*[BS, EP](
|
||||||
state: bellatrix.BeaconState,
|
state: BS, feeRecipient: Eth1Address): EP =
|
||||||
feeRecipient: Eth1Address): bellatrix.ExecutionPayload =
|
|
||||||
## Assuming a pre-state of the same slot, build a valid ExecutionPayload
|
## Assuming a pre-state of the same slot, build a valid ExecutionPayload
|
||||||
## without any transactions.
|
## without any transactions.
|
||||||
let
|
let
|
||||||
@ -397,7 +396,7 @@ func build_empty_execution_payload*(
|
|||||||
GasInt.saturate latest.gas_used,
|
GasInt.saturate latest.gas_used,
|
||||||
latest.base_fee_per_gas)
|
latest.base_fee_per_gas)
|
||||||
|
|
||||||
var payload = bellatrix.ExecutionPayload(
|
var payload = EP(
|
||||||
parent_hash: latest.block_hash,
|
parent_hash: latest.block_hash,
|
||||||
fee_recipient: bellatrix.ExecutionAddress(data: distinctBase(feeRecipient)),
|
fee_recipient: bellatrix.ExecutionAddress(data: distinctBase(feeRecipient)),
|
||||||
state_root: latest.state_root, # no changes to the state
|
state_root: latest.state_root, # no changes to the state
|
||||||
|
@ -18,11 +18,13 @@ export base
|
|||||||
|
|
||||||
const
|
const
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/phase0/p2p-interface.md#topics-and-messages
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/phase0/p2p-interface.md#topics-and-messages
|
||||||
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/capella/p2p-interface.md#topics-and-messages
|
||||||
topicBeaconBlocksSuffix* = "beacon_block/ssz_snappy"
|
topicBeaconBlocksSuffix* = "beacon_block/ssz_snappy"
|
||||||
topicVoluntaryExitsSuffix* = "voluntary_exit/ssz_snappy"
|
topicVoluntaryExitsSuffix* = "voluntary_exit/ssz_snappy"
|
||||||
topicProposerSlashingsSuffix* = "proposer_slashing/ssz_snappy"
|
topicProposerSlashingsSuffix* = "proposer_slashing/ssz_snappy"
|
||||||
topicAttesterSlashingsSuffix* = "attester_slashing/ssz_snappy"
|
topicAttesterSlashingsSuffix* = "attester_slashing/ssz_snappy"
|
||||||
topicAggregateAndProofsSuffix* = "beacon_aggregate_and_proof/ssz_snappy"
|
topicAggregateAndProofsSuffix* = "beacon_aggregate_and_proof/ssz_snappy"
|
||||||
|
topicBlsToExecutionChangeSuffix* = "bls_to_execution_change/ssz_snappy"
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.2/specs/phase0/p2p-interface.md#configuration
|
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.2/specs/phase0/p2p-interface.md#configuration
|
||||||
MAX_CHUNK_SIZE* = 1 * 1024 * 1024 # bytes
|
MAX_CHUNK_SIZE* = 1 * 1024 * 1024 # bytes
|
||||||
@ -63,6 +65,10 @@ func getAttesterSlashingsTopic*(forkDigest: ForkDigest): string =
|
|||||||
func getAggregateAndProofsTopic*(forkDigest: ForkDigest): string =
|
func getAggregateAndProofsTopic*(forkDigest: ForkDigest): string =
|
||||||
eth2Prefix(forkDigest) & topicAggregateAndProofsSuffix
|
eth2Prefix(forkDigest) & topicAggregateAndProofsSuffix
|
||||||
|
|
||||||
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.1/specs/capella/p2p-interface.md#topics-and-messages
|
||||||
|
func getBlsToExecutionChangeTopic*(forkDigest: ForkDigest): string =
|
||||||
|
eth2Prefix(forkDigest) & topicBlsToExecutionChangeSuffix
|
||||||
|
|
||||||
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/phase0/validator.md#broadcast-attestation
|
# https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.0/specs/phase0/validator.md#broadcast-attestation
|
||||||
func compute_subnet_for_attestation*(
|
func compute_subnet_for_attestation*(
|
||||||
committees_per_slot: uint64, slot: Slot, committee_index: CommitteeIndex):
|
committees_per_slot: uint64, slot: Slot, committee_index: CommitteeIndex):
|
||||||
|
@ -1735,7 +1735,7 @@ proc publishBlock*(
|
|||||||
of BeaconBlockFork.Bellatrix:
|
of BeaconBlockFork.Bellatrix:
|
||||||
publishBlock(it, data.bellatrixData)
|
publishBlock(it, data.bellatrixData)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
raiseAssert $capellaImplementationMissing
|
publishBlock(it, data.capellaData)
|
||||||
do:
|
do:
|
||||||
if apiResponse.isErr():
|
if apiResponse.isErr():
|
||||||
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
||||||
@ -1880,7 +1880,7 @@ proc publishBlindedBlock*(
|
|||||||
of BeaconBlockFork.Bellatrix:
|
of BeaconBlockFork.Bellatrix:
|
||||||
publishBlindedBlock(it, data.bellatrixData)
|
publishBlindedBlock(it, data.bellatrixData)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
raiseAssert $capellaImplementationMissing
|
publishBlindedBlock(it, data.capellaData)
|
||||||
do:
|
do:
|
||||||
if apiResponse.isErr():
|
if apiResponse.isErr():
|
||||||
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
||||||
@ -1929,7 +1929,7 @@ proc publishBlindedBlock*(
|
|||||||
of BeaconBlockFork.Bellatrix:
|
of BeaconBlockFork.Bellatrix:
|
||||||
publishBlindedBlock(it, data.bellatrixData)
|
publishBlindedBlock(it, data.bellatrixData)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
raiseAssert $capellaImplementationMissing
|
publishBlindedBlock(it, data.capellaData)
|
||||||
do:
|
do:
|
||||||
if apiResponse.isErr():
|
if apiResponse.isErr():
|
||||||
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
debug ErrorMessage, endpoint = node, error = apiResponse.error()
|
||||||
|
@ -19,7 +19,7 @@ import
|
|||||||
std/[os, tables],
|
std/[os, tables],
|
||||||
|
|
||||||
# Nimble packages
|
# Nimble packages
|
||||||
stew/[byteutils, objects],
|
stew/byteutils,
|
||||||
chronos, metrics,
|
chronos, metrics,
|
||||||
chronicles, chronicles/timings,
|
chronicles, chronicles/timings,
|
||||||
json_serialization/std/[options, sets, net],
|
json_serialization/std/[options, sets, net],
|
||||||
@ -388,10 +388,9 @@ proc getExecutionPayload[T](
|
|||||||
|
|
||||||
template empty_execution_payload(): auto =
|
template empty_execution_payload(): auto =
|
||||||
withState(proposalState[]):
|
withState(proposalState[]):
|
||||||
when stateFork >= BeaconStateFork.Capella:
|
when stateFork >= BeaconStateFork.Bellatrix:
|
||||||
raiseAssert $capellaImplementationMissing & ": beacon_chain/validators/validator_duties.nim: getExecutionPayload"
|
build_empty_execution_payload[typeof forkyState.data, T](
|
||||||
elif stateFork >= BeaconStateFork.Bellatrix:
|
forkyState.data, feeRecipient)
|
||||||
build_empty_execution_payload(forkyState.data, feeRecipient)
|
|
||||||
else:
|
else:
|
||||||
default(T)
|
default(T)
|
||||||
|
|
||||||
|
@ -354,7 +354,9 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||||||
kind: BeaconBlockFork.Bellatrix,
|
kind: BeaconBlockFork.Bellatrix,
|
||||||
bellatrixData: blck.bellatrixData.toBeaconBlockHeader)
|
bellatrixData: blck.bellatrixData.toBeaconBlockHeader)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
raiseAssert $capellaImplementationMissing
|
Web3SignerForkedBeaconBlock(
|
||||||
|
kind: BeaconBlockFork.Capella,
|
||||||
|
capellaData: blck.capellaData.toBeaconBlockHeader)
|
||||||
|
|
||||||
request = Web3SignerRequest.init(
|
request = Web3SignerRequest.init(
|
||||||
fork, genesis_validators_root, web3SignerBlock)
|
fork, genesis_validators_root, web3SignerBlock)
|
||||||
@ -383,7 +385,9 @@ proc getBlockSignature*(v: AttachedValidator, fork: Fork,
|
|||||||
kind: BeaconBlockFork.Bellatrix,
|
kind: BeaconBlockFork.Bellatrix,
|
||||||
bellatrixData: blck.bellatrixData.toBeaconBlockHeader)
|
bellatrixData: blck.bellatrixData.toBeaconBlockHeader)
|
||||||
of BeaconBlockFork.Capella:
|
of BeaconBlockFork.Capella:
|
||||||
raiseAssert $capellaImplementationMissing & "beacon_chain/validators/validator_pool.nim: getBlockSignature"
|
Web3SignerForkedBeaconBlock(
|
||||||
|
kind: BeaconBlockFork.Capella,
|
||||||
|
capellaData: blck.capellaData.toBeaconBlockHeader)
|
||||||
|
|
||||||
request = Web3SignerRequest.init(
|
request = Web3SignerRequest.init(
|
||||||
fork, genesis_validators_root, web3SignerBlock)
|
fork, genesis_validators_root, web3SignerBlock)
|
||||||
|
@ -70,7 +70,9 @@ suite "Spec helpers":
|
|||||||
|
|
||||||
template testCase(recipient: Eth1Address): untyped =
|
template testCase(recipient: Eth1Address): untyped =
|
||||||
block:
|
block:
|
||||||
let payload = build_empty_execution_payload(state[].data, recipient)
|
let payload = build_empty_execution_payload[
|
||||||
|
typeof state[].data, bellatrix.ExecutionPayload](
|
||||||
|
state[].data, recipient)
|
||||||
check payload.fee_recipient ==
|
check payload.fee_recipient ==
|
||||||
bellatrix.ExecutionAddress(data: distinctBase(recipient))
|
bellatrix.ExecutionAddress(data: distinctBase(recipient))
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ suite "Honest validator":
|
|||||||
getProposerSlashingsTopic(forkDigest) == "/eth2/00000000/proposer_slashing/ssz_snappy"
|
getProposerSlashingsTopic(forkDigest) == "/eth2/00000000/proposer_slashing/ssz_snappy"
|
||||||
getAttesterSlashingsTopic(forkDigest) == "/eth2/00000000/attester_slashing/ssz_snappy"
|
getAttesterSlashingsTopic(forkDigest) == "/eth2/00000000/attester_slashing/ssz_snappy"
|
||||||
getAggregateAndProofsTopic(forkDigest) == "/eth2/00000000/beacon_aggregate_and_proof/ssz_snappy"
|
getAggregateAndProofsTopic(forkDigest) == "/eth2/00000000/beacon_aggregate_and_proof/ssz_snappy"
|
||||||
|
getBlsToExecutionChangeTopic(forkDigest) == "/eth2/00000000/bls_to_execution_change/ssz_snappy"
|
||||||
getSyncCommitteeContributionAndProofTopic(forkDigest) == "/eth2/00000000/sync_committee_contribution_and_proof/ssz_snappy"
|
getSyncCommitteeContributionAndProofTopic(forkDigest) == "/eth2/00000000/sync_committee_contribution_and_proof/ssz_snappy"
|
||||||
getLightClientFinalityUpdateTopic(forkDigest) == "/eth2/00000000/light_client_finality_update/ssz_snappy"
|
getLightClientFinalityUpdateTopic(forkDigest) == "/eth2/00000000/light_client_finality_update/ssz_snappy"
|
||||||
getLightClientOptimisticUpdateTopic(forkDigest) == "/eth2/00000000/light_client_optimistic_update/ssz_snappy"
|
getLightClientOptimisticUpdateTopic(forkDigest) == "/eth2/00000000/light_client_optimistic_update/ssz_snappy"
|
||||||
|
@ -146,7 +146,9 @@ proc addTestBlock*(
|
|||||||
cfg.BELLATRIX_FORK_EPOCH * SLOTS_PER_EPOCH + 10:
|
cfg.BELLATRIX_FORK_EPOCH * SLOTS_PER_EPOCH + 10:
|
||||||
if is_merge_transition_complete(forkyState.data):
|
if is_merge_transition_complete(forkyState.data):
|
||||||
const feeRecipient = default(Eth1Address)
|
const feeRecipient = default(Eth1Address)
|
||||||
build_empty_execution_payload(forkyState.data, feeRecipient)
|
build_empty_execution_payload[
|
||||||
|
bellatrix.BeaconState, bellatrix.ExecutionPayload](
|
||||||
|
forkyState.data, feeRecipient)
|
||||||
else:
|
else:
|
||||||
build_empty_merge_execution_payload(forkyState.data)
|
build_empty_merge_execution_payload(forkyState.data)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user