Fixed block proposal signature domain
This commit is contained in:
parent
1e574cf75a
commit
f1f1beb703
|
@ -225,7 +225,7 @@ proc proposeBlock(node: BeaconNode,
|
|||
shard: BEACON_CHAIN_SHARD_NUMBER,
|
||||
blockRoot: hash_tree_root_final(newBlock))
|
||||
|
||||
newBlock.signature = await validator.signBlockProposal(signedData)
|
||||
newBlock.signature = await validator.signBlockProposal(node.beaconState.fork, signedData)
|
||||
|
||||
await node.network.broadcast(topicBeaconBlocks, newBlock)
|
||||
|
||||
|
|
|
@ -43,16 +43,15 @@ proc getValidator*(pool: ValidatorPool,
|
|||
validatorKey: ValidatorPubKey): AttachedValidator =
|
||||
pool.validators.getOrDefault(validatorKey)
|
||||
|
||||
proc signBlockProposal*(v: AttachedValidator,
|
||||
proc signBlockProposal*(v: AttachedValidator, fork: Fork,
|
||||
proposal: ProposalSignedData): Future[ValidatorSig] {.async.} =
|
||||
if v.kind == inProcess:
|
||||
await sleepAsync(1)
|
||||
let proposalRoot = hash_tree_root_final(proposal)
|
||||
|
||||
# TODO: Should we use proposalRoot as data, or digest in regards to signature?
|
||||
# TODO: Use `domain` here
|
||||
let domain = 0'u64
|
||||
result = bls_sign(v.privKey, proposalRoot.data, domain)
|
||||
result = bls_sign(v.privKey, proposalRoot.data,
|
||||
get_domain(fork, proposal.slot, DOMAIN_PROPOSAL))
|
||||
else:
|
||||
# TODO:
|
||||
# send RPC
|
||||
|
|
Loading…
Reference in New Issue