Skip to content

Commit 79dd098

Browse files
authored
Merge branch 'main' into feat/mythril
2 parents ea133fd + 8f2dde2 commit 79dd098

File tree

9 files changed

+180
-75
lines changed

9 files changed

+180
-75
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: github-actions
5+
directory: "/"
6+
schedule:
7+
interval: daily
8+
time: '00:00'
9+
timezone: UTC
10+
open-pull-requests-limit: 10
11+
commit-message:
12+
prefix: "chore"
13+
include: "scope"

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
steps:
2121
- uses: actions/checkout@v3
2222

23-
- uses: cachix/install-nix-action@v19
23+
- uses: cachix/install-nix-action@v20
2424
with:
2525
nix_path: nixpkgs=channel:nixos-22.11
2626
github_access_token: ${{ secrets.GITHUB_TOKEN }}
2727

28-
- uses: cachix/cachix-action@v11
28+
- uses: cachix/cachix-action@v12
2929
with:
3030
name: nix-blockchain-development
3131
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update Nix Flake lockfile
2+
3+
on:
4+
# Enable option to manually run the action:
5+
workflow_dispatch:
6+
7+
# Run every Sunday at 00:00:
8+
schedule:
9+
- cron: 0 0 * * 0
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: cachix/install-nix-action@v20
19+
with:
20+
nix_path: nixpkgs=channel:nixos-unstable
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Run `nix flake update`
24+
id: update-lockfile
25+
run: ./scripts/commit_flake_update.bash
26+
27+
- uses: tibdex/[email protected]
28+
id: generate-token
29+
with:
30+
app_id: ${{ secrets.APP_ID }}
31+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
32+
33+
- name: Create Pull Request
34+
uses: peter-evans/create-pull-request@v5
35+
with:
36+
token: ${{ steps.generate-token.outputs.token }}
37+
title: 'Update Nix Flake lockfile'
38+
commit-message: ${{ env.COMMIT_MSG }}
39+
branch: 'create-pull-request/update-flake-lockfile'
40+
delete-branch: true
41+
branch-suffix: timestamp
42+
add-paths: flake.lock

overlay.nix

Lines changed: 76 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
_finalNixpkgs: prevNixpkgs: let
2-
solana-rust-artifacts = prevNixpkgs.callPackage ./packages/solana-rust-artifacts {};
2+
inherit (prevNixpkgs) callPackage symlinkJoin fetchFromGitHub;
3+
inherit (prevNixpkgs.lib) optionalAttrs;
34

4-
solana-bpf-tools = prevNixpkgs.callPackage ./packages/solana-bpf-tools {};
5+
solana-rust-artifacts = callPackage ./packages/solana-rust-artifacts {};
56

