Skip to content

Commit

Permalink
Merge pull request #15814 from MinaProtocol/georgeee/merge-compatible…
Browse files Browse the repository at this point in the history
…-to-develop-2024-july11

Merge compatible to develop (July 11, 2024)
  • Loading branch information
georgeee authored Jul 11, 2024
2 parents 9fbc109 + c51ad03 commit 4b080b4
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 474 deletions.
13 changes: 0 additions & 13 deletions CHANGES

This file was deleted.

27 changes: 27 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
Possible subsections:
_Added_ for new features.
_Changed_ for changes in existing functionality.
_Deprecated_ for soon-to-be removed features.
_Removed_ for now removed features.
_Fixed_ for any bug fixes.
_Security_ in case of vulnerabilities.
-->

## Unreleased (this will represent 3.0.1)

### Added
*
### Changed
*
### Fixed
*
### Security
*
3 changes: 1 addition & 2 deletions buildkite/scripts/export-git-env-vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export MINA_DEB_VERSION="${GITTAG}-${GITBRANCH}-${GITHASH}"
export MINA_DOCKER_TAG="$(echo "${MINA_DEB_VERSION}-${MINA_DEB_CODENAME}" | sed 's!/!-!g; s!_!-!g')"
export RELEASE=unstable


echo "Publishing on release channel \"${RELEASE}\""
[[ -n ${THIS_COMMIT_TAG} ]] && export MINA_COMMIT_TAG="${THIS_COMMIT_TAG}"

export MINA_DEB_RELEASE="${RELEASE}"
export MINA_DEB_RELEASE="${RELEASE}"
4 changes: 4 additions & 0 deletions scripts/deb-builder-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ cd "${SCRIPTPATH}/../_build"
# Set dependencies based on debian release
SHARED_DEPS="libssl1.1, libgmp10, libgomp1, tzdata, rocksdb-tools"

SUGGESTED_DEPS="jq, curl, wget"

ARCHIVE_MIGRATION_DEPS="jq, google-cloud-sdk"

TEST_EXECUTIVE_DEPS=", mina-logproc, python3, nodejs, yarn, google-cloud-sdk, kubectl, google-cloud-sdk-gke-gcloud-auth-plugin, terraform, helm"

case "${MINA_DEB_CODENAME}" in
Expand Down
45 changes: 26 additions & 19 deletions src/app/rosetta/indexer_test/indexer_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ type async_pool = (Caqti_async.connection, Caqti_error.t) Caqti_async.Pool.t

type pool = { uri : Uri.t; pool : async_pool }

let logger = Logger.create ()

let archive_uri_arg =
let pool =
let parse s =
Expand Down Expand Up @@ -56,17 +58,17 @@ type _ info_t =
let run_user_commands db ~offset ~limit query =
Deferred.Result.map ~f:(fun (c, commands) ->
(c, List.map commands ~f:(fun command -> User_command command)) )
@@ Lib.Search.Sql.User_commands.run db ~offset ~limit query
@@ Lib.Search.Sql.User_commands.run db ~logger ~offset ~limit query

let run_internal_commands db ~offset ~limit query =
Deferred.Result.map ~f:(fun (c, commands) ->
(c, List.map commands ~f:(fun command -> Internal_command command)) )
@@ Lib.Search.Sql.Internal_commands.run db ~offset ~limit query
@@ Lib.Search.Sql.Internal_commands.run db ~logger ~offset ~limit query

let run_zkapp_commands db ~offset ~limit query =
Deferred.Result.map ~f:(fun (c, commands) ->
(c, List.map commands ~f:(fun command -> Zkapp_command command)) )
@@ Lib.Search.Sql.Zkapp_commands.run db ~offset ~limit query
@@ Lib.Search.Sql.Zkapp_commands.run db ~logger ~offset ~limit query

module Test_values = struct
module T = struct
Expand Down Expand Up @@ -342,13 +344,18 @@ struct
let%bind generator = with_db pool (T.deferred_generator table) in
Quickcheck.async_test ~trials generator ~f:(fun value ->
let query = I.to_query value in
let limit = 100000L in
let%bind total_count, commands =
with_db pool (fun db -> run db ~offset:None ~limit:None query)
with_db pool (fun db -> run db ~offset:None ~limit:(Some limit) query)
in
let open Alcotest in
let infos = to_info commands in
check int64 "total_count = len (commands)" total_count
(Int64.of_int (List.length infos)) ;
if Int64.(total_count > limit) then
check int64 "limit = len (commands)" limit
(Int64.of_int (List.length infos))
else
check int64 "total_count = len (commands)" total_count
(Int64.of_int (List.length infos)) ;
check_condition value infos )

