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

Add community run bootnodes to ensure Chaos Unicorn Day Resistance #1616

Closed
oskarth opened this issue Sep 23, 2019 · 40 comments
Closed

Add community run bootnodes to ensure Chaos Unicorn Day Resistance #1616

oskarth opened this issue Sep 23, 2019 · 40 comments

Comments

@oskarth
Copy link
Contributor

oskarth commented Sep 23, 2019

Problem

If all our servers are down, e.g. during a Chaos Unicorn Day event, Status stops functioning. This is due to all bootnodes being hosted by us. It'd be good to have this in v1 since we'll likely want to do a CUD fairly soon.

Implementation

Issue PR that updates default bootnodes with community (Status core contributors primarily) run nodes.

Acceptance Criteria

Things still work. Bootnode can be connected to.

Notes

See https://discuss.status.im/t/increasing-bootstrap-node-diversity-kiss-edition/1138

Future Steps

@oskarth
Copy link
Contributor Author

oskarth commented Sep 23, 2019

@corpetty
Copy link
Contributor

thoughts on using a smart contract repository to register nodes?

@cammellos
Copy link
Member

cammellos commented Sep 23, 2019 via email

@corpetty
Copy link
Contributor

thoughts on including the same curve dynamics dapp discovery uses? so a misbehaving node can be downvoted, but all staked with SNT

@oskarth
Copy link
Contributor Author

oskarth commented Sep 23, 2019

I think that's a great idea to explore, but not for v1. Too many unknowns and risk factors imo. I'd rather keep it as simple as possible, and we can extend in iteration after.

@corpetty
Copy link
Contributor

agreed

@cammellos
Copy link
Member

cammellos commented Sep 23, 2019 via email

@Swader
Copy link

Swader commented Sep 24, 2019

thoughts on using a smart contract repository to register nodes?

you need to be in sync with the network to read the contract though, so kind of a catch 22?

@cammellos
Copy link
Member

cammellos commented Sep 24, 2019

kind of, you need to ask a synced node, if we were to use this strategy service nodes would be expected to be synced with the ethereum chain, so that you have a few options:

  1. Ask any synced node
  2. Use services such as infura
  3. Fallback on an hardcoded list of bootnodes (at which point you can ask for the contract list if you wish)

This is no different from ethereum, ultimately we will need a list of hardcoded bootnodes/contract address

@oskarth
Copy link
Contributor Author

oskarth commented Oct 22, 2019

Ping @jacqueswww any luck with this? @adambabik are all the docs up to date here? I believe there were some issues running a node but don't know details.

Also cc @3esmit and fyi @andremedeiros

@3esmit
Copy link
Member

3esmit commented Oct 22, 2019

How we would deal with dynamic IPs?
I would happily run a bootnode, but my IP changes every time the modem connects with ISP. I also get disconnects from ISP and return with different IP.

@oskarth
Copy link
Contributor Author

oskarth commented Oct 23, 2019

That is indeed a problem. With the current architecture, it is recommended you have a static IP. The cluster has specific static IPs (decoupled from ad hoc VPSes) for that reason. No worries!

@corpetty
Copy link
Contributor

I'd love to find a way to handle dynamic IPs. It is $500 for a static IP from my provider. Most webservices get around this through proxy services like dyndns, but AFAIK our node discovery only takes IPs.

@corpetty
Copy link
Contributor

I wonder if something like handshake could help with this.

@Swader
Copy link

Swader commented Oct 23, 2019

Mobile routers connecting with data-only SIM cards generally have static IPs if they stay put in an area. I have one such router running on my nodes and it costs $20 per month for flat rate 4G. I don't know how other countries handle this but maybe look into it.

@3esmit
Copy link
Member

3esmit commented Oct 23, 2019

We need a way to support dynamic IPs. In case of an active censorship over the use of bootnodes, static IPs are easy target.

I see that this problem goes deep in rabbit hole.

