2022-08-29 22:34:33 +01:00
|
|
|
{ clang
|
|
|
|
, cmake
|
2023-03-28 15:38:44 +01:00
|
|
|
, CoreFoundation
|
2022-08-29 22:34:33 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, lib
|
|
|
|
, lighthouse
|
2023-03-28 15:38:44 +01:00
|
|
|
, nix-update-script
|
2022-08-29 22:34:33 +01:00
|
|
|
, nodePackages
|
|
|
|
, perl
|
2023-03-28 15:38:44 +01:00
|
|
|
, pkg-config
|
|
|
|
, postgresql
|
2022-08-29 22:34:33 +01:00
|
|
|
, protobuf
|
|
|
|
, rustPlatform
|
|
|
|
, Security
|
2023-03-28 15:38:44 +01:00
|
|
|
, sqlite
|
2022-08-29 22:34:33 +01:00
|
|
|
, stdenv
|
2023-03-28 15:38:44 +01:00
|
|
|
, SystemConfiguration
|
2022-08-29 22:34:33 +01:00
|
|
|
, testers
|
|
|
|
, unzip
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lighthouse";
|
2023-03-28 15:38:44 +01:00
|
|
|
version = "4.1.0";
|
2022-08-29 22:34:33 +01:00
|
|
|
|
|
|
|
# lighthouse/common/deposit_contract/build.rs
|
|
|
|
depositContractSpecVersion = "0.12.1";
|
|
|
|
testnetDepositContractSpecVersion = "0.9.2.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigp";
|
|
|
|
repo = "lighthouse";
|
|
|
|
rev = "v${version}";
|
2023-03-28 15:38:44 +01:00
|
|
|
hash = "sha256-QVAFzV9sao8+eegI7bLfm+pPHyvDFhnADS80+nqqgtE=";
|
2022-08-29 22:34:33 +01:00
|
|
|
};
|
|
|
|
|
2023-03-28 15:38:44 +01:00
|
|
|
patches = [
|
|
|
|
./use-system-sqlite.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
cp ${./Cargo.lock} Cargo.lock
|
|
|
|
'';
|
|
|
|
|
2023-03-25 23:16:46 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"amcl-0.3.0" = "sha256-Mj4dXTlGVSleFfuTKgVDQ7S3jANMsdtVE5L90WGxA4U=";
|
2023-03-28 15:38:44 +01:00
|
|
|
"arbitrary-1.3.0" = "sha256-BMxcBfxBRf+Kb0Tz55jtFbwokSeD2GPtB+KV8Wbne0g=";
|
|
|
|
"beacon-api-client-0.1.0" = "sha256-fI8qST6HZrchg7yr/nVtRNrsW3f5ONSX+mGRYW+iiqA=";
|
2023-03-25 23:16:46 +00:00
|
|
|
"ethereum-consensus-0.1.1" = "sha256-aBrZ786Me0BWpnncxQc5MT3r+O0yLQhqGKFBiNTdqSA=";
|
|
|
|
"libmdbx-0.1.4" = "sha256-NMsR/Wl1JIj+YFPyeMMkrJFfoS07iEAKEQawO89a+/Q=";
|
|
|
|
"lmdb-rkv-0.14.0" = "sha256-sxmguwqqcyOlfXOZogVz1OLxfJPo+Q0+UjkROkbbOCk=";
|
|
|
|
"mev-rs-0.2.1" = "sha256-n3ns1oynw5fKQtp/CQHER41+C1EmLCVEBqggkHc3or4=";
|
|
|
|
"ssz-rs-0.8.0" = "sha256-k1JLu+jZrSqUyHou76gbJeA5CDWwdL0fPkek3Vzl4Gs=";
|
|
|
|
"warp-0.3.2" = "sha256-m9lkEgeSs0yEc+6N6DG7IfQY/evkUMoNyst2hMUR//c=";
|
|
|
|
};
|
|
|
|
};
|
2022-08-29 22:34:33 +01:00
|
|
|
|
|
|
|
buildFeatures = [ "modern" "gnosis" ];
|
|
|
|
|
2023-03-28 15:38:44 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
rustPlatform.bindgenHook
|
|
|
|
cmake
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
protobuf
|
|
|
|
];
|
2022-08-29 22:34:33 +01:00
|
|
|
|
2023-03-28 15:38:44 +01:00
|
|
|
buildInputs = [
|
|
|
|
sqlite
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-02-26 20:13:40 +00:00
|
|
|
CoreFoundation
|
2023-03-28 15:38:44 +01:00
|
|
|
Security
|
2023-02-26 20:13:40 +00:00
|
|
|
SystemConfiguration
|
2022-08-29 22:34:33 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
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 = [ ];
|
|
|
|
|
2023-03-28 15:38:44 +01:00
|
|
|
# All of these tests require network access and/or docker
|
2022-08-29 22:34:33 +01:00
|
|
|
cargoTestFlags = [
|
|
|
|
"--workspace"
|
|
|
|
"--exclude beacon_node"
|
|
|
|
"--exclude http_api"
|
|
|
|
"--exclude beacon_chain"
|
|
|
|
"--exclude lighthouse"
|
|
|
|
"--exclude lighthouse_network"
|
|
|
|
"--exclude slashing_protection"
|
2023-03-28 15:38:44 +01:00
|
|
|
"--exclude watch"
|
2022-08-29 22:34:33 +01:00
|
|
|
"--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"
|
2023-03-28 15:38:44 +01:00
|
|
|
|
2022-08-29 22:34:33 +01:00
|
|
|
] ++ 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"
|
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-29 22:34:33 +01:00
|
|
|
nodePackages.ganache
|
2023-03-28 15:38:44 +01:00
|
|
|
postgresql
|
2022-08-29 22:34:33 +01:00
|
|
|
];
|
|
|
|
|
2023-01-14 16:04:17 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = lighthouse;
|
|
|
|
command = "lighthouse --version";
|
|
|
|
version = "v${lighthouse.version}";
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
2022-08-29 22:34:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Ethereum consensus client in Rust";
|
|
|
|
homepage = "https://lighthouse.sigmaprime.io/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ centromere pmw ];
|
|
|
|
};
|
|
|
|
}
|