Skip to content

Commit cbf789d

Browse files
committed
Merge remote-tracking branch 'origin/compatible' into HEAD
2 parents ffb1f37 + fe0623b commit cbf789d

File tree

55 files changed

+1278
-1136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1278
-1136
lines changed

buildkite/src/Command/Rosetta/Connectivity.dhall

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ let Profiles = ../../Constants/Profiles.dhall
2626

2727
let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type
2828

29+
let B/If = B.definitions/commandStep/properties/if/Type
30+
2931
let Spec =
3032
{ Type =
3133
{ dockerType : Dockers.Type
@@ -35,6 +37,7 @@ let Spec =
3537
, timeout : Natural
3638
, profile : Profiles.Type
3739
, scope : List PipelineScope.Type
40+
, if : B/If
3841
}
3942
, default =
4043
{ dockerType = Dockers.Type.Bullseye
@@ -44,6 +47,8 @@ let Spec =
4447
, timeout = 1000
4548
, profile = Profiles.Type.Devnet
4649
, scope = PipelineScope.Full
50+
, if =
51+
"build.pull_request.base_branch != \"develop\" || build.branch == \"develop\""
4752
}
4853
}
4954

@@ -68,6 +73,7 @@ let command
6873
"rosetta-${Network.lowerName spec.network}-connectivity-test"
6974
, target = Size.XLarge
7075
, soft_fail = Some spec.softFail
76+
, if = Some spec.if
7177
, depends_on =
7278
Dockers.dependsOn
7379
Dockers.DepsSpec::{

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
inputs.utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
1515
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11-small";
1616
inputs.nixpkgs-old.url = "github:nixos/nixpkgs/nixos-23.05-small";
17+
inputs.nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
1718

1819
inputs.mix-to-nix.url = "github:serokell/mix-to-nix";
1920
inputs.nix-npm-buildPackage.url = "github:serokell/nix-npm-buildpackage";
@@ -38,7 +39,8 @@
3839
# - flake.nix (and flake.lock after running
3940
# `nix flake update opam-repository`).
4041
# - scripts/update_opam_switch.sh
41-
inputs.opam-repository.url = "github:ocaml/opam-repository/08d8c16c16dc6b23a5278b06dff0ac6c7a217356";
42+
inputs.opam-repository.url =
43+
"github:ocaml/opam-repository/08d8c16c16dc6b23a5278b06dff0ac6c7a217356";
4244
inputs.opam-repository.flake = false;
4345

4446
inputs.nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla";
@@ -60,7 +62,7 @@
6062

6163
outputs = inputs@{ self, nixpkgs, utils, mix-to-nix, nix-npm-buildPackage
6264
, opam-nix, opam-repository, nixpkgs-mozilla, flake-buildkite-pipeline
63-
, nix-utils, flockenzeit, nixpkgs-old, ... }:
65+
, nix-utils, flockenzeit, nixpkgs-old, nixpkgs-unstable, ... }:
6466
let
6567
inherit (nixpkgs) lib;
6668

