From 2ada28b4c27b8b4ded013a6e4d7978f8fb4db664 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Sat, 31 Aug 2024 10:25:02 +1000 Subject: [PATCH 1/4] Bump Koios release and update changelog --- docs/Build/grest-changelog.md | 30 ++++++++++++++++++++- files/configs/mainnet/config.json | 2 +- files/node-deps.json | 6 +++++ scripts/grest-helper-scripts/setup-grest.sh | 2 +- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/docs/Build/grest-changelog.md b/docs/Build/grest-changelog.md index 154ca7b41..732b3be14 100644 --- a/docs/Build/grest-changelog.md +++ b/docs/Build/grest-changelog.md @@ -1,6 +1,34 @@ # Koios gRest Changelog -## [1.2.0a] - For all networks. +## [1.2.0] - For all networks. + +This is a finalised release that builds on `1.2.0a` to provide support for CIP-129 and add a summary of votes for given proposal. The changes accordingly are primarily only targetting Governance endpoints. This will be the version used for mainnet upgrade as well. Please go through the changelogs below + +### New endpoints added: +- `/proposal_voting_summary` - Get a summary of votes cast on specified governance action [#300] + +### Data Input/Output Changes: +- Input - `/commitee_votes` - Will require `_cc_hot_id` which will accept committee member hot key formatted in bech32 as per CIP-0005/129 [#300] +- Input - `/voter_proposal_list` - Will require `_voter_id` which will accept DRep/SPO/Committee member formatted in bech32 as per CIP-0005/129 [#300] +- Input - `/proposal_votes` - Will require `_proposal_id` which will accept government proposal ID formatted in bech32 as per CIP-129 [#300] +- Output - `/drep_metadata` , `/drep_updates`, - added column `has_script` which shows if given credential is a script hash [#300] +- Output - `/drep_votes` , `/proposal_list` , `/committee_info` - added column `proposal_id` to show proposal action ID in accordance with CIP-129 [#300] +- Output - `/proposal_votes` , - `voter` is renamed to `voter_id` and shows DRep/Pool/Committee member formatted in bech32 as per CIP-129 [#300] +- Output - Any references to drep in output columns is now assumed to be in CIP-129 format [#300] + +### Deprecations: +- None + +### Retirements: +- None + +### Chores: +- Change indexing for dreps from view to hex [#300] +- Extend utility functions for CIP-129 conversions from hex [#300] + +[#300]: https://github.com/cardano-community/koios-artifacts/pull/300 + +## [1.2.0a] - For non-mainnet networks. This release starts providing Conway support providing 14 new endpoints - primarily focusing on new governance data. Also, based on community requests/feedbacks - it introduces a few breaking changes for `tx_info` and `block_tx_info` endpoints. Please go through the changelogs below diff --git a/files/configs/mainnet/config.json b/files/configs/mainnet/config.json index e3ebbc067..6518a24d9 100644 --- a/files/configs/mainnet/config.json +++ b/files/configs/mainnet/config.json @@ -13,7 +13,7 @@ "RequiresNetworkMagic": "RequiresNoMagic", "ShelleyGenesisFile": "/opt/cardano/cnode/files/shelley-genesis.json", "SnapshotInterval": 86400, - "MempoolCapacityBytesOverride": 8388608, + "MempoolCapacityBytesOverride": 67108864, "EnableLogging": true, "EnableLogMetrics": false, "TargetNumberOfActivePeers": 20, diff --git a/files/node-deps.json b/files/node-deps.json index 0f22af8b0..aa79969ca 100644 --- a/files/node-deps.json +++ b/files/node-deps.json @@ -6,6 +6,12 @@ "sodium": "dbb48cce5429cb6585c9034f002568964f1ce567" }, "8.9.4": + { + "blst": "3dd0f804b1819e5d03fb22ca2e6fac105932043a", + "secp256k1": "v0.3.2", + "sodium": "dbb48cce5429cb6585c9034f002568964f1ce567" + }, + "9.1.0": { "blst": "3dd0f804b1819e5d03fb22ca2e6fac105932043a", "secp256k1": "v0.3.2", diff --git a/scripts/grest-helper-scripts/setup-grest.sh b/scripts/grest-helper-scripts/setup-grest.sh index 3552e6aa3..642500e11 100755 --- a/scripts/grest-helper-scripts/setup-grest.sh +++ b/scripts/grest-helper-scripts/setup-grest.sh @@ -16,7 +16,7 @@ # Do NOT modify code below # ###################################### -SGVERSION=v1.2.0b +SGVERSION=v1.2.0 ######## Functions ######## usage() { From 1ac2f3ac9a5ce4953e7745eaa879672543ebbc15 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:50:37 +1000 Subject: [PATCH 2/4] mithril.library: call to env should be in offline mode --- scripts/cnode-helper-scripts/mithril.library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/mithril.library b/scripts/cnode-helper-scripts/mithril.library index fa8bca425..59bfdafd6 100644 --- a/scripts/cnode-helper-scripts/mithril.library +++ b/scripts/cnode-helper-scripts/mithril.library @@ -14,7 +14,7 @@ CI_MODE='N' # setting it to an incompatible version with the currently suported cardano-node # version. There is no need to source the environment file in CI mode. if [[ ${CI_MODE} == 'N' ]] ; then - . "$(dirname $0)"/env + . "$(dirname $0)"/env offline fi ############################# From 7558c748a32e49612b598c296ef9da030d1d5c68 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:09:24 +1000 Subject: [PATCH 3/4] Fix getmetrics script (function names --- scripts/grest-helper-scripts/getmetrics.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/grest-helper-scripts/getmetrics.sh b/scripts/grest-helper-scripts/getmetrics.sh index c188f9e99..7c760a6f1 100755 --- a/scripts/grest-helper-scripts/getmetrics.sh +++ b/scripts/grest-helper-scripts/getmetrics.sh @@ -28,7 +28,7 @@ exec 2>/dev/null [[ -z ${DBSYNC_PROM_PORT} ]] && DBSYNC_PROM_PORT=8080 [[ -z ${PGDATABASE} ]] && PGDATABASE=cexplorer -function get-metrics() { +function get_metrics() { shopt -s expand_aliases if [ -n "$SERVED" ]; then echo "Content-type: text/plain" # Tells the browser what kind of content to expect @@ -99,4 +99,4 @@ function get-metrics() { done } -get-metrics +get_metrics From 5531f8ab9202894278983bd5b01b4fa1a14d0ef3 Mon Sep 17 00:00:00 2001 From: illuminatus Date: Sun, 1 Sep 2024 21:14:25 -0700 Subject: [PATCH 4/4] [mithril] client script adjustments (#1813) mithril-client.sh changes - mithril-client.sh source env in offline mode - mithril-client.sh Help text parsed first from -h, or --help. - cnode.sh use -u when calling mithril-client.sh to avoid update checks in non gui mode Co-authored-by: RdLrT <3169068+rdlrt@users.noreply.github.com> --- scripts/cnode-helper-scripts/cnode.sh | 2 +- .../cnode-helper-scripts/mithril-client.sh | 20 ++++++++++++----- scripts/cnode-helper-scripts/mithril.library | 22 ++++++++++--------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/scripts/cnode-helper-scripts/cnode.sh b/scripts/cnode-helper-scripts/cnode.sh index c7767930a..f554f5d3a 100755 --- a/scripts/cnode-helper-scripts/cnode.sh +++ b/scripts/cnode-helper-scripts/cnode.sh @@ -63,7 +63,7 @@ mithril_snapshot_download() { if [[ ! -f "${MITHRIL_CLIENT}" ]] || [[ ! -e "${MITHRIL_CLIENT}" ]]; then echo "ERROR: Could not locate mithril-client.sh script or script is not executable. Skipping mithril cardano-db snapshot download!!" else - "${MITHRIL_CLIENT}" cardano-db download + "${MITHRIL_CLIENT}" -u cardano-db download fi } diff --git a/scripts/cnode-helper-scripts/mithril-client.sh b/scripts/cnode-helper-scripts/mithril-client.sh index 48c100938..705514d41 100755 --- a/scripts/cnode-helper-scripts/mithril-client.sh +++ b/scripts/cnode-helper-scripts/mithril-client.sh @@ -20,10 +20,11 @@ usage() { cat <<-EOF - Usage: $(basename "$0") [-u] [] + Usage: $(basename "$0") [-h] [-u] [] A script to run Cardano Mithril Client - -u Skip script update check overriding UPDATE_CHECK value in env (must be first argument to script) + [ -h | --help] Print this help + [ -u | --skip-update ] Skip script update check overriding UPDATE_CHECK value in env (must be first argument to script) Commands: environment Manage mithril environment file @@ -46,14 +47,25 @@ EOF } SKIP_UPDATE=N -[[ $1 = "-u" ]] && export SKIP_UPDATE=Y && shift +[[ $1 =~ "-u" ]] || [[ $1 =~ "--skip-update" ]] && export SKIP_UPDATE=Y && shift ##################### # Execution/Main # ##################### +function parse_opt_for_help() { + for value in "$@"; do + if [[ $value == "-h" ]] || [[ $value == "--help" ]]; then + usage + exit 0 + fi + done +} + function main() { + parse_opt_for_help "$@" + . "$(dirname $0)"/mithril.library update_check "$@" @@ -135,9 +147,7 @@ function main() { esac ;; *) - echo "Invalid $(basename "$0") command: $1" >&2 usage - exit 1 ;; esac diff --git a/scripts/cnode-helper-scripts/mithril.library b/scripts/cnode-helper-scripts/mithril.library index 59bfdafd6..66591bb82 100644 --- a/scripts/cnode-helper-scripts/mithril.library +++ b/scripts/cnode-helper-scripts/mithril.library @@ -235,16 +235,17 @@ set_node_minimum_version() { } update_check() { - # Check availability of checkUpdate function - if [[ ! $(command -v checkUpdate) ]]; then - echo -e "\nCould not find checkUpdate function in env, make sure you're using official guild docos for installation!" - exit 1 - fi - # Check if flag is set by script to skip update check - [[ ${SKIP_UPDATE} == Y ]] && return 0 - # Check if flag is set by user as a global (container environments etc.) to skip update check - if [[ ${UPDATE_CHECK} = Y ]]; then + # Check if flag is set by user as a global or script to skip update check + if [[ ${UPDATE_CHECK} = Y && ${SKIP_UPDATE} != Y ]]; then + echo "Checking for script updates..." + + # Check availability of checkUpdate function + if [[ ! $(command -v checkUpdate) ]]; then + echo -e "\nCould not find checkUpdate function in env, make sure you're using official guild docos for installation!" + exit 1 + fi + # check for env update ENV_UPDATED=${BATCH_AUTO_UPDATE} checkUpdate "${PARENT}"/env N N N @@ -252,13 +253,14 @@ update_check() { 1) ENV_UPDATED=Y ;; 2) exit 1 ;; esac + # check for mithril.library update checkUpdate "${PARENT}"/mithril.library N N N - # borrow ENV_UPDATED for mithril.library updates case $? in 1) ENV_UPDATED=Y ;; 2) exit 1 ;; esac + # check the script update checkUpdate "${PARENT}"/"$(basename "$0")" ${ENV_UPDATED} case $? in