[skip ci] Use GOSSIP_MAX_SIZE when snappy decoding in the inspector as well; Bumps

This commit is contained in:
Zahary Karadjov 2020-08-19 14:33:52 +03:00
parent 3433c77c35
commit 2c19e3f8cd
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
8 changed files with 12 additions and 13 deletions

View File

@ -198,13 +198,6 @@ const
TCP = net.Protocol.IPPROTO_TCP TCP = net.Protocol.IPPROTO_TCP
HandshakeTimeout = FaultOrError HandshakeTimeout = FaultOrError
# Spec constants
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/p2p-interface.md#eth2-network-interaction-domains
MAX_CHUNK_SIZE* = 1 * 1024 * 1024 # bytes
GOSSIP_MAX_SIZE* = 1 * 1024 * 1024 # bytes
TTFB_TIMEOUT* = 5.seconds
RESP_TIMEOUT* = 10.seconds
NewPeerScore* = 200 NewPeerScore* = 200
## Score which will be assigned to new connected Peer ## Score which will be assigned to new connected Peer
PeerScoreLowLimit* = 0 PeerScoreLowLimit* = 0

View File

@ -499,7 +499,7 @@ proc pubsubLogger(conf: InspectorConf, switch: Switch,
if conf.decode: if conf.decode:
if topic.endsWith("_snappy"): if topic.endsWith("_snappy"):
try: try:
buffer = snappy.decode(data) buffer = snappy.decode(data, GOSSIP_MAX_SIZE)
except CatchableError as exc: except CatchableError as exc:
warn "Unable to decompress message", errMsg = exc.msg warn "Unable to decompress message", errMsg = exc.msg
else: else:

View File

@ -22,6 +22,12 @@ const
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/validator.md#misc # https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/validator.md#misc
ATTESTATION_SUBNET_COUNT* = 64 ATTESTATION_SUBNET_COUNT* = 64
# https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/p2p-interface.md#eth2-network-interaction-domains
MAX_CHUNK_SIZE* = 1 * 1024 * 1024 # bytes
GOSSIP_MAX_SIZE* = 1 * 1024 * 1024 # bytes
TTFB_TIMEOUT* = 5.seconds
RESP_TIMEOUT* = 10.seconds
defaultEth2TcpPort* = 9000 defaultEth2TcpPort* = 9000
# This is not part of the spec yet! # This is not part of the spec yet!

View File

@ -13,7 +13,7 @@ import
stew/shims/[tables, macros], stew/shims/[tables, macros],
chronos, confutils, metrics, json_rpc/[rpcclient, jsonmarshal], chronos, confutils, metrics, json_rpc/[rpcclient, jsonmarshal],
chronicles, chronicles,
blscurve, json_serialization/std/[options, sets, net], json_serialization/std/[options, sets, net],
# Local modules # Local modules
spec/[datatypes, digest, crypto, helpers, network], spec/[datatypes, digest, crypto, helpers, network],

@ -1 +1 @@
Subproject commit 548e46b16db710dcfa4786216d72013cdef9d169 Subproject commit b60f70718f8039c5c86dfc2a4680d8c1e37cbce2

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit 7febbec673456773bd7f239c4ff5e87939dd5024 Subproject commit 73c1bb817c7be238566481878ac0bb0c8dfd8427

2
vendor/nim-libp2p vendored

@ -1 +1 @@
Subproject commit af0955c58b06998b73540195363e6833b1382b42 Subproject commit eb13845f6537a0af7564d3d4b535d88938eb104a

2
vendor/nim-snappy vendored

@ -1 +1 @@
Subproject commit a368549c1a473d2e580ac814f4c21342259ed9b6 Subproject commit 1e506c80a90e0776014dd23ccb28abdb24a1302a