@@ -103,9 +105,7 @@
103105
# Skip tests on nodejs dep due to known issue with nixpkgs 24.11 https://github.com/NixOS/nixpkgs/issues/402079
104106
# this can be removed after upgrading
105107
skipNodeTests = final: prev: {
106-
nodejs = prev.nodejs.overrideAttrs(old: {
107-
doCheck = false;
108-
});
108+
nodejs = prev.nodejs.overrideAttrs (old: { doCheck = false; });
109109
};
110110
};
111111
nixosModules.mina = import ./nix/modules/mina.nix inputs;
@@ -273,12 +273,47 @@
273273
};
274274
} // utils.lib.eachDefaultSystem (system:
275275
let
276-
rocksdbOverlay = pkgs: prev:
277-
if prev.stdenv.isx86_64 then {
278-
rocksdb-mina = pkgs.rocksdb511;
279-
} else {
280-
rocksdb-mina = pkgs.rocksdb;
281-
};
276+
# Helper function to map dependencies to current nixpkgs equivalents
277+
mapDepsToCurrentPkgs = pkgs: deps:
278+
map (dep:
279+
if pkgs ? ${dep.pname or dep.name or ""} then
280+
pkgs.${dep.pname or dep.name or ""}
281+
else
282+
dep) deps;
283+
284+
# Helper function to disable compression libraries in cmake flags
285+
disableCompressionLibs = flags:
286+
builtins.filter (flag: flag != [ ]) (map (flag:
287+
if builtins.isString flag
288+
&& builtins.match ".*WITH_(BZ2|LZ4|SNAPPY|ZLIB|ZSTD)=1.*" flag
289+
!= null then
290+
builtins.replaceStrings [ "=1" ] [ "=0" ] flag
291+
else
292+
flag) flags);
293+
294+
rocksdbOverlay = pkgs: prev: {
295+
rocksdb-mina = let
296+
# Get the full derivation from unstable but build with current nixpkgs
297+
unstableRocksdb =
298+
(nixpkgs-unstable.legacyPackages.${system}.rocksdb.override {
299+
enableShared = false;
300+
enableLiburing = false;
301+
bzip2 = null;
302+
lz4 = null;
303+
snappy = null;
304+
zlib = null;
305+
zstd = null;
306+
});
307+
in pkgs.stdenv.mkDerivation (unstableRocksdb.drvAttrs // {
308+
cmakeFlags =
309+
disableCompressionLibs unstableRocksdb.drvAttrs.cmakeFlags;
310+
# Override the build environment to use current nixpkgs toolchain
311+
nativeBuildInputs = mapDepsToCurrentPkgs pkgs
312+
(unstableRocksdb.nativeBuildInputs or [ ]);
313+
buildInputs =
314+
mapDepsToCurrentPkgs pkgs (unstableRocksdb.buildInputs or [ ]);
315+
});
316+
};
282317
go119Overlay = (_: _: {
283318
inherit (nixpkgs-old.legacyPackages.${system})
284319
go_1_19 buildGo119Module;
@@ -326,7 +361,7 @@
326361
(pkgs.python3.withPackages
327362
(python-pkgs: [ python-pkgs.click python-pkgs.requests ]))
328363
jq
329-
rocksdb.tools
364+
rocksdb-mina.tools
330365
];
331366
in {
332367

nix/impure-shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pkgs.mkShell {
2121
wasm-pack
2222
lmdb
2323
rosetta-cli
24-
rocksdb.tools
24+
rocksdb-mina.tools
2525
];
2626
OPAMSWITCH = "mina";
2727
MINA_ROCKSDB = "${pkgs.rocksdb-mina}/lib/librocksdb.a";

nix/misc.nix

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,4 @@
22
final: prev: {
33
sodium-static =
44
final.libsodium.overrideAttrs (o: { dontDisableStatic = true; });
5-
6-
rocksdb = (prev.rocksdb.override {
7-
snappy = null;
8-
lz4 = null;
9-
zstd = null;
10-
bzip2 = null;
11-
}).overrideAttrs (_: {
12-
cmakeFlags = [
13-
"-DPORTABLE=1"
14-
"-DWITH_JEMALLOC=0"
15-
"-DWITH_JNI=0"
16-
"-DWITH_BENCHMARK_TOOLS=0"
17-
"-DWITH_TESTS=1"
18-
"-DWITH_TOOLS=0"
19-
"-DWITH_BZ2=0"
20-
"-DWITH_LZ4=0"
21-
"-DWITH_SNAPPY=0"
22-
"-DWITH_ZLIB=0"
23-
"-DWITH_ZSTD=0"
24-
"-DWITH_GFLAGS=0"
25-
"-DUSE_RTTI=1"
26-
];
27-
});
28-
29-
rocksdb511 = let
30-
impl = (import (fetchTarball {
31-
url = "https://github.com/NixOS/nixpkgs/archive/nixos-19.03-small.tar.gz";
32-
sha256 = "11z6ajj108fy2q5g8y4higlcaqncrbjm3dnv17pvif6avagw4mcb";
33-
}) { system = "x86_64-linux"; }).rocksdb.override {
34-
snappy = null;
35-
lz4 = null;
36-
bzip2 = null;
37-
};
38-
in if impl.version == "5.11.3" then
39-
impl
40-
else
41-
throw "Expected rocksdb version 5.11.3, but got ${impl.version}";
425
}

nix/ocaml.nix

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,14 @@ let
6565
'';
6666
};
6767

68-
rocksdb_stubs = super.rocksdb_stubs.overrideAttrs (oa: {
69-
MINA_ROCKSDB = let
70-
mainPath = "${pkgs.rocksdb-mina}/lib/librocksdb.a";
71-
staticPath =
72-
"${pkgs.rocksdb-mina.static or pkgs.rocksdb-mina}/lib/librocksdb.a";
73-
in if builtins.pathExists mainPath then
74-
mainPath
75-
else if builtins.pathExists staticPath then
76-
staticPath
77-
else
78-
throw
79-
"Could not find librocksdb.a in either ${mainPath} or ${staticPath}";
80-
});
68+
rocksdb_stubs =
69+
# TODO uncomment after updating rocksdb_stubs to 10.5.1
70+
# assert (super.rocksdb_stubs.version == pkgs.rocksdb-mina.version)
71+
# || builtins.throw
72+
# "rocksdb_stubs version (${super.rocksdb_stubs.version}) does not match rocksdb-mina version (${pkgs.rocksdb-mina.version})";
73+
super.rocksdb_stubs.overrideAttrs {
74+
MINA_ROCKSDB = "${pkgs.rocksdb-mina}/lib/librocksdb.a";
75+
};
8176

8277
# This is needed because
8378
# - lld package is not wrapped to pick up the correct linker flags

nix/pin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Find the root of the Mina repo
55
ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/.. &> /dev/null && pwd )
66
# Update the submodules
7-
pushd "$ROOT" && git submodule sync && git submodule update --init --recursive && popd
7+
pushd "$ROOT" && git submodule sync && git submodule update --init --recursive --depth 1 && popd
88
# Add the flake registry entry
99
nix registry add mina "git+file://$ROOT?submodules=1"

