logging: raise some trace to debug, and gen proof args

This commit is contained in:
rymnc 2024-05-08 16:28:56 +05:30 committed by stubbsta
parent cf4f14e71f
commit 4f136a8676
No known key found for this signature in database
2 changed files with 11 additions and 5 deletions

View File

@ -3,8 +3,9 @@ import
../protocol_types, ../protocol_types,
../protocol_metrics, ../protocol_metrics,
../constants, ../constants,
../conversion_utils,
../rln ../rln
import options, chronos, stew/results, std/[deques, sequtils] import options, chronos, chronicles, stew/results, std/[deques, sequtils]
export options, chronos, results, protocol_types, protocol_metrics, deques export options, chronos, results, protocol_types, protocol_metrics, deques
@ -191,6 +192,12 @@ method generateProof*(
return err("membership index is not set") return err("membership index is not set")
if g.userMessageLimit.isNone(): if g.userMessageLimit.isNone():
return err("user message limit is not set") return err("user message limit is not set")
debug "generating proof params",
epoch = fromEpoch(epoch),
messageId = messageId,
userMessageLimit = g.userMessageLimit.get(),
idCommitment = inHex(g.idCredentials.get().idCommitment),
index = g.membershipIndex.get()
waku_rln_proof_generation_duration_seconds.nanosecondTime: waku_rln_proof_generation_duration_seconds.nanosecondTime:
let proof = proofGen( let proof = proofGen(
rlnInstance = g.rlnInstance, rlnInstance = g.rlnInstance,
@ -204,7 +211,6 @@ method generateProof*(
return err("proof generation failed: " & $error) return err("proof generation failed: " & $error)
return ok(proof) return ok(proof)
method isReady*(g: GroupManager): Future[bool] {.base, async.} = method isReady*(g: GroupManager): Future[bool] {.base, async.} =
raise newException( raise newException(
CatchableError, "isReady proc for " & $g.type & " is not implemented yet" CatchableError, "isReady proc for " & $g.type & " is not implemented yet"

View File

@ -357,7 +357,7 @@ proc generateRlnValidator*(
payload = string.fromBytes(message.payload) payload = string.fromBytes(message.payload)
case validationRes case validationRes
of Valid: of Valid:
trace "message validity is verified, relaying:", debug "message validity is verified, relaying:",
proof = proof, proof = proof,
root = root, root = root,
shareX = shareX, shareX = shareX,
@ -365,7 +365,7 @@ proc generateRlnValidator*(
nullifier = nullifier nullifier = nullifier
return pubsub.ValidationResult.Accept return pubsub.ValidationResult.Accept
of Invalid: of Invalid:
trace "message validity could not be verified, discarding:", debug "message validity could not be verified, discarding:",
proof = proof, proof = proof,
root = root, root = root,
shareX = shareX, shareX = shareX,
@ -373,7 +373,7 @@ proc generateRlnValidator*(
nullifier = nullifier nullifier = nullifier
return pubsub.ValidationResult.Reject return pubsub.ValidationResult.Reject
of Spam: of Spam:
trace "A spam message is found! yay! discarding:", debug "A spam message is found! yay! discarding:",
proof = proof, proof = proof,
root = root, root = root,
shareX = shareX, shareX = shareX,