let test_user_command pool = test `User_commands ~pool run_user_commands
Expand All @@ -361,10 +368,10 @@ struct
let test_suite =
let open Alcotest_async in
( I.name
, [ test_case ~timeout:(sec 200.) "User commands" `Slow @@ test_user_command
; test_case ~timeout:(sec 200.) "Internal commands" `Slow
, [ test_case ~timeout:(sec 400.) "User commands" `Slow @@ test_user_command
; test_case ~timeout:(sec 400.) "Internal commands" `Slow
@@ test_internal_command
; test_case ~timeout:(sec 200.) "Zkapp commands" `Slow
; test_case ~timeout:(sec 400.) "Zkapp commands" `Slow
@@ test_zkapp_command
] )

Expand All @@ -390,13 +397,13 @@ struct
let name, tests = test_suite in
( name
, tests
@ [ test_case ~timeout:(sec 200.) "Non existing user command" `Slow
@ [ test_case ~timeout:(sec 400.) "Non existing user command" `Slow
@@ test_not_existing ~limit:50 ~table:"user_commands"
run_user_commands
; test_case ~timeout:(sec 200.) "Non existing internal command" `Slow
; test_case ~timeout:(sec 400.) "Non existing internal command" `Slow
@@ test_not_existing ~limit:50 ~table:"internal_commands"
run_internal_commands
; test_case ~timeout:(sec 200.) "Non existing zkapp command" `Slow
; test_case ~timeout:(sec 400.) "Non existing zkapp command" `Slow
@@ test_not_existing ~limit:50 ~table:"zkapp_commands"
run_zkapp_commands
] )
Expand Down Expand Up @@ -469,7 +476,7 @@ module Account_identifier = struct

let of_zkapp_command_info { Lib.Search.Zkapp_command_info.info; _ } =
Deferred.return
@@ (info.fee_payer, info.token)
@@ (info.fee_payer, `Token_id Rosetta_lib.Amount_of.Token_id.default)
:: List.map info.account_updates ~f:(fun { account; token; _ } ->
(account, token) )

Expand Down Expand Up @@ -516,7 +523,7 @@ module Op_status =

let name = "operation-status"

let trials = 30
let trials = 20

let to_query v =
let op_status =
Expand Down Expand Up @@ -668,7 +675,7 @@ module Max_block =

let name = "max-block"

let trials = 20
let trials = 10

let to_query max_block =
Lib.Search.Transaction_query.make ~max_block
Expand Down Expand Up @@ -722,7 +729,7 @@ module Offset_limit = struct
with_db pool (fun db ->
Deferred.Result.map_error ~f:(fun _ ->
Caqti_error.(request_failed ~uri:Uri.empty ~query:"" (Msg "")) )
@@ Lib.Search.Sql.run db (to_query ~offset ~limit) )
@@ Lib.Search.Sql.run ~logger db (to_query ~offset ~limit) )

let run' { offset; limit } = run ~offset ~limit

Expand Down Expand Up @@ -751,7 +758,7 @@ module Offset_limit = struct
( { offset = offset_1; limit = limit_1 }
, { offset = offset_2; limit = limit_2 } )
in
Quickcheck.async_test ~trials:10 generator ~f:(fun (value_1, value_2) ->
Quickcheck.async_test ~trials:5 generator ~f:(fun (value_1, value_2) ->
let open Deferred.Let_syntax in
let%bind info_1 = run' value_1 pool in
let%bind transactions_1_result = Ops.to_transactions info_1 in
Expand Down Expand Up @@ -779,8 +786,8 @@ module Offset_limit = struct
let test_suite =
let open Alcotest_async in
( "offset-limit"
, [ test_case ~timeout:(sec 200.) "Limit and offset" `Slow @@ test
; test_case ~timeout:(sec 200.) "Limit" `Slow @@ test_limit
, [ test_case ~timeout:(sec 400.) "Limit and offset" `Slow @@ test
; test_case ~timeout:(sec 400.) "Limit" `Slow @@ test_limit
] )
end

Expand Down
Loading

0 comments on commit 4b080b4

Please sign in to comment.