Rebase and fixes.

This commit is contained in:
cheatfate 2021-04-03 04:50:47 +03:00 committed by zah
parent dba69f0ddf
commit 5885068c63
4 changed files with 8 additions and 5 deletions

View File

@ -292,7 +292,7 @@ type
name: "rest-port" }: Port name: "rest-port" }: Port
restAddress* {. restAddress* {.
defaultValue: defaultAdminListenAddress(config) defaultValue: defaultAdminListenAddress
desc: "Listening address of the REST server" desc: "Listening address of the REST server"
name: "rest-address" }: ValidIpAddress name: "rest-address" }: ValidIpAddress

View File

@ -73,7 +73,7 @@ type
# Almost validated, pending cryptographic signature check # Almost validated, pending cryptographic signature check
# ---------------------------------------------------------------- # ----------------------------------------------------------------
batchCrypto: ref BatchCrypto batchCrypto*: ref BatchCrypto
# Missing information # Missing information
# ---------------------------------------------------------------- # ----------------------------------------------------------------

View File

@ -752,8 +752,9 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) =
var failures: seq[RestAttestationsFailureTuple] var failures: seq[RestAttestationsFailureTuple]
for atindex, attestation in attestations.pairs(): for atindex, attestation in attestations.pairs():
let wallTime = node.processor.getWallTime() let wallTime = node.processor.getWallTime()
let res = node.attestationPool[].validateAttestation( let res = await node.attestationPool.validateAttestation(
attestation, wallTime, attestation.data.index, true node.processor.batchCrypto, attestation, wallTime,
attestation.data.index, true
) )
if res.isErr(): if res.isErr():
failures.add((index: uint64(atindex), message: $res.error())) failures.add((index: uint64(atindex), message: $res.error()))

View File

@ -323,7 +323,9 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
dres.get() dres.get()
let wallTime = node.processor.getWallTime() let wallTime = node.processor.getWallTime()
let res = node.attestationPool[].validateAggregate(payload, wallTime) let res = await node.attestationPool.validateAggregate(
node.processor.batchCrypto, payload, wallTime
)
if res.isErr(): if res.isErr():
return RestApiResponse.jsonError(Http400, "Aggregate and proofs " & return RestApiResponse.jsonError(Http400, "Aggregate and proofs " &
"verification failed", $res.error()) "verification failed", $res.error())