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

nimbus: init at 23.2.0 #193216

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

nimbus: init at 23.2.0 #193216

wants to merge 2 commits into from

Conversation

jakubgs
Copy link
Contributor

@jakubgs jakubgs commented Sep 27, 2022

Description of changes

Nimbus is a client for the Ethereum consensus layer that is lightweight, secure and easy to use.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@jakubgs
Copy link
Contributor Author

jakubgs commented Sep 27, 2022

I have tested this using the following config.nix:

{
  services.geth = {
    mainnet = {
      enable = true;
      authrpc = {
        enable = true;
        port = 8551;
        vhosts = ["localhost"];
        jwtsecret = "/etc/geth/jwtsecret";
      };
    };
  };

  services.nimbus-beacon-node = {
    enable = true;
    web3Urls = ["http://localhost:8551"];
    jwtSecret = "/etc/geth/jwtsecret";
    rest.enable = true;
  };

  environment.etc."geth/jwtsecret" = {
    mode = "0444";
    text = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
  };

  services.getty.autologinUser = "root";

  systemd.services.geth-mainnet.serviceConfig.StandardOutput = "journal+console";
  systemd.services.nimbus-beacon-node.serviceConfig.StandardOutput = "journal+console";
}

And ran it using:

nixos-generate -f vm-nogui -c $PWD/config.nix -I nixpkgs=$HOME/work/nixpkgs

Which worked without issues.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-in-distress/3604/51

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

I left a few comments after a look over the module. Please let me know if you have any questions.

nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
@jakubgs
Copy link
Contributor Author

jakubgs commented Oct 5, 2022

Thanks for the feedback @aanderse, I didn't know types.path checks for null and that types.enum exists, that's much cleaner than what I was doing.

I've addressed most point aside from the user creation, which I think is necessary since the user has to manage their validator files permissions and for that a static user is necessary, so we can't use the DynamicUser option like some services.

@jakubgs jakubgs requested a review from aanderse October 5, 2022 09:50
@jakubgs jakubgs changed the title nimbus: init at 22.9.1 nimbus: init at 22.10.0 Oct 5, 2022
@jakubgs
Copy link
Contributor Author

jakubgs commented Oct 17, 2022

Sorry if you're not interested by I'm desperate for reviews, and you've worked on the Geth package and service.

I'd appreciate some feedback from @pennae @ncfavier @iceman-p @bachp @ryantm.

@jakubgs jakubgs force-pushed the init-nimbus branch 3 times, most recently from d3877c8 to b2e9c14 Compare December 5, 2022 20:27
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

The enable option should probably also reference the doc

pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
pkgs/applications/blockchains/nimbus/default.nix Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.xml Outdated Show resolved Hide resolved
nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
Comment on lines 203 to 208
"--rest=${boolToString cfg.rest.enable}"
] ++ optionals cfg.rest.enable [
"--rest-address=${cfg.rest.address}"
"--rest-port=${toString cfg.rest.port}"
] ++ [
"--metrics=${boolToString cfg.metrics.enable}"
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
"--rest=${boolToString cfg.rest.enable}"
] ++ optionals cfg.rest.enable [
"--rest-address=${cfg.rest.address}"
"--rest-port=${toString cfg.rest.port}"
] ++ [
"--metrics=${boolToString cfg.metrics.enable}"
"--rest=${boolToString cfg.rest.enable}"
"--metrics=${boolToString cfg.metrics.enable}"
] ++ optionals cfg.rest.enable [
"--rest-address=${cfg.rest.address}"
"--rest-port=${toString cfg.rest.port}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would I mix the order of flags with different prefixes? Looks ugly.

Copy link
Member

Choose a reason for hiding this comment

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

We should group the flags together that are unconditional. Having some between the conditional ones is confusing.

Copy link
Contributor Author

@jakubgs jakubgs Dec 6, 2022

Choose a reason for hiding this comment

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

I disagree. I'd say mixing different prefixes is what's confusing. All --rest* flags and all --metrics* flags should be grouped in their respective blocks.

Copy link
Member

Choose a reason for hiding this comment

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

It is more confusing if conditional and none conditional flags are mixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, in my opinion it's more confusing if you have flags with different prefixes mixed rather than grouped.

But if you intend to block this PR on this issue then I will change it.

nixos/modules/services/blockchain/nimbus/beacon-node.nix Outdated Show resolved Hide resolved
Nimbus is a client for the Ethereum consensus layer (eth2) and
execution layer (eth1) that is lightweight, secure and easy to use.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Nimbus beacon node is an Ethereum consensus layer client.
Should be deployed together with an execution layer client like Geth.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
@jakubgs jakubgs changed the title nimbus: init at 22.11.0 nimbus: init at 23.2.0 Mar 6, 2023
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1910

@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
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

8 participants