electron-chromedriver_33: 33.3.0 -> 33.3.1
[NixPkgs.git] / pkgs / applications / blockchains / lighthouse / default.nix
blob3846ae0a82a15a818b7b6f0b954bf7ab4ce55565
1 { cmake
2 , CoreFoundation
3 , fetchFromGitHub
4 , fetchurl
5 , lib
6 , lighthouse
7 , nix-update-script
8 , openssl
9 , pkg-config
10 , postgresql
11 , protobuf
12 , rustPlatform
13 , rust-jemalloc-sys
14 , Security
15 , sqlite
16 , stdenv
17 , SystemConfiguration
18 , testers
21 rustPlatform.buildRustPackage rec {
22   pname = "lighthouse";
23   version = "5.3.0";
25   # lighthouse/common/deposit_contract/build.rs
26   depositContractSpecVersion = "0.12.1";
27   testnetDepositContractSpecVersion = "0.9.2.1";
29   src = fetchFromGitHub {
30     owner = "sigp";
31     repo = "lighthouse";
32     rev = "v${version}";
33     hash = "sha256-wIj+YabyUrgLjWCfjCAH/Xb8jUG6ss+5SwnE2M82a+4=";
34   };
36   patches = [
37     ./use-system-sqlite.patch
38     ./fix-dep-lazy_static.patch
39   ];
41   postPatch = ''
42     cp ${./Cargo.lock} Cargo.lock
43   '';
45   cargoLock = {
46     lockFile = ./Cargo.lock;
47     outputHashes = {
48       "libmdbx-0.1.4" = "sha256-ONp4uPkVCN84MObjXorCZuSjnM6uFSMXK1vdJiX074o=";
49       "lmdb-rkv-0.14.0" = "sha256-sxmguwqqcyOlfXOZogVz1OLxfJPo+Q0+UjkROkbbOCk=";
50       "quick-protobuf-0.8.1" = "sha256-dgePLYCeoEZz5DGaLifhf3gEIPaL7XB0QT9wRKY8LJg=";
51     };
52   };
54   buildFeatures = [ "modern" "gnosis" ];
56   nativeBuildInputs = [
57     rustPlatform.bindgenHook
58     cmake
59     pkg-config
60     protobuf
61   ];
63   buildInputs = [
64     rust-jemalloc-sys
65     sqlite
66   ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
67     openssl
68   ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
69     CoreFoundation
70     Security
71     SystemConfiguration
72   ];
74   depositContractSpec = fetchurl {
75     url = "https://raw.githubusercontent.com/ethereum/eth2.0-specs/v${depositContractSpecVersion}/deposit_contract/contracts/validator_registration.json";
76     hash = "sha256-ZslAe1wkmkg8Tua/AmmEfBmjqMVcGIiYHwi+WssEwa8=";
77   };
79   testnetDepositContractSpec = fetchurl {
80     url = "https://raw.githubusercontent.com/sigp/unsafe-eth2-deposit-contract/v${testnetDepositContractSpecVersion}/unsafe_validator_registration.json";
81     hash = "sha256-aeTeHRT3QtxBRSNMCITIWmx89vGtox2OzSff8vZ+RYY=";
82   };
84   LIGHTHOUSE_DEPOSIT_CONTRACT_SPEC_URL = "file://${depositContractSpec}";
85   LIGHTHOUSE_DEPOSIT_CONTRACT_TESTNET_URL = "file://${testnetDepositContractSpec}";
87   OPENSSL_NO_VENDOR = true;
89   cargoBuildFlags = [
90     "--package lighthouse"
91   ];
93   __darwinAllowLocalNetworking = true;
95   checkFeatures = [ ];
97   # All of these tests require network access and/or docker
98   cargoTestFlags = [
99     "--workspace"
100     "--exclude beacon_chain"
101     "--exclude beacon_node"
102     "--exclude http_api"
103     "--exclude lighthouse"
104     "--exclude lighthouse_network"
105     "--exclude network"
106     "--exclude slashing_protection"
107     "--exclude watch"
108     "--exclude web3signer_tests"
109   ];
111   # All of these tests require network access
112   checkFlags = [
113     "--skip basic"
114     "--skip deposit_tree::cache_consistency"
115     "--skip deposit_tree::double_update"
116     "--skip deposit_tree::updating"
117     "--skip eth1_cache::big_skip"
118     "--skip eth1_cache::double_update"
119     "--skip eth1_cache::pruning"
120     "--skip eth1_cache::simple_scenario"
121     "--skip fast::deposit_cache_query"
122     "--skip http::incrementing_deposits"
123     "--skip persist::test_persist_caches"
124     "--skip service::tests::tests::test_dht_persistence"
125     "--skip time::test::test_reinsertion_updates_timeout"
126   ] ++ lib.optionals (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isDarwin) [
127     "--skip subnet_service::tests::attestation_service::test_subscribe_same_subnet_several_slots_apart"
128     "--skip subnet_service::tests::sync_committee_service::same_subscription_with_lower_until_epoch"
129     "--skip subnet_service::tests::sync_committee_service::subscribe_and_unsubscribe"
130   ];
132   nativeCheckInputs = [
133     postgresql
134   ];
136   passthru = {
137     tests.version = testers.testVersion {
138       package = lighthouse;
139       command = "lighthouse --version";
140       version = "v${lighthouse.version}";
141     };
142     updateScript = nix-update-script { };
143   };
145   enableParallelBuilding = true;
147   # This is needed by the unit tests.
148   FORK_NAME = "capella";
150   meta = with lib; {
151     description = "Ethereum consensus client in Rust";
152     homepage = "https://lighthouse.sigmaprime.io/";
153     license = licenses.asl20;
154     maintainers = with maintainers; [ centromere pmw ];
155     mainProgram = "lighthouse";
156     broken = stdenv.hostPlatform.isDarwin;
157   };