-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
p2p: group peers by AS (bitcoin's asmap) #7935
base: master
Are you sure you want to change the base?
Conversation
Nice, another link #7090 |
When I looked into this, my issue was that we could not verify/recreate the provided database ... |
Thanks @vtnerd Just a couple question before closing this PR:
not even someone with a public AS number ? Does GeoIP databases suffers from the same problem ? |
I wouldn't close it yet. |
This PR doesn't deal with the generation of the mapping file and is not specific to Autonomous Systems, it "only" requires to associate CIDRs to an uint32. There are multiple ways to do it, but none perfect (due to how BGP/internet works). For example, this little python script shows 2 ways:
Unfortunately, Sipa's encoding, while quite efficient, doesn't seem to support partial mappings. For example with this mapping file, the lookup of
|
f813f29
to
c7d5f1b
Compare
As stated here, Sipa published new python scripts to encode the mapping file. The new version allows for partial mappings. Here's a sample usage to consider AWS as a single group (it falls back to /16 grouping for other IP addresses) : git clone https://github.com/sipa/asmap -b nextgen && cd asmap
curl https://ip-ranges.amazonaws.com/ip-ranges.json \
| jq -r ".prefixes| .[].ip_prefix" \
| sed "s/\$/ AS1/" \
| python3 asmap-tool.py encode > mapping.bin
monerod --asmap /apath/to/mapping.bin ... |
For visibility, comment reg licensing of this PR from ypdvim (to be confirmed/food for thought)
|
|
||
enum class Instruction : uint32_t | ||
{ | ||
RETURN = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR. I understand this part of the code comes from asmap file in Bitcoin source. But they have documentation for these in their .py
file.
We don't have any other file related to asmap. Can we have a comment explaining each Instruction in asmap format? I saw this and it looks very beautiful to me.
give more love to asmap ! |
Relevant links (and credits):