Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump libp2p #3438

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions beacon_chain/networking/eth2_network.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1900,17 +1900,17 @@ proc createEth2Node*(rng: ref BrHmacDrbgContext,

let altairPrefix = "/eth2/" & $forkDigests.altair

func msgIdProvider(m: messages.Message): seq[byte] =
func msgIdProvider(m: messages.Message): Result[seq[byte], ValidationResult] =
template topic: untyped =
if m.topicIDs.len > 0: m.topicIDs[0] else: ""

try:
# This doesn't have to be a tight bound, just enough to avoid denial of
# service attacks.
let decoded = snappy.decode(m.data, maxGossipMaxSize())
gossipId(decoded, altairPrefix, topic, true)
ok(gossipId(decoded, altairPrefix, topic, true))
except CatchableError:
gossipId(m.data, altairPrefix, topic, false)
ok(gossipId(m.data, altairPrefix, topic, false))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can reject with penalty here - it's junk data and keeping it in the message caches isn't going to make anyone happy - it also means we can remove the false path from gossipId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like for the bump to only bump, and not change this behavior
We can do that in a later PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm .. with strict exception checking, we can probably get rid of some exception handlers as well which is nice


let
params = GossipSubParams(
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-libp2p