Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

dialyzer surgery #273

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

dialyzer surgery #273

wants to merge 3 commits into from

Conversation

evanmcc
Copy link
Contributor

@evanmcc evanmcc commented Apr 28, 2020

we have to abuse the type system a little here to get it to ignore the horrors we're committing for the pre-decode speedup.

src/peerbook/libp2p_peerbook.erl Outdated Show resolved Hide resolved
@@ -65,11 +65,6 @@

{shell, [{apps, [lager, ranch]}]}.

{dialyzer, [
{warnings, [unknown]},
Copy link
Member

Choose a reason for hiding this comment

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

I wasn't expecting you'd have to strip this section out after you fixed the abuse of handle_gossip_data?

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 had to get rid of this to get rid of the throttle errors I was seeing. maybe I didn't need to?

@@ -88,8 +88,7 @@ put(#peerbook{tid=TID, stale_time=StaleTime}=Handle, PeerList0, Prevalidated) ->
false -> lists:filter(fun libp2p_peer:verify/1, PeerList0)
end,
ThisPeerId = libp2p_swarm:pubkey_bin(TID),
%% XXX uncomment this to reject any peers publishing RFC1918 addresses once the network has transitioned over
AllowRFC1918 = true, %% is_rfc1918_allowed(TID),
AllowRFC1918 = is_rfc1918_allowed(TID),
Copy link
Contributor

Choose a reason for hiding this comment

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

We should check we don't have many peers advertising RFC1918 addresses before we merge this.

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'll check that tomorrow morning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants