Add metrics and debug logging for dropped BLS to execution change messages

This commit is contained in:
Zahary Karadjov 2023-01-23 14:58:40 +01:00
parent 349001b7fb
commit 285eec6512
No known key found for this signature in database
GPG Key ID: C1F42EAFF38D570F
2 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,10 @@ declareCounter beacon_attester_slashings_received,
"Number of valid attester slashings processed by this node"
declareCounter beacon_attester_slashings_dropped,
"Number of invalid attester slashings dropped by this node", labels = ["reason"]
declareCounter bls_to_execution_change_received,
"Number of valid BLS to execution changes processed by this node"
declareCounter bls_to_execution_change_dropped,
"Number of invalid BLS to execution changes dropped by this node", labels = ["reason"]
declareCounter beacon_proposer_slashings_received,
"Number of valid proposer slashings processed by this node"
declareCounter beacon_proposer_slashings_dropped,
@ -408,6 +412,9 @@ proc processBlsToExecutionChange*(
if v.isOk():
trace "BLS to execution change validated"
self.validatorChangePool[].addMessage(blsToExecutionChange)
else:
debug "Dropping BLS to execution change", validationError = v.error
beacon_attester_slashings_dropped.inc(1, [$v.error[0]])
v

View File

@ -463,7 +463,8 @@ proc routeBlsToExecutionChange*(
MsgSource.api, bls_to_execution_change)
if not res.isGoodForSending:
warn "BLS to execution change request failed validation",
slashing = shortLog(bls_to_execution_change), error = res.error()
change = shortLog(bls_to_execution_change),
error = res.error()
return err(res.error()[1])
if router[].getCurrentBeaconTime().slotOrZero.epoch <