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

ETH2 Validator node support #106063

Closed
wants to merge 3 commits into from
Closed

ETH2 Validator node support #106063

wants to merge 3 commits into from

Conversation

bachp
Copy link
Member

@bachp bachp commented Dec 6, 2020

Motivation for this change

This is still work in progress, I'm currently testing and tweaking the modules: Don't us it yet as a mainnet validator. (Unless you know what you are doing)..

Provide all the necessary services to allow running an ETH2 validator on NixOS.

Open Points:

  • Package lighthouse from source. Currently the binary is packaged as the depndencies fo lighthouse can't be vendored. Fixed with v1.1.1. I will still provide an additional binary package as a fallback in case packaging issues arise again in the future.
  • Create documentation how to setup a ETH2 validator
  • lighthouse 1.1.1 build requires rust 1.50 rust: 1.49.0 -> 1.50.0 #112792

Related MRs:

The goal is to have this all ready on unstable for the 21.05 stable release so that everybody can run a validatr node on stable.
This probably also means we should define that we will backport new releases of the involved packages to stable branches.

In addition to the official documentation a lot of the best practice was taken from the following sources:

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 106063 run on x86_64-linux 1

1 package blacklisted:
  • tests.nixos-functions.nixos-test
2 packages built:
  • lighthouse-ethereum
  • openethereum

@bachp bachp force-pushed the eth2-staking branch 2 times, most recently from 4aad885 to fe5cbba Compare January 13, 2021 20:31
@bachp bachp force-pushed the eth2-staking branch 2 times, most recently from fe0db5d to d8663d2 Compare January 25, 2021 22:20
pkgs/applications/blockchains/lighthouse/default.nix Outdated Show resolved Hide resolved
@@ -38,7 +38,12 @@ rustPlatform.buildRustPackage rec {
cargoBuildFlags = [ "--features final" ];

# test result: FAILED. 88 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# test result: FAILED. 88 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out

pkgs/applications/blockchains/openethereum/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/openethereum/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 106063 run on x86_64-linux 1

1 package blacklisted:
  • tests.nixos-functions.nixos-test
1 package failed to build and are new build failure:
  • openethereum: log was empty
1 package built:
  • lighthouse-ethereum

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

lighthouse-ethereum:

installPhase should probably contain runHook preInstall and runHook postInstall.

Near pkgs/applications/blockchains/lighthouse/default.nix:24:3:

   |
24 |   installPhase = ''
   |   ^

See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/missing-phase-hooks.md

openethereum:

gpl3 is a deprecated license, check if project uses gpl3Plus or gpl3Only and change meta.license accordingly.

Near pkgs/applications/blockchains/openethereum/default.nix:51:5:

   |
51 |     license = licenses.gpl3;
   |     ^

See: https://github.com/jtojnar/nixpkgs-hammering/blob/master/explanations/unclear-gpl.md

owner = "sigp";
repo = "lighthouse";
rev = "v${version}";
leaveDotGit = true; # Needed to get the proper version
Copy link
Member

Choose a reason for hiding this comment

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

Can we inject the version easily? Leaving dotGit is kind of a last resort.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried this with https://github.com/NixOS/nixpkgs/pull/106063/files#diff-d8165e975d221069554707389b93737b9aa76e9a4ac2b62e7f466bb8d3494bd5 but I need to find a better solution that I can submit upstream.

Leaving the dotGit doesn't even work for some reason. I will remove it in the next iteration.

@bachp
Copy link
Member Author

bachp commented Jul 2, 2021

Supreseeded by #128984

@bachp bachp closed this Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants