Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ma/stake-table-contra…
Browse files Browse the repository at this point in the history
…ct-delegation
  • Loading branch information
sveitser committed Mar 10, 2025
2 parents 1eb323c + f9060fd commit 0eabb90
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 25 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ jobs:
- uses: actions/checkout@v4
name: Checkout Repository

- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching

- name: Format Check
run: cargo fmt -- --check
run: cargo +nightly fmt -- --check

- name: Check (embedded-db)
run: |
Expand Down
3 changes: 2 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ extend-exclude = [
"contract-bindings-alloy",
"contract-bindings-ethers",
"node-metrics/src/api/node_validator/v0/example_prometheus_metrics_output.txt",
"hotshot-orchestrator/run-config.toml"
"hotshot-orchestrator/run-config.toml",
"hotshot-macros/src/lib.rs"
]
53 changes: 30 additions & 23 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
};

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixpkgs-legacy-foundry.url = "github:NixOS/nixpkgs/9abb87b552b7f55ac8916b6fc9e5cb486656a2f3";

inputs.foundry-nix.url = "github:shazow/foundry.nix/monthly"; # Use monthly branch for permanent releases

inputs.rust-overlay.url = "github:oxalica/rust-overlay";

inputs.nixpkgs-cross-overlay.url =
Expand All @@ -29,6 +33,8 @@
outputs =
{ self
, nixpkgs
, nixpkgs-legacy-foundry
, foundry-nix
, rust-overlay
, nixpkgs-cross-overlay
, flake-utils
Expand Down Expand Up @@ -61,6 +67,7 @@

overlays = [
(import rust-overlay)
foundry-nix.overlay
solc-bin.overlays.default
(final: prev: {
solhint =
Expand Down Expand Up @@ -186,7 +193,7 @@
buildInputs = [
# Rust dependencies
pkg-config
openssl_3 # match ubuntu 24.04 that we use on CI and as base image in docker
openssl
curl
protobuf # to compile libp2p-autonat
stableToolchain
Expand Down Expand Up @@ -217,25 +224,7 @@
coreutils

# Ethereum contracts, solidity, ...
# TODO: remove alloy patch when forge includes this fix: https://github.com/alloy-rs/core/pull/864
# foundry
(foundry.overrideAttrs {
# Set the resolve limit to 128 by replacing the value in the vendored dependencies.
postPatch = ''
pushd $cargoDepsCopy/alloy-sol-macro-expander
oldHash=$(sha256sum src/expand/mod.rs | cut -d " " -f 1)
substituteInPlace src/expand/mod.rs \
--replace-warn \
'const RESOLVE_LIMIT: usize = 32;' 'const RESOLVE_LIMIT: usize = 128;'
substituteInPlace .cargo-checksum.json \
--replace-warn $oldHash $(sha256sum src/expand/mod.rs | cut -d " " -f 1)
popd
'';
})
foundry-bin
solc
nodePackages.prettier
solhint
Expand All @@ -255,10 +244,28 @@
# Add rust binaries to PATH for native demo
export PATH="$PWD/$CARGO_TARGET_DIR/debug:$PATH"
# Needed to compile with the sqlite-unbundled feature
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
'' + self.checks.${system}.pre-commit-check.shellHook;
RUST_SRC_PATH = "${stableToolchain}/lib/rustlib/src/rust/library";
FOUNDRY_SOLC = "${solc}/bin/solc";
});
# A shell with foundry v0.3.0 which can still build ethers-rs bindings.
# Can be removed when we are no longer using the ethers-rs bindings.
devShells.legacyFoundry =
let
overlays = [
solc-bin.overlays.default
];
pkgs = import nixpkgs-legacy-foundry { inherit system overlays; };
in
mkShell {
packages = with pkgs; [
solc
foundry
];
};
devShells.crossShell =
crossShell { config = "x86_64-unknown-linux-musl"; };
devShells.armCrossShell =
Expand All @@ -273,7 +280,7 @@
buildInputs = [
# Rust dependencies
pkg-config
openssl_3
openssl
curl
protobuf # to compile libp2p-autonat
toolchain
Expand All @@ -287,7 +294,7 @@
buildInputs = [
# Rust dependencies
pkg-config
openssl_3
openssl
curl
protobuf # to compile libp2p-autonat
toolchain
Expand All @@ -310,7 +317,7 @@
buildInputs = [
# Rust dependencies
pkg-config
openssl_3
openssl
curl
protobuf # to compile libp2p-autonat
stableToolchain
Expand Down

0 comments on commit 0eabb90

Please sign in to comment.