6-
solana-full-sdk = prevNixpkgs.callPackage ./packages/solana-full-sdk {
7+
solana-bpf-tools = callPackage ./packages/solana-bpf-tools {};
8+
9+
solana-full-sdk = callPackage ./packages/solana-full-sdk {
710
inherit solana-rust-artifacts solana-bpf-tools;
811
};
912

10-
cosmos-theta-testnet = prevNixpkgs.callPackage ./packages/cosmos-theta-testnet {};
13+
cosmos-theta-testnet = callPackage ./packages/cosmos-theta-testnet {};
1114

12-
circom = prevNixpkgs.callPackage ./packages/circom/default.nix {};
13-
circ = prevNixpkgs.callPackage ./packages/circ/default.nix {};
15+
circom = callPackage ./packages/circom/default.nix {};
16+
circ = callPackage ./packages/circ/default.nix {};
1417

15-
wasmd = prevNixpkgs.callPackage ./packages/wasmd/default.nix {};
18+
wasmd = callPackage ./packages/wasmd/default.nix {};
1619

1720
# erdpy depends on cattrs >= 22.2
1821
cattrs22-2 = prevNixpkgs.python3Packages.cattrs.overridePythonAttrs (previousAttrs: rec {
1922
version = "22.2.0";
2023

21-
src = prevNixpkgs.fetchFromGitHub {
24+
src = fetchFromGitHub {
2225
owner = "python-attrs";
2326
repo = "cattrs";
2427
rev = "v${version}";
@@ -34,7 +37,7 @@ _finalNixpkgs: prevNixpkgs: let
3437
prevNixpkgs.buildGoModule (args
3538
// {
3639
version = "1.11.1";
37-
src = prevNixpkgs.fetchFromGitHub {
40+
src = fetchFromGitHub {
3841
owner = "ethereum";
3942
repo = "go-ethereum";
4043
rev = "v1.11.1";
@@ -46,26 +49,26 @@ _finalNixpkgs: prevNixpkgs: let
4649
};
4750

4851
# copied from https://github.com/NixOS/nixpkgs/blob/8df7949791250b580220eb266e72e77211bedad9/pkgs/development/python-modules/cryptography/default.nix
49-
cryptography36 = prevNixpkgs.callPackage ./packages/python-modules/cryptography36/default.nix {};
52+
cryptography36 = callPackage ./packages/python-modules/cryptography36/default.nix {};
5053

51-
ledgercomm = prevNixpkgs.callPackage ./packages/python-modules/ledgercomm/default.nix {};
52-
requests-cache = prevNixpkgs.callPackage ./packages/python-modules/requests-cache/default.nix {};
54+
ledgercomm = callPackage ./packages/python-modules/ledgercomm/default.nix {};
55+
requests-cache = callPackage ./packages/python-modules/requests-cache/default.nix {};
5356

54-
erdpy = prevNixpkgs.callPackage ./packages/erdpy/default.nix {};
55-
elrond-go = prevNixpkgs.callPackage ./packages/elrond-go/default.nix {};
56-
elrond-proxy-go = prevNixpkgs.callPackage ./packages/elrond-proxy-go/default.nix {};
57+
erdpy = callPackage ./packages/erdpy/default.nix {};
58+
elrond-go = callPackage ./packages/elrond-go/default.nix {};
59+
elrond-proxy-go = callPackage ./packages/elrond-proxy-go/default.nix {};
5760

58-
go-opera = prevNixpkgs.callPackage ./packages/go-opera/default.nix {};
61+
go-opera = callPackage ./packages/go-opera/default.nix {};
5962

60-
leap = prevNixpkgs.callPackage ./packages/leap/default.nix {};
61-
eos-vm = prevNixpkgs.callPackage ./packages/eos-vm/default.nix {};
62-
cdt = prevNixpkgs.callPackage ./packages/cdt/default.nix {};
63+
leap = callPackage ./packages/leap/default.nix {};
64+
eos-vm = callPackage ./packages/eos-vm/default.nix {};
65+
cdt = callPackage ./packages/cdt/default.nix {};
6366

64-
nimbus = prevNixpkgs.callPackage ./packages/nimbus/default.nix {};
67+
nimbus = callPackage ./packages/nimbus/default.nix {};
6568

66-
pistache = prevNixpkgs.callPackage ./packages/pistache/default.nix {};
67-
ffiasm-src = prevNixpkgs.callPackage ./packages/ffiasm/src.nix {};
68-
zqfield = prevNixpkgs.callPackage ./packages/ffiasm/zqfield.nix {
69+
pistache = callPackage ./packages/pistache/default.nix {};
70+
ffiasm-src = callPackage ./packages/ffiasm/src.nix {};
71+
zqfield = callPackage ./packages/ffiasm/zqfield.nix {
6972
inherit ffiasm-src;
7073
};
7174
# Pairing Groups on BN-254, aka alt_bn128
@@ -76,7 +79,7 @@ _finalNixpkgs: prevNixpkgs: let
7679
# https://eips.ethereum.org/EIPS/eip-197
7780
# https://hackmd.io/@aztec-network/ByzgNxBfd
7881
# https://hackmd.io/@jpw/bn254
79-
zqfield-bn254 = prevNixpkgs.symlinkJoin {
82+
zqfield-bn254 = symlinkJoin {
8083
name = "zqfield-bn254";
8184
paths = [
8285
(zqfield {
@@ -90,14 +93,14 @@ _finalNixpkgs: prevNixpkgs: let
9093
})
9194
];
9295
};
93-
ffiasm = prevNixpkgs.callPackage ./packages/ffiasm/default.nix {
96+
ffiasm = callPackage ./packages/ffiasm/default.nix {
9497
inherit ffiasm-src zqfield-bn254;
9598
};
96-
circom_runtime = prevNixpkgs.callPackage ./packages/circom_runtime/default.nix {};
97-
rapidsnark = prevNixpkgs.callPackage ./packages/rapidsnark/default.nix {
99+
circom_runtime = callPackage ./packages/circom_runtime/default.nix {};
100+
rapidsnark = callPackage ./packages/rapidsnark/default.nix {
98101
inherit ffiasm zqfield-bn254;
99102
};
100-
rapidsnark-server = prevNixpkgs.callPackage ./packages/rapidsnark-server/default.nix {
103+
rapidsnark-server = callPackage ./packages/rapidsnark-server/default.nix {
101104
inherit ffiasm zqfield-bn254 rapidsnark pistache;
102105
};
103106

@@ -540,43 +543,49 @@ _finalNixpkgs: prevNixpkgs: let
540543
eth-bloom-104 = prevNixpkgs.callPackage ./packages/python-modules/eth-bloom-104/default.nix {};
541544
z3-solver = prevNixpkgs.callPackage ./packages/python-modules/z3-solver/default.nix {inherit jinja2_fixed;};
542545
in {
543-
metacraft-labs = rec {
544-
solana = solana-full-sdk;
545-
inherit cosmos-theta-testnet;
546-
inherit circom;
547-
548-
# Disabled until cvc4 compiles again
549-
# inherit circ;
550-
551-
inherit wasmd;
552-
inherit ledgercomm;
553-
inherit cryptography36;
554-
inherit requests-cache;
555-
inherit erdpy;
556-
inherit cattrs22-2;
557-
558-
# Disabled until elrond-go can build with Go >= 1.19
559-
# inherit elrond-go;
560-
# inherit elrond-proxy-go;
561-
inherit go-opera;
562-
inherit leap;
563-
inherit eos-vm;
564-
inherit cdt;
565-
566-
# Ethereum
567-
inherit nimbus;
568-
inherit go-ethereum-capella;
569-
570-
inherit pistache;
571-
inherit zqfield-bn254;
572-
inherit zqfield;
573-
inherit ffiasm;
574-
inherit circom_runtime;
575-
inherit rapidsnark;
576-
inherit rapidsnark-server;
577-
578-
inherit mythril;
579-
inherit blake2b-py;
580-
inherit py-solc-x;
581-
};
546+
metacraft-labs =
547+
rec {
548+
solana = solana-full-sdk;
549+
inherit cosmos-theta-testnet;
550+
inherit circom;
551+
552+
# Disabled until cvc4 compiles again
553+
# inherit circ;
554+
555+
inherit wasmd;
556+
557+
# ElrondGo:
558+
inherit ledgercomm;
559+
inherit cryptography36;
560+
inherit cattrs22-2;
561+
inherit requests-cache;
562+
# Disabled until elrond-go can build with Go >= 1.19
563+
# Issue #65
564+
# inherit elrond-go;
565+
# inherit elrond-proxy-go;
566+
# inherit erdpy;
567+
568+
inherit go-opera;
569+
inherit leap;
570+
inherit eos-vm;
571+
inherit cdt;
572+
573+
# Ethereum
574+
inherit nimbus;
575+
inherit go-ethereum-capella;
576+
577+
inherit zqfield-bn254;
578+
inherit ffiasm;
579+
inherit circom_runtime;
580+
inherit rapidsnark;
581+
582+
# Mythril
583+
inherit mythril;
584+
inherit blake2b-py;
585+
inherit py-solc-x;
586+
}
587+
// optionalAttrs (prevNixpkgs.hostPlatform.isLinux) {
588+
inherit pistache;
589+
inherit rapidsnark-server;
590+
};
582591
}

packages/rapidsnark-server/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
lib,
23
stdenv,
34
pistache,
45
ffiasm,
@@ -9,7 +10,12 @@
910
in
1011
stdenv.mkDerivation rec {
1112
pname = "rapidsnark-server";
12-
inherit (rapidsnark) version src nativeBuildInputs doCheck meta;
13+
inherit (rapidsnark) version src nativeBuildInputs doCheck;
14+
meta =
15+
rapidsnark.meta
16+
// {
17+
platforms = with lib.platforms; linux;
18+
};
1319
buildInputs = rapidsnark.buildInputs ++ [pistache];
1420

1521
buildPhase = ''

packages/solana-bpf-tools/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ with pkgs;
1010
};
1111

1212
# TODO autoPatchElf is Linux-specific. We need a cross-platform solution.
13-
nativeBuildInputs = [autoPatchelfHook];
13+
nativeBuildInputs = lib.optionals stdenv.isLinux [autoPatchelfHook];
1414

1515
buildInputs = with pkgs; [
1616
zlib

packages/wasmd/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
in
2222
buildGoModule rec {
2323
pname = "wasmd";
24-
version = "0.40.0-rc.0";
24+
version = "0.31.0";
2525

2626
src = fetchFromGitHub {
2727
owner = "CosmWasm";
2828
repo = "wasmd";
2929
rev = "v${version}";
30-
hash = "sha256-y+yCzOLR2nRdA6w+u3iI3c8XSHeCIpqdX90msJj+cVA=";
30+
hash = "sha256-lxx1rKvgzvWKeGnUG4Ij7K6tfL7u3cIaf6/CYRvkqLg=";
3131
};
3232

3333
proxyVendor = true;
34-
vendorSha256 = "sha256-hRFnF/GmMYy8aOU4lPO6WQOTAmqsyyf+PI0hDEJWf8k=";
34+
vendorSha256 = "sha256-Mv4Y7bsmBBnRkOxgosQDXD8jLXlS+rbz7GPCXjj5cto=";
3535

3636
subPackages = ["cmd/wasmd"];
3737

38-
buildInputs = [autoPatchelfHook];
38+
nativeBuildInputs = lib.optionals stdenv.isLinux [autoPatchelfHook];
3939

4040
postBuild = ''
4141
mkdir -p "$out/lib"

scripts/ci.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ get_platform() {
3737
}
3838

3939
set -x
40+
nix flake check
4041
nix build --json --print-build-logs ".#devShells.$(get_platform).default"

scripts/commit_flake_update.bash

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
if ! git config --get user.name >/dev/null 2>&1 || \
6+
[ "$(git config --get user.name)" = "" ] ||
7+
! git config --get user.email >/dev/null 2>&1 || \
8+
[ "$(git config --get user.email)" = "" ]; then
9+
echo "git config user.{name,email} is not set - configuring"
10+
set -x
11+
git config --local user.email "actions-bot"
12+
git config --local user.name "[email protected]"
13+
fi
14+
15+
nix flake update --commit-lock-file
16+
17+
cat >commit_msg <<EOF
18+
chore(flake.lock): Update all Flake inputs ($(date -I))
19+
20+
$(git log -1 '--pretty=format:%b' | sed '1,2d')
21+
EOF
22+
23+
git reset --soft 'HEAD~'
24+
25+
if [[ -z "${GITHUB_ENV:-}" ]]; then
26+
echo "Not running in CI - exiting"
27+
exit 0
28+
fi
29+
30+
>> "$GITHUB_ENV" cat <<EOF
31+
COMMIT_MSG<<EOV
32+
$(cat ./commit_msg)
33+
EOV
34+
EOF

0 commit comments

Comments
 (0)