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 Support for Nimbus #89

Merged
merged 49 commits into from
Mar 10, 2021
Merged

Add Support for Nimbus #89

merged 49 commits into from
Mar 10, 2021

Conversation

jclapis
Copy link
Member

@jclapis jclapis commented Feb 8, 2021

This is one of two PRs that adds support for the Nimbus ETH2 client to Rocket Pool (the other being in smartnode-install). This was a nontrivial add, so here are my notes on my changes beyond simply adding a new client and keystore.

NOTE: this builds on top of the Teku PR I already submitted. If you accept this, you'll get all of those changes for free so you can ignore that PR.

Nimbus JSON-RPC Bug

So first things first, Nimbus v1.0.7 has a bug in its json-rpc library that breaks when you send requests that omit the params object if it's empty. I fixed this already and it's been merged but we can't officially support Nimbus until they push a new Docker image with this fix in. Stay tuned for that.

Single Process

Unlike the other clients, Nimbus (currently) only runs as a single process that is both the beacon client and the validator. This conflicts with RP's current model, where ETH2 clients are split into separate containers for beacon and validator activity, respectively. This poses some challenges, most of which are mitigated in the smartnode-install PR but there are a few changes that had to happen in this repository:

  • I added a new method called GetClientType() to beacon clients. This class returns an enum value - either SplitProcess or SingleProcess. SplitProcess is meant to capture the "normal" model, where the beacon client and validator are run separately. SingleProcess captures clients like Nimbus that run as a single process.
  • In restartValidator() in stake-prelaunch-minipools.go, I added some logic that checks the client type. If it's a single process, it will restart the rocketpool_eth2 image instead of the rocketpool_validator image.

Websocket API in Geth

Nimbus doesn't support HTTP APIs for web3 / ETH1 clients like the other clients do. It only supports Websockets. To work around that, I added a new variable called WsProvider to the config defined in shared/services/config/config.go and a corresponding value in shared/services/rocketpool/client.go for the rest of the client to use. More details on this are available in the smartnode-install PR.

I think that's everything. I've tested this on Dockerized and non-Dockerized setups, and it behaves as expected in both environments. I suggest we use the next beta to thoroughly try this out, provided Status released a fixed version of the Nimbus image in time.

jclapis and others added 22 commits February 1, 2021 03:17
…Validator() that looks at the client type and restarts the beacon container if it's a single-process type
ActivationEpoch            uint64    json:"activation_epoch" <== I bet this needs to be an int64 too
jclapis and others added 20 commits March 7, 2021 15:00
…Validator() that looks at the client type and restarts the beacon container if it's a single-process type
ActivationEpoch            uint64    json:"activation_epoch" <== I bet this needs to be an int64 too
@moles1 moles1 merged commit 884dde9 into rocket-pool:master Mar 10, 2021
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

Successfully merging this pull request may close these issues.

None yet

4 participants