Skip to content

Commit 5c03c4b

Browse files
committed
WIP
1 parent d4df879 commit 5c03c4b

File tree

26 files changed

+601
-604
lines changed

26 files changed

+601
-604
lines changed

buildkite/src/Constants/ContainerImages.dhall

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
-- NOTE: minaToolchainBookworm is also used for building Ubuntu Jammy packages in CI
55
{ toolchainBase = "codaprotocol/ci-toolchain-base:v3"
66
, minaToolchainBullseye =
7-
"gcr.io/o1labs-192920/mina-toolchain@sha256:92657cb93045c8431e7aabff3d5493f4e5c482376526b3567b9f42b664de1cfc"
7+
"gcr.io/o1labs-192920/mina-toolchain@sha256:e537f1fb060ddb5b5db2270a4220f3d777c31c175a0480a5b0c4dc66433c0726"
88
, minaToolchainBookworm =
9-
"gcr.io/o1labs-192920/mina-toolchain@sha256:92657cb93045c8431e7aabff3d5493f4e5c482376526b3567b9f42b664de1cfc"
9+
"gcr.io/o1labs-192920/mina-toolchain@sha256:e537f1fb060ddb5b5db2270a4220f3d777c31c175a0480a5b0c4dc66433c0726"
1010
, minaToolchain =
11-
"gcr.io/o1labs-192920/mina-toolchain@sha256:92657cb93045c8431e7aabff3d5493f4e5c482376526b3567b9f42b664de1cfc"
11+
"gcr.io/o1labs-192920/mina-toolchain@sha256:e537f1fb060ddb5b5db2270a4220f3d777c31c175a0480a5b0c4dc66433c0726"
1212
, elixirToolchain = "elixir:1.10-alpine"
1313
, nodeToolchain = "node:14.13.1-stretch-slim"
1414
, ubuntu2004 = "ubuntu:20.04"

opam.export

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ installed: [
7575
"camlp-streams.5.0.1"
7676
"camomile.1.0.2"
7777
"capnp.3.4.0"
78-
"caqti.1.5.0"
79-
"caqti-async.1.3.0"
80-
"caqti-driver-postgresql.1.5.1"
78+
"caqti.2.0.1"
79+
"caqti-async.2.0.1"
80+
"caqti-driver-postgresql.2.0.1"
8181
"charInfo_width.1.1.0"
8282
"check_opam_switch.~dev"
8383
"cmdliner.1.0.3"
@@ -143,6 +143,7 @@ installed: [
143143
"lmdb.1.0"
144144
"logs.0.7.0"
145145
"lwt.5.4.0"
146+
"lwt-dllist.1.0.1"
146147
"lwt_log.1.1.1"
147148
"lwt_react.1.1.2"
148149
"macaddr.5.0.1"
@@ -160,6 +161,7 @@ installed: [
160161
"mirage-crypto-rng.0.11.0"
161162
"mirage-crypto-rng-async.0.11.0"
162163
"mmap.1.1.0"
164+
"mtime.2.0.0"
163165
"num.1.1"
164166
"ocaml.4.14.0"
165167
"ocaml-base-compiler.4.14.0"

src/app/archive/cli/archive_cli.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ let command_prune =
9191
in
9292
let go () =
9393
let open Deferred.Result.Let_syntax in
94-
let%bind ((module Conn) as conn) =
95-
Caqti_async.connect postgres.value
96-
in
94+
let%bind ((module Conn) as conn) = Mina_caqti.connect postgres.value in
9795
let%bind () = Conn.start () in
9896
match%bind.Async.Deferred
9997
let%bind () =

src/app/archive/cli/dune

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
logger
1919
block_time
2020
mina_version
21+
mina_caqti
2122
)
2223
(instrumentation (backend bisect_ppx --bisect-sigterm))
2324
(preprocess (pps ppx_version ppx_jane ppx_mina)))

src/app/archive/drop_tables.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,7 @@ DROP TABLE zkapp_events;
105105
DROP TABLE token_symbols;
106106

107107
DROP TABLE voting_for;
108+
109+
DROP TABLE zkapp_field;
110+
111+
DROP TABLE zkapp_verification_key_hashes;

src/app/archive/lib/load_data.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ let update_of_id pool update_id =
9191
let open Zkapp_basic in
9292
let query_db ~f = Mina_caqti.query ~f pool in
9393
let with_pool ~f arg =
94-
let open Caqti_async in
94+
let open Mina_caqti in
9595
Pool.use
96-
(fun (module Conn : CONNECTION) -> f (module Conn : CONNECTION) arg)
96+
(fun (module Conn : Mina_caqti.CONNECTION) ->
97+
f (module Conn : Mina_caqti.CONNECTION) arg )
9798
pool
9899
in
99100
let%bind { app_state_id
@@ -636,9 +637,10 @@ let get_account_accessed ~pool (account : Processor.Accounts_accessed.t) :
636637
(int * Account.t) Deferred.t =
637638
let query_db ~f = Mina_caqti.query ~f pool in
638639
let with_pool ~f arg =
639-
let open Caqti_async in
640+
let open Mina_caqti in
640641
Pool.use
641-
(fun (module Conn : CONNECTION) -> f (module Conn : CONNECTION) arg)
642+
(fun (module Conn : Mina_caqti.CONNECTION) ->
643+
f (module Conn : Mina_caqti.CONNECTION) arg )
642644
pool
643645
in
644646
let pk_of_id = pk_of_id pool in

src/app/archive/lib/metrics.ml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ let default_missing_blocks_width = 2000
1414

1515
module Max_block_height = struct
1616
let query =
17-
Caqti_request.find Caqti_type.unit Caqti_type.int
17+
Mina_caqti.find_req Caqti_type.unit Caqti_type.int
1818
"SELECT GREATEST(0, MAX(height)) FROM blocks"
1919

20-
let update (module Conn : Caqti_async.CONNECTION) metric_server =
20+
let update (module Conn : Mina_caqti.CONNECTION) metric_server =
2121
time ~label:"max_block_height" (fun () ->
2222
let open Deferred.Result.Let_syntax in
2323
let%map max_height = Conn.find query () in
@@ -30,7 +30,7 @@ end
3030
module Missing_blocks = struct
3131
(*A block is missing if there is no entry for a specific height. However, if there is an entry then it doesn't necessarily mean that it is part of the main chain. Unparented_blocks will show value > 1 in that case. Look for the last 2000 blocks*)
3232
let query missing_blocks_width =
33-
Caqti_request.find Caqti_type.unit Caqti_type.int
33+
Mina_caqti.find_req Caqti_type.unit Caqti_type.int
3434
(Core_kernel.sprintf
3535
{sql|
3636
SELECT COUNT( * )
@@ -40,7 +40,7 @@ module Missing_blocks = struct
4040
|sql}
4141
missing_blocks_width )
4242

43-
let update ~missing_blocks_width (module Conn : Caqti_async.CONNECTION)
43+
let update ~missing_blocks_width (module Conn : Mina_caqti.CONNECTION)
4444
metric_server =
4545
let open Deferred.Result.Let_syntax in
4646
time ~label:"missing_blocks" (fun () ->
@@ -55,13 +55,13 @@ module Unparented_blocks = struct
5555
(* parent_hashes represent ends of chains leading to an orphan block *)
5656

5757
let query =
58-
Caqti_request.find Caqti_type.unit Caqti_type.int
58+
Mina_caqti.find_req Caqti_type.unit Caqti_type.int
5959
{sql|
6060
SELECT COUNT( * ) FROM blocks
6161
WHERE parent_id IS NULL
6262
|sql}
6363

64-
let update (module Conn : Caqti_async.CONNECTION) metric_server =
64+
let update (module Conn : Mina_caqti.CONNECTION) metric_server =
6565
let open Deferred.Result.Let_syntax in
6666
time ~label:"unparented_blocks" (fun () ->
6767
let%map unparented_block_count = Conn.find query () in
@@ -73,13 +73,13 @@ end
7373

7474
let log_error ~logger pool metric_server
7575
(f :
76-
(module Caqti_async.CONNECTION)
76+
(module Mina_caqti.CONNECTION)
7777
-> Mina_metrics.Archive.t
7878
-> (unit, [> Caqti_error.call_or_retrieve ]) Deferred.Result.t ) =
7979
let open Deferred.Let_syntax in
8080
match%map
81-
Caqti_async.Pool.use
82-
(fun (module Conn : Caqti_async.CONNECTION) ->
81+
Mina_caqti.Pool.use
82+
(fun (module Conn : Mina_caqti.CONNECTION) ->
8383
f (module Conn) metric_server )
8484
pool
8585
with

0 commit comments

Comments
 (0)