Skip to content

Commit

Permalink
reth: 0.2.0-beta.6 -> 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbot95 committed Jul 11, 2024
1 parent db24350 commit 459a0c3
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 47 deletions.
48 changes: 45 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.treefmt-nix.follows = "treefmt-nix";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs = inputs @ {
Expand Down Expand Up @@ -93,6 +101,7 @@
pkgsUnstable = lib.extras.nix.mkNixpkgs {
inherit system;
nixpkgs = inputs.nixpkgs-unstable;
overlays = [(import inputs.rust-overlay)];
};
};

Expand Down
2 changes: 1 addition & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
nethermind = callPackageUnstable ./nethermind {};
nimbus = callPackageUnstable ./nimbus {};
prysm = callPackage ./prysm {inherit bls blst;};
reth = callPackageUnstable ./reth {};
reth = callPackageUnstable ./reth {inherit (inputs) crane;};
rocketpool = callPackage ./rocketpool {};
rotki-bin = callPackage ./rotki-bin {};
sedge = callPackage ./sedge {inherit bls mcl;};
Expand Down
96 changes: 53 additions & 43 deletions pkgs/reth/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,63 @@
lib,
rustPlatform,
stdenv,
}:
rustPlatform.buildRustPackage rec {
pname = "reth";
version = "0.2.0-beta.6";
pkgs,
crane,
cargo-nextest,
}: let
craneLib = (crane.mkLib pkgs).overrideToolchain (p: p.rust-bin.stable.latest.default);
commonArgs = rec {
pname = "reth";
version = "1.0.1";

src = fetchFromGitHub {
owner = "paradigmxyz";
repo = pname;
rev = "v${version}";
hash = "sha256-ZcQ29AwlTU6rDiknlJbOo8JubXQOJg1UVMSlRb1l8Yk=";
};

cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"alloy-consensus-0.1.0" = "sha256-2TZeQo0d+Yp0M46VNx3OZoyDT4F31cLdOpl1tk3syfg=";
"discv5-0.4.1" = "sha256-agrluN1C9/pS/IMFTVlPOuYl3ZuklnTYb46duVvTPio=";
"revm-inspectors-0.1.0" = "sha256-ZRlYNEHD+wewlttUcMuEoTYg9Hn89JVAr7+hIeMBXog=";
src = fetchFromGitHub {
owner = "paradigmxyz";
repo = pname;
rev = "v${version}";
hash = "sha256-GqBNyPeXIN7q2m3SkhP4BUYXyEQYlkP0JH/pKgEvf7k=";
};
};
strictDeps = true;

nativeBuildInputs = [
rustPlatform.bindgenHook
];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in
craneLib.buildPackage (commonArgs
// {
inherit cargoArtifacts;

# `x86_64-darwin` seems to have issues with jemalloc
buildNoDefaultFeatures = true;
buildFeatures = lib.optional (stdenv.system != "x86_64-darwin") "jemalloc";
nativeBuildInputs = [
cargo-nextest
# Doesn't actually depend on rust version, so using this hook from nixpkgs is fine
rustPlatform.bindgenHook
];

buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
# `x86_64-darwin` seems to have issues with jemalloc
cargoExtraArgs =
"--no-default-features"
+ (
if stdenv.system != "x86_64-darwin"
then " --features jemalloc"
else ""
);

# Some tests fail due to I/O that is unfriendly with nix sandbox.
checkFlags = [
"--skip=builder::tests::block_number_node_config_test"
"--skip=builder::tests::launch_multiple_nodes"
"--skip=builder::tests::rpc_handles_none_without_http"
"--skip=cli::tests::override_trusted_setup_file"
"--skip=cli::tests::parse_env_filter_directives"
];
cargoTestCommand = "cargo nextest run";
cargoTestExtraArgs = builtins.concatStringsSep " " [
"--hide-progress-bar"
"--workspace"
"--exclude ef-tests"
"-E"
# Only run unit tests (`!kind(test)`) and skip several tests which can't run within the nix sandbox
"'!kind(test) - test(cli::tests::parse_env_filter_directives) - test(tests::test_exex) - test(auth_layer::tests::test_jwt_layer)'"
];

meta = with lib; {
description = "Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust";
homepage = "https://github.com/paradigmxyz/reth";
license = with licenses; [mit asl20];
mainProgram = "reth";
platforms = ["aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux"];
};
}
meta = with lib; {
description = "Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust";
homepage = "https://github.com/paradigmxyz/reth";
license = with licenses; [mit asl20];
mainProgram = "reth";
platforms = ["aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux"];
};
})

0 comments on commit 459a0c3

Please sign in to comment.