mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-11 06:46:10 +00:00
log slashing protection database error on failure to load (#5542)
* log slashing protection database error on failure to load ...and fix noreturn warning * fix the copied one too * oops * oops 2
This commit is contained in:
parent
d289da8cd4
commit
8c81515bf6
@ -72,7 +72,7 @@ proc unblindAndRouteBlockMEV*(
|
||||
if hash_tree_root(
|
||||
blindedBlock.message.body.execution_payload_header) !=
|
||||
hash_tree_root(unblindedPayload.data.data):
|
||||
return err("unblinded payload doesn't match blinded payload header: " &
|
||||
err("unblinded payload doesn't match blinded payload header: " &
|
||||
$blindedBlock.message.body.execution_payload_header)
|
||||
else:
|
||||
# Signature provided is consistent with unblinded execution payload,
|
||||
@ -107,19 +107,17 @@ proc unblindAndRouteBlockMEV*(
|
||||
blockRoot = shortLog(signedBlock.root), blck = shortLog(signedBlock),
|
||||
signature = shortLog(signedBlock.signature)
|
||||
|
||||
return ok newBlockRef
|
||||
ok newBlockRef
|
||||
else:
|
||||
return err("submitBlindedBlock failed with HTTP error code" &
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
# `BlindedBeaconBlock` (via a dissemination of a
|
||||
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
|
||||
# local build process as a fallback, even in the event of some failure
|
||||
# with the external builder network.
|
||||
err("submitBlindedBlock failed with HTTP error code" &
|
||||
$unblindedPayload.status & ": " & $shortLog(blindedBlock))
|
||||
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
# `BlindedBeaconBlock` (via a dissemination of a
|
||||
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
|
||||
# local build process as a fallback, even in the event of some failure
|
||||
# with the external builder network.
|
||||
return err("unblindAndRouteBlockMEV error")
|
||||
|
||||
# TODO currently cannot be combined into one generic function
|
||||
proc unblindAndRouteBlockMEV*(
|
||||
node: BeaconNode, payloadBuilderRestClient: RestClientRef,
|
||||
@ -150,7 +148,7 @@ proc unblindAndRouteBlockMEV*(
|
||||
if hash_tree_root(
|
||||
blindedBlock.message.body.execution_payload_header) !=
|
||||
hash_tree_root(unblindedPayload.data.data.execution_payload):
|
||||
return err("unblinded payload doesn't match blinded payload header: " &
|
||||
err("unblinded payload doesn't match blinded payload header: " &
|
||||
$blindedBlock.message.body.execution_payload_header)
|
||||
else:
|
||||
# Signature provided is consistent with unblinded execution payload,
|
||||
@ -189,14 +187,14 @@ proc unblindAndRouteBlockMEV*(
|
||||
|
||||
discard $denebImplementationMissing & ": route unblinded blobs"
|
||||
|
||||
return ok newBlockRef
|
||||
ok newBlockRef
|
||||
else:
|
||||
return err("submitBlindedBlock failed with HTTP error code" &
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
# `BlindedBeaconBlock` (via a dissemination of a
|
||||
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
|
||||
# local build process as a fallback, even in the event of some failure
|
||||
# with the external builder network.
|
||||
err("submitBlindedBlock failed with HTTP error code" &
|
||||
$unblindedPayload.status & ": " & $shortLog(blindedBlock))
|
||||
|
||||
# https://github.com/ethereum/builder-specs/blob/v0.3.0/specs/bellatrix/validator.md#proposer-slashing
|
||||
# This means if a validator publishes a signature for a
|
||||
# `BlindedBeaconBlock` (via a dissemination of a
|
||||
# `SignedBlindedBeaconBlock`) then the validator **MUST** not use the
|
||||
# local build process as a fallback, even in the event of some failure
|
||||
# with the external builder network.
|
||||
|
@ -674,8 +674,9 @@ proc initCompatV1*(
|
||||
|
||||
let
|
||||
alreadyExists = fileExists(databasePath / databaseName & ".sqlite3")
|
||||
backend = SqStoreRef.init(databasePath, databaseName).valueOr:
|
||||
fatal "Failed to open slashing protection database"
|
||||
backendRes = SqStoreRef.init(databasePath, databaseName)
|
||||
backend = backendRes.valueOr: # TODO https://github.com/nim-lang/Nim/issues/22605
|
||||
fatal "Failed to open slashing protection database", err = backendRes.error
|
||||
quit 1
|
||||
|
||||
result.db = T(backend: backend)
|
||||
@ -716,9 +717,10 @@ proc init*(T: type SlashingProtectionDB_v2,
|
||||
|
||||
let
|
||||
alreadyExists = fileExists(databasePath / databaseName & ".sqlite3")
|
||||
backend = SqStoreRef.init(databasePath, databaseName,
|
||||
keyspaces = []).valueOr:
|
||||
fatal "Failed to open slashing protection database"
|
||||
backendRes = SqStoreRef.init(databasePath, databaseName,
|
||||
keyspaces = [])
|
||||
backend = backendRes.valueOr: # TODO https://github.com/nim-lang/Nim/issues/22605
|
||||
fatal "Failed to open slashing protection database", err = backendRes.error
|
||||
quit 1
|
||||
|
||||
result = T(backend: backend)
|
||||
|
Loading…
x
Reference in New Issue
Block a user