about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2022-10-07 12:42:45 +0200
committerGitHub <noreply@github.com>2022-10-07 12:42:45 +0200
commitef1b870a438345b4abaa2c5037e6a47d22ca4333 (patch)
treec9fdbc42917a58e779c0877ae9ad6ff50b67df4d
parent99cc02fe981ba70098dfb7833959dba6a954ccf9 (diff)
parent59e3addfebc751fa3f9843dda1a831591bb86c3f (diff)
Merge pull request #189023 from centromere/lighthouse-3.0.0
-rw-r--r--maintainers/maintainer-list.nix10
-rw-r--r--pkgs/applications/blockchains/lighthouse/default.nix103
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix4
4 files changed, 117 insertions, 1 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index 0809687e86bf0..1682dc7a036d3 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -10699,6 +10699,16 @@
     githubId = 178496;
     name = "Philipp Middendorf";
   };
+  pmw = {
+    email = "philip@mailworks.org";
+    matrix = "@philip4g:matrix.org";
+    name = "Philip White";
+    github = "philipmw";
+    githubId = 1379645;
+    keys = [{
+      fingerprint = "9AB0 6C94 C3D1 F9D0 B9D9  A832 BC54 6FB3 B16C 8B0B";
+    }];
+  };
   pmy = {
     email = "pmy@xqzp.net";
     github = "pmeiyu";
diff --git a/pkgs/applications/blockchains/lighthouse/default.nix b/pkgs/applications/blockchains/lighthouse/default.nix
new file mode 100644
index 0000000000000..fc95295d3d9e6
--- /dev/null
+++ b/pkgs/applications/blockchains/lighthouse/default.nix
@@ -0,0 +1,103 @@
+{ clang
+, cmake
+, fetchFromGitHub
+, fetchurl
+, lib
+, lighthouse
+, llvmPackages
+, nodePackages
+, perl
+, protobuf
+, rustPlatform
+, Security
+, stdenv
+, testers
+, unzip
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "lighthouse";
+  version = "3.1.2";
+
+  # lighthouse/common/deposit_contract/build.rs
+  depositContractSpecVersion = "0.12.1";
+  testnetDepositContractSpecVersion = "0.9.2.1";
+
+  src = fetchFromGitHub {
+    owner = "sigp";
+    repo = "lighthouse";
+    rev = "v${version}";
+    hash = "sha256-EJFg6ZjxxijxJNMwKRh0cYeqwujUV3OJgXBvBRsnbVI=";
+  };
+
+  cargoHash = "sha256-iXqRtBqvM9URQsL8qGmpr3CNX2fpbtDOaluibAX/lWo=";
+
+  buildFeatures = [ "modern" "gnosis" ];
+
+  nativeBuildInputs = [ clang cmake perl protobuf ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
+
+  depositContractSpec = fetchurl {
+    url = "https://raw.githubusercontent.com/ethereum/eth2.0-specs/v${depositContractSpecVersion}/deposit_contract/contracts/validator_registration.json";
+    hash = "sha256-ZslAe1wkmkg8Tua/AmmEfBmjqMVcGIiYHwi+WssEwa8=";
+  };
+
+  testnetDepositContractSpec = fetchurl {
+    url = "https://raw.githubusercontent.com/sigp/unsafe-eth2-deposit-contract/v${testnetDepositContractSpecVersion}/unsafe_validator_registration.json";
+    hash = "sha256-aeTeHRT3QtxBRSNMCITIWmx89vGtox2OzSff8vZ+RYY=";
+  };
+
+  LIGHTHOUSE_DEPOSIT_CONTRACT_SPEC_URL = "file://${depositContractSpec}";
+  LIGHTHOUSE_DEPOSIT_CONTRACT_TESTNET_URL = "file://${testnetDepositContractSpec}";
+
+  cargoBuildFlags = [
+    "--package lighthouse"
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  checkFeatures = [ ];
+
+  # All of these tests require network access
+  cargoTestFlags = [
+    "--workspace"
+    "--exclude beacon_node"
+    "--exclude http_api"
+    "--exclude beacon_chain"
+    "--exclude lighthouse"
+    "--exclude lighthouse_network"
+    "--exclude slashing_protection"
+    "--exclude web3signer_tests"
+  ];
+
+  # All of these tests require network access
+  checkFlags = [
+    "--skip service::tests::tests::test_dht_persistence"
+    "--skip time::test::test_reinsertion_updates_timeout"
+  ] ++ lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [
+    "--skip subnet_service::tests::sync_committee_service::same_subscription_with_lower_until_epoch"
+    "--skip subnet_service::tests::sync_committee_service::subscribe_and_unsubscribe"
+  ];
+
+  checkInputs = [
+    nodePackages.ganache
+  ];
+
+  passthru.tests.version = testers.testVersion {
+    package = lighthouse;
+    command = "lighthouse --version";
+    version = "v${lighthouse.version}";
+  };
+
+  meta = with lib; {
+    description = "Ethereum consensus client in Rust";
+    homepage = "https://lighthouse.sigmaprime.io/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ centromere pmw ];
+  };
+}
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index b53a1189193b9..79a090f0ebd92 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -635,7 +635,6 @@ mapAliases ({
   libva1-full = throw "'libva1-full' has been renamed to/replaced by 'libva1'"; # Converted to throw 2022-02-22
   libwnck3 = throw "'libwnck3' has been renamed to/replaced by 'libwnck'"; # Converted to throw 2022-09-24
   lightdm_gtk_greeter = lightdm-gtk-greeter; # Added 2022-08-01
-  lighthouse = throw "lighthouse has been removed: abandoned by upstream"; # Added 2022-04-24
   lighttable = throw "'lighttable' crashes (SIGSEGV) on startup, has not been updated in years and depends on deprecated GTK2"; # Added 2022-06-15
   lilyterm = throw "lilyterm has been removed from nixpkgs, because it was relying on a vte version that depended on python2"; # Added 2022-01-14
   lilyterm-git = throw "lilyterm-git has been removed from nixpkgs, because it was relying on a vte version that depended on python2"; # Added 2022-01-14
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7aea53c6df5e1..ba1f5b99d1fcd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -36100,6 +36100,10 @@ with pkgs;
 
   lguf-brightness = callPackage ../misc/lguf-brightness { };
 
+  lighthouse = callPackage ../applications/blockchains/lighthouse {
+    inherit (darwin.apple_sdk.frameworks) Security;
+  };
+
   lilypond = callPackage ../misc/lilypond { guile = guile_1_8; };
 
   lilypond-unstable = callPackage ../misc/lilypond/unstable.nix { };