@oskarth
Copy link
Contributor Author

oskarth commented Oct 28, 2019

I think it is an OK requirement for bootnodes to be static IPs. You want that mechanism to be as KISS as possible, since it is how you discover the rest of the network. For nodes that are being discovered (Whisper relay nodes / mailservers / etc) that's a different question.

The only thing that seems similarly KISS is to add support for DNS a la Bitcoin, but that's a bigger change. The problem with something like ENS is that you need to actually sync up your chain to get to it, which in itself requires bootnodes. So you haven't really solved any problem if you just require some other static nodes (or Infura DNS), just added another layer of indirection.

@adambabik
Copy link
Contributor

adambabik commented Oct 28, 2019

In geth 1.9, discovery based on DNS was implemented:

I can do a POC with @jakubgs this week I believe.

It does not necessarily simplifies things for folks who have dynamic IPs, though. They would need to update their DNS every time an IP changes to make it useful. Also, updating DNS takes time.

@jacqueswww
Copy link

jacqueswww commented Oct 28, 2019

It does not necessarily simplifies things for folks who have dynamic IPs, though. They would need to update their DNS every time an IP changes to make it useful. Also, updating DNS takes time.

Actually this is can usually be setup on your router just look for DynDNS settings, I used to be very happy using freedns.afraid.org to host my own dynamic DNS.

Using DNS bootnodes is one more way to improve censorship resistance (it's obviously not full proof but it's one more layer).

@oskarth
Copy link
Contributor Author

oskarth commented Oct 28, 2019

Oh right, forgot about that EIP! Nice one, poc would be awesome

@oskarth
Copy link
Contributor Author

oskarth commented Dec 17, 2019

Ping @jacqueswww

@jakubgs
Copy link
Member

jakubgs commented Dec 17, 2019

@jacqueswww
Copy link

Cool thanks; will check it out.

@jacqueswww
Copy link

Alrighty; My new node is running at:

Bootnode:

enode://e6bfafb5c0c9961c0fca4cbe1da69f7fe0129e00b1b353e4a87adf85405c017f90f6d7197fa51a8a69e758d7821407422f3a29139aa24848dbce0c412ce0c859@51.15.70.35:30303

Mailserver

enode://e6bfafb5c0c9961c0fca4cbe1da69f7fe0129e00b1b353e4a87adf85405c017f90f6d7197fa51a8a69e758d7821407422f3a29139aa24848dbce0c412ce0c859:status-offline-inbox@51.15.70.35:30303

I believe it's a v1 node; so I get a PoW() error message from my Playstore Status client.

Anyone want to give it a go?

@corpetty
Copy link
Contributor

@jacqueswww I think I've added you and connected but current V1 doesn't show previously added bootnodes (new bug I think)

@corpetty
Copy link
Contributor

after adding mailserver, I got "The mailserver couldn't be reached"

@jakubgs
Copy link
Member

jakubgs commented Dec 21, 2019

I don't think it works, your port doesn't appear to be open. Either a NAT or a firewall issue:

 $ node-canary -log WARN -mailserver 'enode://e6bfafb5c0c9961c0fca4cbe1da69f7fe0129e00b1b353e4a87adf85405c017f90f6d7197fa51a8a69e758d7821407422f3a29139aa24848dbce0c412ce0c859@51.15.70.35:30303' 
ERROR[12-21|09:18:43.259] Error detected while waiting for mailserver peer to be added package=status-go/cmd/node-canary error="wait for peer: timeout"
 $ sudo nmap -Pn -p 30303 51.15.70.35