scripts/tests/rosetta-load.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ readonly DEFAULT_PAYMENT_TX_INTERVAL="2"
5959
readonly DEFAULT_ZKAPP_TX_INTERVAL="1"
6060

6161
# Default memory threshold for PostgreSQL processes
62-
readonly DEFAULT_POSTGRES_MEMORY_THRESHOLD="2500" # MB
62+
readonly DEFAULT_POSTGRES_MEMORY_THRESHOLD="3000" # MB
6363

6464
# Default memory threshold for Rosetta API processes
6565
readonly DEFAULT_ROSETTA_MEMORY_THRESHOLD="300" # MB

src/app/cli/src/cli_entrypoint/mina_cli_entrypoint.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,11 @@ let snark_hashes =
17041704
fun () -> if json then Core.printf "[]\n%!"]
17051705

17061706
let internal_commands logger ~itn_features =
1707+
let signature_kind = Mina_signature_kind.t_DEPRECATED in
17071708
[ ( Snark_worker.Intf.command_name
17081709
, Snark_worker.command ~proof_level:Genesis_constants.Compiled.proof_level
17091710
~constraint_constants:Genesis_constants.Compiled.constraint_constants
1710-
~commit_id:Mina_version.commit_id
1711-
~signature_kind:Mina_signature_kind.t_DEPRECATED )
1711+
~commit_id:Mina_version.commit_id ~signature_kind )
17121712
; ("snark-hashes", snark_hashes)
17131713
; ( "run-prover"
17141714
, Command.async
@@ -1727,8 +1727,7 @@ let internal_commands logger ~itn_features =
17271727
let%bind prover =
17281728
Prover.create ~commit_id:Mina_version.commit_id ~logger
17291729
~proof_level ~constraint_constants
1730-
~pids:(Pid.Table.create ()) ~conf_dir
1731-
~signature_kind:Mina_signature_kind.t_DEPRECATED ()
1730+
~pids:(Pid.Table.create ()) ~conf_dir ~signature_kind ()
17321731
in
17331732
Prover.prove_from_input_sexp prover sexp >>| ignore
17341733
| `Eof ->
@@ -1755,7 +1754,6 @@ let internal_commands logger ~itn_features =
17551754
Reader.read_sexp reader )
17561755
with
17571756
| `Ok sexp -> (
1758-
let signature_kind = Mina_signature_kind.t_DEPRECATED in
17591757
let%bind worker_state =
17601758
Snark_worker.Inputs.Worker_state.create ~proof_level
17611759
~constraint_constants ~signature_kind ()
@@ -1988,7 +1986,7 @@ let internal_commands logger ~itn_features =
19881986
Prover.create ~commit_id:Mina_version.commit_id ~logger ~pids
19891987
~conf_dir ~proof_level
19901988
~constraint_constants:precomputed_values.constraint_constants
1991-
~signature_kind:Mina_signature_kind.t_DEPRECATED ()
1989+
~signature_kind ()
19921990
in
19931991
match%bind
19941992
Prover.create_genesis_block prover

src/app/cli/src/init/transaction_snark_profiler.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ let command =
184184
in
185185
let proof_level = Genesis_constants.Proof_level.Full in
186186
let proof_cache_db = Proof_cache_tag.create_identity_db () in
187-
let signature_kind = Mina_signature_kind.t_DEPRECATED in
187+
let signature_kind = Mina_signature_kind.Testnet in
188188
if witness_only then
189189
witness ~proof_cache_db ~genesis_constants ~constraint_constants
190190
~proof_level ~max_num_updates ~logger ~signature_kind ?min_num_updates

0 commit comments

Comments
 (0)