enable chronosStrictException (#3533)

* bump nim-json-rpc
This commit is contained in:
Jacek Sieka 2022-03-22 09:42:28 +01:00 committed by GitHub
parent 8cc394ba49
commit 4a237cb908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 4 deletions

View File

@ -184,7 +184,12 @@ proc sendDeposits*(deposits: seq[LaunchPadDeposit],
{.pop.} # TODO confutils.nim(775, 17) Error: can raise an unlisted exception: ref IOError
proc main() {.async.} =
var conf = CliConfig.load()
var conf = try: CliConfig.load()
except CatchableError as exc:
raise exc
except Exception as exc: # TODO fix confutils
raiseAssert exc.msg
let rng = keys.newRng()
if conf.cmd == StartUpCommand.generateSimulationDeposits:

View File

@ -164,7 +164,7 @@ type
PeerStateInitializer* = proc(peer: Peer): RootRef {.gcsafe, raises: [Defect].}
NetworkStateInitializer* = proc(network: EthereumNode): RootRef {.gcsafe, raises: [Defect].}
OnPeerConnectedHandler* = proc(peer: Peer, incoming: bool): Future[void] {.gcsafe.}
OnPeerConnectedHandler* = proc(peer: Peer, incoming: bool): Future[void] {.gcsafe, raises: [Defect].}
OnPeerDisconnectedHandler* = proc(peer: Peer): Future[void] {.gcsafe, raises: [Defect].}
ThunkProc* = LPProtoHandler
MounterProc* = proc(network: Eth2Node) {.gcsafe, raises: [Defect, CatchableError].}

View File

@ -1,2 +1,4 @@
# Use only `secp256k1` public key cryptography as an identity in LibP2P.
-d:"libp2p_pki_schemes=secp256k1"
-d:chronosStrictException

View File

@ -1090,7 +1090,13 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
# makes sure that all the scratch space we used during slot tasks (logging,
# temporary buffers etc) gets recycled for the next slot that is likely to
# need similar amounts of memory.
GC_fullCollect()
try:
GC_fullCollect()
except Defect as exc:
raise exc # Reraise to maintain call stack
except Exception as exc:
# TODO upstream
raiseAssert "Unexpected exception during GC collection"
# Checkpoint the database to clear the WAL file and make sure changes in
# the database are synced with the filesystem.

2
vendor/nim-json-rpc vendored

@ -1 +1 @@
Subproject commit 3a9b77146ac89fdcb0f37ea9875091936268a2e8
Subproject commit b4bab89abdde3653939abe36ab9f6cae4aa1cbd1