Starting Nmap 7.80 ( https://nmap.org ) at 2019-12-21 09:19 CET
Nmap scan report for 35-70-15-51.rev.cloud.scaleway.com (51.15.70.35)
Host is up (0.029s latency).

PORT      STATE  SERVICE
30303/tcp closed unknown

Nmap done: 1 IP address (1 host up) scanned in 0.22 seconds

@jacqueswww
Copy link

jacqueswww commented Dec 22, 2019

@jakubgs @corpetty thanks for testing! OK please try now - looking at the logs I must've stopped the service - please try again :)

PORT      STATE SERVICE
30303/tcp open  unknown

@jakubgs
Copy link
Member

jakubgs commented Dec 22, 2019

Down again:

Nmap scan report for 35-70-15-51.rev.cloud.scaleway.com (51.15.70.35)
Host is up (0.026s latency).

PORT      STATE  SERVICE
30303/tcp closed unknown

How do you run your node? What do you see in logs?

 $ pwd
/home/me/work/status-go
 $ cd _assets/systemd/mailserver 
 $ make logs
journalctl --user-unit statusd
...

@jacqueswww
Copy link

@jakubgs so I think the moment I log out the job kills itself.

Dec 22 03:33:40 status-node systemd[3151]: Stopping Status.im Mailserver Service...
Dec 22 03:33:40 status-node systemd[3151]: Stopped Status.im Mailserver Service.
Dec 22 15:20:02 status-node systemd[14365]: Starting Status.im Mailserver Service...

@jacqueswww
Copy link

jacqueswww commented Dec 22, 2019

I think for my use case i.e. for being able to logout of my machine however be able to keep the process in the background I should use Type=simple instead ? I have logged out and it does seem to still have the port open :o) Will try again a bit later.

@jakubgs
Copy link
Member

jakubgs commented Dec 22, 2019

Well, the way make run-mailserver-systemd works is that it runs as a user service, so yes, logging out would terminate it. I did it this way to simplify the process and avoid the need for sudo.

If you want to make it into a system service you'd have to remove it as a user service and use the same kind of *.service files but located in /etc/systemd/system For example /etc/systemd/system/statusd.service. Something like:

sudo cp ~/.config/systemd/user/statusd.service /etc/systemd/system
cd ~/wherever/you/have/status-go/_assets/systemd/mailserver
make clean
sudo systemctl daemon-reload
sudo systemctl enable statusd
sudo systemctl start statusd

That should make it into a system service that will run with system boot.

@jakubgs
Copy link
Member

jakubgs commented Dec 22, 2019

In hindsight this might be something worth adding to our README files in status-go.

@jacqueswww please review and test the branch to see if that works for you: #1755

@jacqueswww
Copy link

@jakubgs great thanks; just tested worked for me.

@jacqueswww
Copy link

I used new configs; so:
Bootnode:

enode://bfa9df5a5dc3c6bb788ea63eac48c29058a0f4a089adaa573720e76ca0a29f0f8bb79e4a8a4b79afb7bc01bf05a0c3df4d10a37bf3e327ccfe3efa83a7a0d2ec@51.15.70.35:30303

Mailserver:

enode://bfa9df5a5dc3c6bb788ea63eac48c29058a0f4a089adaa573720e76ca0a29f0f8bb79e4a8a4b79afb7bc01bf05a0c3df4d10a37bf3e327ccfe3efa83a7a0d2ec:status-offline-inbox@51.15.70.35:30303

@status-github-bot
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@oskarth
Copy link
Contributor Author

oskarth commented Aug 6, 2021

Was this solved? It is still a problem :)

Though perhaps more on status-react as a user-facing issue

@oskarth oskarth reopened this Aug 6, 2021
@status-github-bot status-github-bot bot removed the stale label Aug 6, 2021
@jakubgs
Copy link
Member

jakubgs commented Aug 6, 2021

@oskarth because I thought Chaos Unicorn Day was over =].

@oskarth
Copy link
Contributor Author

oskarth commented Aug 6, 2021

It's never over!

You know, you could just shut down the whole cluster and watch people panic...

@jakubgs
Copy link
Member

jakubgs commented Aug 6, 2021

Now that you say it... that does sound fun.

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

No branches or pull requests

8 participants