diff --git a/.github/workflows/cairo-contracts.yml b/.github/workflows/cairo-contracts.yml index 980ed77d..bf15fc29 100644 --- a/.github/workflows/cairo-contracts.yml +++ b/.github/workflows/cairo-contracts.yml @@ -1,11 +1,6 @@ name: Cairo Contracts on: - pull_request: - paths: - - .github/workflows/cairo-contracts.yaml - - cairo-contracts/** - - justfile - + pull_request: {} push: tags: - v[0-9]+.* @@ -39,5 +34,5 @@ jobs: - name: Run Tests working-directory: ./cairo-contracts run: | - nix shell ..#snforge -c \ + nix develop -c \ snforge test diff --git a/.github/workflows/light-client.yml b/.github/workflows/light-client.yml index 9509948c..2e0532bd 100644 --- a/.github/workflows/light-client.yml +++ b/.github/workflows/light-client.yml @@ -1,14 +1,6 @@ name: Light Client on: - pull_request: - paths: - - .github/workflows/light-client.yaml - - light-client/** - - "**/Cargo.toml" - - "**/Cargo.lock" - - justfile - - README.md - + pull_request: {} push: tags: - v[0-9]+.* diff --git a/flake.lock b/flake.lock index 0a21a985..af719169 100644 --- a/flake.lock +++ b/flake.lock @@ -87,16 +87,16 @@ "cairo-src": { "flake": false, "locked": { - "lastModified": 1722496142, - "narHash": "sha256-aI/5sFQ2C24KP3dRwwRse5LBV5PJjXn8EMyOJBXGTMw=", + "lastModified": 1723546896, + "narHash": "sha256-4nLrTMwpRD6CcQcNqWHbCg3/OHHGMlrkcREX9p8gafE=", "owner": "starkware-libs", "repo": "cairo", - "rev": "223ca99633f50809c4b574df55545b042494d8d0", + "rev": "964a02d84c6bde5b39d4ef333eeecf7e588da135", "type": "github" }, "original": { "owner": "starkware-libs", - "ref": "v2.7.0", + "ref": "v2.7.1", "repo": "cairo", "type": "github" } @@ -1493,11 +1493,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1724999960, - "narHash": "sha256-LB3jqSGW5u1ZcUcX6vO/qBOq5oXHlmOCxsTXGMEitp4=", + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b96f849e725333eb2b1c7f1cb84ff102062468ba", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", "type": "github" }, "original": { @@ -1646,7 +1646,8 @@ "rust-overlay": "rust-overlay_2", "scarb-src": "scarb-src", "snforge-src": "snforge-src", - "starknet-devnet-src": "starknet-devnet-src" + "starknet-devnet-src": "starknet-devnet-src", + "universal-sierra-compiler-src": "universal-sierra-compiler-src" } }, "rust-overlay": { @@ -1673,11 +1674,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1724984647, - "narHash": "sha256-BC6MUq0CTdmAu/cueVcdWTI+S95s0mJcn19SoEgd7gU=", + "lastModified": 1725243956, + "narHash": "sha256-0A5ZP8uDCyBdYUzayZfy6JFdTefP79oZVAjyqA/yuSI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "87b6cffc276795b46ef544d7ed8d7fed6ad9c8e4", + "rev": "a10c8092d5f82622be79ed4dd12289f72011f850", "type": "github" }, "original": { @@ -1707,16 +1708,16 @@ "scarb-src": { "flake": false, "locked": { - "lastModified": 1722509315, - "narHash": "sha256-fV9ou50bvNyA1VFY+9YA3OgeQ95kctDrkKA4S2iIwVc=", + "lastModified": 1723563370, + "narHash": "sha256-ZMxH4EmllvestXh42VxPFLSQhZpgQCajYCYtquJfyAI=", "owner": "software-mansion", "repo": "scarb", - "rev": "e9a2b8716daf7388bfab5e4b0a2656e1b0c02d4d", + "rev": "e288874ba65f228ce3ae9aa55eef9f169824e998", "type": "github" }, "original": { "owner": "software-mansion", - "ref": "v2.7.0", + "ref": "v2.7.1", "repo": "scarb", "type": "github" } @@ -1820,11 +1821,11 @@ "starknet-devnet-src": { "flake": false, "locked": { - "lastModified": 1722592942, - "narHash": "sha256-SAOZ6M6jmzmF+H3B7IPiyb1CRFv2WoFArlVzgyDXmmQ=", + "lastModified": 1724938603, + "narHash": "sha256-Z/zB0BlSldfjdMraSryBOdWJloT1ryfOpSM21kHK7JU=", "owner": "0xSpaceShard", "repo": "starknet-devnet-rs", - "rev": "0a73e4331a246a79f88c21c0364e62c82966e7a6", + "rev": "0050fac5c151daae82105cfe27e7ea5fa0665f15", "type": "github" }, "original": { @@ -1984,6 +1985,23 @@ "type": "github" } }, + "universal-sierra-compiler-src": { + "flake": false, + "locked": { + "lastModified": 1722609504, + "narHash": "sha256-qa6r4qJxl3XrxUlP5V6ap9bzuQrcR2iREPCg967MBi8=", + "owner": "software-mansion", + "repo": "universal-sierra-compiler", + "rev": "fd6cab4c9887b625660f7c48a137b885451e6349", + "type": "github" + }, + "original": { + "owner": "software-mansion", + "ref": "v2.2.0", + "repo": "universal-sierra-compiler", + "type": "github" + } + }, "wasmd-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index ed1cbf15..968a1546 100644 --- a/flake.nix +++ b/flake.nix @@ -14,12 +14,12 @@ }; cairo-src = { - url = "github:starkware-libs/cairo/v2.7.0"; + url = "github:starkware-libs/cairo/v2.7.1"; flake = false; }; scarb-src = { - url = "github:software-mansion/scarb/v2.7.0"; + url = "github:software-mansion/scarb/v2.7.1"; flake = false; }; @@ -27,6 +27,11 @@ url = "github:foundry-rs/starknet-foundry/v0.29.0"; flake = false; }; + + universal-sierra-compiler-src = { + url = "github:software-mansion/universal-sierra-compiler/v2.2.0"; + flake = false; + }; }; outputs = @@ -51,11 +56,21 @@ cosmos-nix = inputs.cosmos-nix.packages.${system}; + rust = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + + rust-wasm = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-wasm.toml; + + rust-nightly = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-nightly.toml; + + rust-1_79 = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-1.79.toml; + wasm-simapp = cosmos-nix.ibc-go-v8-wasm-simapp; starknet-devnet = import ./nix/starknet-devnet.nix { inherit nixpkgs; inherit (inputs) starknet-devnet-src; + + rust = rust-1_79; }; cairo = import ./nix/cairo.nix { @@ -73,11 +88,12 @@ inherit (inputs) snforge-src; }; - rust = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - - rust-wasm = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-wasm.toml; + universal-sierra-compiler = import ./nix/universal-sierra-compiler.nix { + inherit nixpkgs; + inherit (inputs) universal-sierra-compiler-src; - rust-nightly = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain-nightly.toml; + rust = rust-1_79; + }; starknet-pkgs = { inherit @@ -85,6 +101,7 @@ cairo scarb snforge + universal-sierra-compiler wasm-simapp ; }; diff --git a/nix/cairo.nix b/nix/cairo.nix index fe5597a1..b1ab994d 100644 --- a/nix/cairo.nix +++ b/nix/cairo.nix @@ -2,13 +2,18 @@ let cairo = nixpkgs.rustPlatform.buildRustPackage { name = "cairo"; - version = "2.7.0"; + version = "2.7.1"; doCheck = false; src = cairo-src; - cargoHash = "sha256-yufWRaLxazbo64jjbH4MGLWqF7K7dWZhBjIBHLaRVHw="; + cargoHash = "sha256-piabK7UNyt2hWoqR5IDnCZoo8+VvSthSao3sQXKjE0o="; + + OPENSSL_NO_VENDOR = 1; + PKG_CONFIG_PATH = "${nixpkgs.openssl.dev}/lib/pkgconfig"; + + nativeBuildInputs = [ nixpkgs.pkg-config ]; }; in cairo diff --git a/nix/scarb.nix b/nix/scarb.nix index 89148dd7..0cbf81cc 100644 --- a/nix/scarb.nix +++ b/nix/scarb.nix @@ -6,13 +6,13 @@ let cairo = nixpkgs.rustPlatform.buildRustPackage { name = "scarb"; - version = "2.7.0"; + version = "2.7.1"; doCheck = false; src = scarb-src; - cargoHash = "sha256-EYepqNEixfuwBQDWUAkIUpJcyTwkh6bnBck+M4VROMY="; + cargoHash = "sha256-cAEwCX1zGJu4+ufdVSqBbksa1FLZWVNt2TLZ5JlGISk="; SCARB_CORELIB_LOCAL_PATH = cairo-src + "/corelib"; }; diff --git a/nix/starknet-devnet.nix b/nix/starknet-devnet.nix index 78eac980..21f28595 100644 --- a/nix/starknet-devnet.nix +++ b/nix/starknet-devnet.nix @@ -1,6 +1,15 @@ -{ nixpkgs, starknet-devnet-src }: +{ + nixpkgs, + rust, + starknet-devnet-src, +}: let - starknet-devnet = nixpkgs.rustPlatform.buildRustPackage { + rust-platform = nixpkgs.makeRustPlatform { + cargo = rust; + rustc = rust; + }; + + starknet-devnet = rust-platform.buildRustPackage { name = "starknet-devnet"; src = starknet-devnet-src; diff --git a/nix/universal-sierra-compiler.nix b/nix/universal-sierra-compiler.nix new file mode 100644 index 00000000..f86021ed --- /dev/null +++ b/nix/universal-sierra-compiler.nix @@ -0,0 +1,29 @@ +{ + nixpkgs, + rust, + universal-sierra-compiler-src, +}: + +let + rust-platform = nixpkgs.makeRustPlatform { + cargo = rust; + rustc = rust; + }; + + universal-sierra-compiler = rust-platform.buildRustPackage { + pname = "universal-sierra-compiler"; + version = "2.2.0"; + + src = universal-sierra-compiler-src; + + cargoLock = { + lockFile = universal-sierra-compiler-src + "/Cargo.lock"; + outputHashes = { + "cairo-lang-casm-1.0.0-alpha.6" = "sha256-U4kTAAktXK7bFEkQAISQK3954hDkyxdsJU9c5hXmzpU="; + }; + }; + + doCheck = false; + }; +in +universal-sierra-compiler diff --git a/rust-toolchain-1.79.toml b/rust-toolchain-1.79.toml new file mode 100644 index 00000000..39235a11 --- /dev/null +++ b/rust-toolchain-1.79.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.79" +profile = "default" diff --git a/rust-toolchain-wasm.toml b/rust-toolchain-wasm.toml index a2878b8f..0d3bdb7a 100644 --- a/rust-toolchain-wasm.toml +++ b/rust-toolchain-wasm.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.80" +channel = "1.80.1" profile = "default" targets = ["wasm32-unknown-unknown"] \ No newline at end of file