diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3c85982556..cf04e5b908a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,9 +172,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@82dee4ba654bd2146511f85f0d013af94670c4de # v1 with: - # Pinned to specific version since newer versions do not produce - # deterministic block hashes. Unpin once that's fixed upstream - version: v1.2.3 + version: nightly - name: Install pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4 diff --git a/flake.lock b/flake.lock index 1e58519c668..d8c4d140a34 100644 --- a/flake.lock +++ b/flake.lock @@ -60,17 +60,16 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1749460237, - "narHash": "sha256-q0rIZeivgIxHDFRcTEtkRxhprnVYcI9i5YcfBHE8ZHU=", + "lastModified": 1756199436, + "narHash": "sha256-tkLoAk2BkFIwxp9YrtcUeWugGQjiubbiZx/YGGnVrz4=", "owner": "shazow", "repo": "foundry.nix", - "rev": "5af12b6f2b708858ef3120041546ed6b038474a5", + "rev": "2d28ea426c27166c8169e114eff4a5adcc00548d", "type": "github" }, "original": { "owner": "shazow", "repo": "foundry.nix", - "rev": "5af12b6f2b708858ef3120041546ed6b038474a5", "type": "github" } }, @@ -105,11 +104,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1755706679, - "narHash": "sha256-WJ6eaSiN6xtz3vyH2bTYLQ3+ct0W8ai/BkYaq1n1jP8=", + "lastModified": 1756128520, + "narHash": "sha256-R94HxJBi+RK1iCm8Y4Q9pdrHZl0GZoDPIaYwjxRNPh4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c3fc1fe6d8765d99c8614c6f82d611dc56b9ae37", + "rev": "c53baa6685261e5253a1c355a1b322f82674a824", "type": "github" }, "original": { @@ -163,11 +162,11 @@ }, "services-flake": { "locked": { - "lastModified": 1755091348, - "narHash": "sha256-aJI3n1CO3ib6CtK1/xuUyfIZM0Lp2zdCFMsFYjjfgQo=", + "lastModified": 1755996515, + "narHash": "sha256-1RQQIDhshp1g4PP5teqibcFLfk/ckTDOJRckecAHiU0=", "owner": "juspay", "repo": "services-flake", - "rev": "0a3805ceced9f02254d472cc71839811fae85357", + "rev": "e316d6b994fd153f0c35d54bd07d60e53f0ad9a9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index da2411c844e..e0e7e6aeef9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; - foundry.url = "github:shazow/foundry.nix/5af12b6f2b708858ef3120041546ed6b038474a5"; + foundry.url = "github:shazow/foundry.nix"; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -11,9 +11,17 @@ flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = inputs@{ flake-parts, process-compose-flake, services-flake, nixpkgs, fenix, foundry, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ process-compose-flake.flakeModule ]; + outputs = inputs @ { + flake-parts, + process-compose-flake, + services-flake, + nixpkgs, + fenix, + foundry, + ... + }: + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [process-compose-flake.flakeModule]; systems = [ "x86_64-linux" # 64-bit Intel/AMD Linux "aarch64-linux" # 64-bit ARM Linux @@ -21,150 +29,167 @@ "aarch64-darwin" # 64-bit ARM macOS ]; - perSystem = { config, self', inputs', pkgs, system, ... }: - let - overlays = [ - fenix.overlays.default - foundry.overlay - ]; + perSystem = { + config, + self', + inputs', + pkgs, + system, + ... + }: let + overlays = [ + fenix.overlays.default + foundry.overlay + ]; - pkgs = import nixpkgs { - inherit overlays system; - }; + pkgs = import nixpkgs { + inherit overlays system; + }; - toolchain = with fenix.packages.${system}; combine [ + toolchain = with fenix.packages.${system}; + combine [ (fromToolchainFile { file = ./rust-toolchain.toml; sha256 = "sha256-+9FmLhAOezBZCOziO0Qct1NOrfpjNsXxc/8I0c7BdKE="; }) stable.rust-src # This is needed for rust-analyzer to find stdlib symbols. Should use the same channel as the toolchain. ]; - in { - devShells.default = pkgs.mkShell { - packages = (with pkgs; [ - toolchain - foundry-bin - solc - protobuf - uv - cmake - corepack - nodejs - postgresql - just - cargo-nextest - ]); - }; + in { + formatter = pkgs.alejandra; + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + toolchain + foundry-bin + solc + protobuf + uv + cmake + corepack + nodejs + postgresql + just + cargo-nextest + ]; + }; - process-compose = let - inherit (services-flake.lib) multiService; - ipfs = multiService ./nix/ipfs.nix; - anvil = multiService ./nix/anvil.nix; + process-compose = let + inherit (services-flake.lib) multiService; + ipfs = multiService ./nix/ipfs.nix; + anvil = multiService ./nix/anvil.nix; - # Helper function to create postgres configuration with graph-specific defaults - mkPostgresConfig = { name, port, user, password, database, dataDir }: { - enable = true; - inherit port dataDir; - initialScript = { - before = '' - CREATE USER \"${user}\" WITH PASSWORD '${password}' SUPERUSER; - ''; - }; - initialDatabases = [ - { - inherit name; - schemas = [ (pkgs.writeText "init-${name}.sql" '' + # Helper function to create postgres configuration with graph-specific defaults + mkPostgresConfig = { + name, + port, + user, + password, + database, + dataDir, + }: { + enable = true; + inherit port dataDir; + initialScript = { + before = '' + CREATE USER \"${user}\" WITH PASSWORD '${password}' SUPERUSER; + ''; + }; + initialDatabases = [ + { + inherit name; + schemas = [ + (pkgs.writeText "init-${name}.sql" '' CREATE EXTENSION IF NOT EXISTS pg_trgm; - CREATE EXTENSION IF NOT EXISTS btree_gist; + CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS postgres_fdw; CREATE EXTENSION IF NOT EXISTS pg_stat_statements; GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO "${user}"; ALTER DATABASE "${database}" OWNER TO "${user}"; - '') ]; - } - ]; - settings = { - shared_preload_libraries = "pg_stat_statements"; - log_statement = "all"; - default_text_search_config = "pg_catalog.english"; - max_connections = 500; - }; + '') + ]; + } + ]; + settings = { + shared_preload_libraries = "pg_stat_statements"; + log_statement = "all"; + default_text_search_config = "pg_catalog.english"; + max_connections = 500; }; - in { - # Unit tests configuration - unit = { - imports = [ - services-flake.processComposeModules.default - ipfs - anvil - ]; + }; + in { + # Unit tests configuration + unit = { + imports = [ + services-flake.processComposeModules.default + ipfs + anvil + ]; - cli = { - environment.PC_DISABLE_TUI = true; - options = { - port = 8881; - }; + cli = { + environment.PC_DISABLE_TUI = true; + options = { + port = 8881; }; + }; - services.postgres."postgres-unit" = mkPostgresConfig { - name = "graph-test"; - port = 5432; - dataDir = "./.data/unit/postgres"; - user = "graph"; - password = "graph"; - database = "graph-test"; - }; + services.postgres."postgres-unit" = mkPostgresConfig { + name = "graph-test"; + port = 5432; + dataDir = "./.data/unit/postgres"; + user = "graph"; + password = "graph"; + database = "graph-test"; + }; - services.ipfs."ipfs-unit" = { - enable = true; - dataDir = "./.data/unit/ipfs"; - port = 5001; - gateway = 8080; - }; + services.ipfs."ipfs-unit" = { + enable = true; + dataDir = "./.data/unit/ipfs"; + port = 5001; + gateway = 8080; }; + }; - # Integration tests configuration - integration = { - imports = [ - services-flake.processComposeModules.default - ipfs - anvil - ]; + # Integration tests configuration + integration = { + imports = [ + services-flake.processComposeModules.default + ipfs + anvil + ]; - cli = { - environment.PC_DISABLE_TUI = true; - options = { - port = 8882; - }; + cli = { + environment.PC_DISABLE_TUI = true; + options = { + port = 8882; }; + }; - services.postgres."postgres-integration" = mkPostgresConfig { - name = "graph-node"; - port = 3011; - dataDir = "./.data/integration/postgres"; - user = "graph-node"; - password = "let-me-in"; - database = "graph-node"; - }; + services.postgres."postgres-integration" = mkPostgresConfig { + name = "graph-node"; + port = 3011; + dataDir = "./.data/integration/postgres"; + user = "graph-node"; + password = "let-me-in"; + database = "graph-node"; + }; - services.ipfs."ipfs-integration" = { - enable = true; - dataDir = "./.data/integration/ipfs"; - port = 3001; - gateway = 3002; - }; + services.ipfs."ipfs-integration" = { + enable = true; + dataDir = "./.data/integration/ipfs"; + port = 3001; + gateway = 3002; + }; - services.anvil."anvil-integration" = { - enable = true; - package = pkgs.foundry-bin; - port = 3021; - timestamp = 1743944919; - gasLimit = 100000000000; - baseFee = 1; - blockTime = 2; - }; + services.anvil."anvil-integration" = { + enable = true; + package = pkgs.foundry-bin; + port = 3021; + timestamp = 1743944919; + gasLimit = 100000000000; + baseFee = 1; + blockTime = 2; }; }; }; + }; }; } diff --git a/nix/anvil.nix b/nix/anvil.nix index a15807a1d11..6feae9ab88f 100644 --- a/nix/anvil.nix +++ b/nix/anvil.nix @@ -1,5 +1,10 @@ -{ pkgs, lib, name, config, ... }: { + pkgs, + lib, + name, + config, + ... +}: { options = { package = lib.mkOption { type = lib.types.package; diff --git a/nix/ipfs.nix b/nix/ipfs.nix index 72e60725ced..c5bf407cc29 100644 --- a/nix/ipfs.nix +++ b/nix/ipfs.nix @@ -1,7 +1,12 @@ -{ pkgs, lib, name, config, ... }: { + pkgs, + lib, + name, + config, + ... +}: { options = { - package = lib.mkPackageOption pkgs "kubo" { }; + package = lib.mkPackageOption pkgs "kubo" {}; port = lib.mkOption { type = lib.types.port; @@ -28,7 +33,7 @@ fi ${lib.getExe config.package} daemon --offline ''; - + environment = { IPFS_PATH = config.dataDir; }; diff --git a/tests/tests/integration_tests.rs b/tests/tests/integration_tests.rs index 8f82a4b1b88..ebec6fd8fc4 100644 --- a/tests/tests/integration_tests.rs +++ b/tests/tests/integration_tests.rs @@ -895,15 +895,15 @@ async fn test_subgraph_grafting(ctx: TestContext) -> anyhow::Result<()> { assert!(subgraph.healthy); let block_hashes: Vec<&str> = vec![ - "384c705d4d1933ae8ba89026f016f09854057a267e1143e47bb7511d772a35d4", - "b90423eead33404dae0684169d35edd494b36802b721fb8de0bb8bc036c10480", - "2a6c4b65d659e0485371a93bc1ac0f0d7bc0f25a454b5f23a842335fea0638d5", + "e26fccbd24dcc76074b432becf29cad3bcba11a8467a7b770fad109c2b5d14c2", + "249dbcbee975c22f8c9cc937536945ca463568c42d8933a3f54129dec352e46b", + "408675f81c409dede08d0eeb2b3420a73b067c4fa8c5f0fc49ce369289467c33", ]; let pois: Vec<&str> = vec![ - "0x4078e4eb67b9f57c05c9264c5db50418a3a5b06870b70ba69e16458572df3eee", - "0x4805a07cd4709b05e25a4d34f9b72bf4a565ffa7e14871eded0321e5626dbe0d", - "0xd2b60b17e3683a2129f82d4ffa473d0f4c3dc8029308d8458d6d41c5edfe5e91", + "0x606c1ed77564ef9ab077e0438da9f3c6af79a991603aecf74650971a88d05b65", + "0xbb21d5cf5fd62892159f95211da4a02f0dfa1b43d68aeb64baa52cc67fbb6c8e", + "0x5a01b371017c924e8cedd62a76cf8dcf05987f80d2b91aaf3fb57872ab75887f", ]; for i in 1..4 {