Skip to content

Commit

Permalink
Merge branch 'alpha' into feature/mithril-build
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBenson authored Oct 30, 2023
2 parents d59e4b3 + 0ef12fc commit 3143290
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 46 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker_bin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ jobs:
sudo apt-get update -y
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel
sudo apt-get autoremove -y
sudo apt-get clean
sudo rm -rf /usr/share/dotnet
sudo rm -rf "/usr/share/dotnet"
sudo rm -rf "/usr/local/lib/android"
sudo rm -rf "/opt/ghc"
sudo rm -rf "/opt/hostedtoolcache/CodeQL"
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: docker push latest
Expand Down
57 changes: 57 additions & 0 deletions docs/Build/grest-changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,62 @@
# Koios gRest Changelog

## [1.1.0rc] - For all networks.

This will be first major [breaking] release for Koios consumers in a while, and will be rolled out under new base prefix (`/api/v1`).
The major work with this release was to start making use of newer flags in dbsync which help performance of queries under new endpoints. Also, you'd see quite a few new endpoint additions below, that'd be helping out with slightly lighter version of queries. To keep migration paths easier, we will ensure both v0 and v1 versions of the release is up for a month post release, before retiring v0.

### New endpoints added:
- `/pool_registrations` - List of all pool registrations initiated in the requested epoch [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/pool_retirements` - List of all pool retirements initiated in the requested epoch [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/treasury_withdrawals` - List of withdrawals made from treasury [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/reserve_withdrawals` - List of withdrawals made from reserves (MIRs) [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/account_txs` - Transactions associated with a given stake address [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/address_utxos` - Get UTxO details for requested addresses [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/asset_utxos` - Get UTxO details for requested assets [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/script_utxos` - Get UTxO details for requested script hashes [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/utxo_info` - Details for requested UTxO arrays [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/script_info` - Information about a given script FROM script hashes [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `/ogmios/?EvaluateTransaction` - Expose [Ogmios EvaluateTransaction](https://ogmios.dev/api/#operation-publish-/?EvaluateTransaction) as an endpoint [#1690](https://github.com/cardano-community/guild-operators/pull/1690)
- `/ogmios/?SubmitTransaction` - Expose [Ogmios SubmitTransaction](https://ogmios.dev/api/#operation-publish-/?SubmitTransaction) as an endpoint [#1690](https://github.com/cardano-community/guild-operators/pull/1690)

### Data Input/Output Changes:
- Input - `/account_utxos` , `/credential_utxos` - Accept `extended` as an additional flag - which enables `asset_list`, `reference_script` and `inline_datum` to the output [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/block_txs` - Flatten output with transaction details (`tx_hash`, `epoch_no`, `block_height`, `block_time`) instead of `tx_hashes` array [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/epoch_params` - Update `cost_models` to JSON (upstream change in node) [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/account_assets` , `/address_assets` - Flatten the output result (instead of `asset_list` array) making it easier to apply horizontal filtering based on any of the fields
- Output - Align output fields for `/account_utxos` , `/address_utxos`, `/asset_utxos` , `/script_utxos` and `/utxo_info` to return same schema giving complete details about UTxOs involved, with few fields toggled based on `extended` input flag [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/pool_list` - Add various details to the endpoint for each pool (`pool_id_hex`,`active_epoch_no`,`margin`,`fixed_cost`,`pledge`,`reward_addr`,`owners`,`relays`,`ticker`,`meta_url`,`meta_hash`,`pool_status`,`retiring_epoch`) - this should mean *some* of the requests to `pool_info` should no longer be required [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/pool_updates` - In v0, `pool_updates` only provided pool registration updates, while `pool_status` corresponded to current status of pool. With v1, we will have registration as well as deregistration transactions, and each transaction will have `update_type` (enum of either `registration` or `deregistration`) instead of `pool_status`. As a side-effect, since a registration transaction only has `retiring_epoch` as metadata, all the other fields will show up as `null` for such a transaction [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/pool_metadata` , `/pool_relays` - Add `pool_status` field to denote whether pool is retired [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/datum_info` - Rename `hash` to `datum_hash` and add `creation_tx_hash` [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/native_script_list` - Remove `script` column (as it has pretty large output better queried against `script_info`), add `size` and change `type` to text [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/plutus_script_list` - Add `type` and `size` to output [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Output - `/asset_info` - Add `cip68_metadata` JSONB field [#239](https://github.com/cardano-community/koios-artifacts/pull/227)
- Output - `/pool_history` - Add member_rewards [#225](https://github.com/cardano-community/koios-artifacts/pull/225)

### Deprecations:
- `/tx_utxos` - No longer required as replaced by `/utxo_info` [#239](https://github.com/cardano-community/koios-artifacts/pull/239)

### Chores:
- Update base version to `v1` from `v0` [#1690](https://github.com/cardano-community/guild-operators/pull/1690)
- Allow Bearer Authentication against endpoints [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Cron job to apply corrections to epoch info [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- `epoch_info_cache` Remove protocol parameters, as they can be queried from live table. Accordingly update dependent queries [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Make use of new `consumed_by_tx_in_id` column in `tx_out` from dbsync 13.1.1.3 across endpoints [#239](https://github.com/cardano-community/koios-artifacts/pull/239)
- Fix `_last_active_stake_validated_epoch` in active_stake_cache [#222](https://github.com/cardano-community/koios-artifacts/pull/222)
- Typo for pool_history_cache.sql as well as add a check to ensure epoch_info_cache has run at least once prior to pool_history_cache [#223](https://github.com/cardano-community/koios-artifacts/pull/223)
- Move control_table entry in cache tables to the end (instead of start) [#226](https://github.com/cardano-community/koios-artifacts/pull/226)
- Fix Asset Info Cache (include mint/burn tx rather than sum for meta consideration) [#226](https://github.com/cardano-community/koios-artifacts/pull/226)
- Update SQLs as per SQLFluff linting guidelines [#226](https://github.com/cardano-community/koios-artifacts/pull/226)
- Fix for tip check in cron jobs [#217](https://github.com/cardano-community/koios-artifacts/pull/217)
- Update cron jobs to exit if the database has not received block in 5 mins [#200](https://github.com/cardano-community/koios-artifacts/pull/200)
- Update active stake cache to use control table [#196](https://github.com/cardano-community/koios-artifacts/pull/196)
- Update Asset Info Cache entry whenever asset registry cache has an update [#194](https://github.com/cardano-community/koios-artifacts/pull/194)
- Bump up margin for tx rollback lookup for asset_info_cache to 1000 , as 100 is too small a margin for 2-3 blocks , which can contain more than 100 transactions (of which if oldest transaction contains a mint, it will not get into the cache) [#177](https://github.com/cardano-community/koios-artifacts/pull/177)
- Swap grestrpcs file to list exceptions and treat everything else as RPC [#1690](https://github.com/cardano-community/guild-operators/pull/1690)
- Update grest-poll.sh to have stricter spec validation and add health check for asset_registry [#1690](https://github.com/cardano-community/guild-operators/pull/1690)
- Update guild-deploy.sh to include latest pre-release for ogmios [#1690](https://github.com/cardano-community/guild-operators/pull/1690)

## [1.0.10] - For all networks.

The release is effectively same as `1.0.10rc` except with one minor modification below.
Expand Down
8 changes: 8 additions & 0 deletions docs/Scripts/cntools-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ All notable changes to this tool will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [11.0.2] - 2023-10-30
#### Fixed
- Fix additional Ada printing. Now omits trailing zeros from fraction part of Ada output.

## [11.0.1] - 2023-10-25
#### Fixed
- Fix display for Pool Cost and Pledge to accept integer as well as decimal format of ADA

## [11.0.0] - 2023-07-05
#### Changed
- CNTools now part of Koios brand
Expand Down
2 changes: 1 addition & 1 deletion scripts/cnode-helper-scripts/cntools.library
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CNTOOLS_MAJOR_VERSION=11
# Minor: Changes and features of minor character that can be applied without breaking existing functionality or workflow
CNTOOLS_MINOR_VERSION=0
# Patch: Backwards compatible bug fixes. No additional functionality or major changes
CNTOOLS_PATCH_VERSION=0
CNTOOLS_PATCH_VERSION=2

CNTOOLS_VERSION="${CNTOOLS_MAJOR_VERSION}.${CNTOOLS_MINOR_VERSION}.${CNTOOLS_PATCH_VERSION}"

Expand Down
28 changes: 14 additions & 14 deletions scripts/cnode-helper-scripts/cntools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ function main {
echo
pledge_ada=50000 # default pledge
[[ -f "${pool_config}" ]] && pledge_ada=$(jq -r '.pledgeADA //0' "${pool_config}")
getAnswerAnyCust pledge_enter "Pledge (in Ada, default: $(formatAsset ${pledge_ada}))"
getAnswerAnyCust pledge_enter "Pledge (in Ada, default: $(formatLovelace $(AdaToLovelace ${pledge_ada}))"
pledge_enter="${pledge_enter//,}"
if [[ -n "${pledge_enter}" ]]; then
if ! AdaToLovelace "${pledge_enter}" >/dev/null; then
Expand Down Expand Up @@ -2392,7 +2392,7 @@ function main {
println "Owner #$((index+1)) : ${FG_GREEN}${owner_wallets[${index}]}${NC}"
done
println "Reward Wallet : ${FG_GREEN}${reward_wallet}${NC}"
println "Pledge : ${FG_LBLUE}$(formatAsset ${pledge_ada})${NC} Ada"
println "Pledge : ${FG_LBLUE}$(formatLovelace $(AdaToLovelace ${pledge_ada}))${NC} Ada"
println "Margin : ${FG_LBLUE}${margin}${NC} %"
println "Cost : ${FG_LBLUE}$(formatLovelace ${cost_lovelace})${NC} Ada"
if [[ ${SUBCOMMAND} = "register" ]]; then
Expand Down Expand Up @@ -2718,14 +2718,14 @@ function main {
fi
fi
if [[ ${CNTOOLS_MODE} = "OFFLINE" && -f "${pool_config}" ]]; then
conf_pledge=$(( $(jq -r '.pledgeADA //0' "${pool_config}") * 1000000 ))
conf_pledge=$(jq -r '.pledgeADA //0' "${pool_config}")
conf_margin=$(jq -r '.margin //0' "${pool_config}")
conf_cost=$(jq -r '.costADA //0' "${pool_config}" | tr -d '.')
conf_cost=$(jq -r '.costADA //0' "${pool_config}")
conf_owner=$(jq -r '.pledgeWallet //"unknown"' "${pool_config}")
conf_reward=$(jq -r '.rewardWallet //"unknown"' "${pool_config}")
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Pledge" "$(formatAsset "${conf_pledge::-6}")")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Pledge" "$(formatLovelace $(AdaToLovelace "${conf_pledge}"))")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} %%" "Margin" "${conf_margin}")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Cost" "$(formatAsset "${conf_cost::-6}")")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Cost" "$(formatLovelace $(AdaToLovelace "${conf_cost}"))")"
println "$(printf "%-21s : ${FG_GREEN}%s${NC} (%s)" "Owner Wallet" "${conf_owner}" "primary only, use online mode for multi-owner")"
println "$(printf "%-21s : ${FG_GREEN}%s${NC}" "Reward Wallet" "${conf_reward}")"
relay_title="Relay(s)"
Expand All @@ -2747,9 +2747,9 @@ function main {
pParams_pledge=${fPParams_pledge}
fi
if [[ ${pParams_pledge} -eq ${fPParams_pledge} ]]; then
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Pledge" "$(formatAsset "${pParams_pledge::-6}")")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Pledge" "$(formatLovelace "${pParams_pledge}")")"
else
println "$(printf "%-15s (${FG_YELLOW}%s${NC}) : ${FG_LBLUE}%s${NC} Ada" "Pledge" "new" "$(formatAsset "${fPParams_pledge::-6}")" )"
println "$(printf "%-15s (${FG_YELLOW}%s${NC}) : ${FG_LBLUE}%s${NC} Ada" "Pledge" "new" "$(formatLovelace "${fPParams_pledge}")" )"
fi
[[ -n ${KOIOS_API} ]] && println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Live Pledge" "$(formatLovelace "${p_live_pledge}")")"

Expand All @@ -2776,9 +2776,9 @@ function main {
pParams_cost=${fPParams_cost}
fi
if [[ ${pParams_cost} -eq ${fPParams_cost} ]]; then
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Cost" "$(formatAsset "${pParams_cost::-6}")")"
println "$(printf "%-21s : ${FG_LBLUE}%s${NC} Ada" "Cost" "$(formatLovelace "${pParams_cost}")")"
else
println "$(printf "%-15s (${FG_YELLOW}%s${NC}) : ${FG_LBLUE}%s${NC} Ada" "Cost" "new" "$(formatAsset "${fPParams_cost::-6}")" )"
println "$(printf "%-15s (${FG_YELLOW}%s${NC}) : ${FG_LBLUE}%s${NC} Ada" "Cost" "new" "$(formatLovelace "${fPParams_cost}")" )"
fi

# get relays
Expand Down Expand Up @@ -3551,9 +3551,9 @@ function main {
echo
println DEBUG "Pool name : ${FG_LGRAY}$(jq -r '."pool-metadata".name' <<< ${offlineJSON})${NC}"
println DEBUG "Ticker : ${FG_LGRAY}$(jq -r '."pool-metadata".ticker' <<< ${offlineJSON})${NC}"
println DEBUG "Pledge : ${FG_LBLUE}$(formatAsset "$(jq -r '."pool-pledge"' <<< ${offlineJSON})")${NC} Ada"
println DEBUG "Pledge : ${FG_LBLUE}$(formatLovelace "$(AdaToLovelace "$(jq -r '."pool-pledge"' <<< ${offlineJSON})")")${NC} Ada"
println DEBUG "Margin : ${FG_LBLUE}$(jq -r '."pool-margin"' <<< ${offlineJSON})${NC} %"
println DEBUG "Cost : ${FG_LBLUE}$(formatAsset "$(jq -r '."pool-cost"' <<< ${offlineJSON})")${NC} Ada"
println DEBUG "Cost : ${FG_LBLUE}$(formatLovelace "$(AdaToLovelace "$(jq -r '."pool-cost"' <<< ${offlineJSON})")")${NC} Ada"
for otx_signing_file in $(jq -r '."signing-file"[] | @base64' <<< "${offlineJSON}"); do
_jq() { base64 -d <<< ${otx_signing_file} | jq -r "${1}"; }
otx_signing_name=$(_jq '.name')
Expand Down Expand Up @@ -3725,9 +3725,9 @@ function main {
jq -er '.metadata' <<< ${offlineJSON} &>/dev/null && println DEBUG "Metadata :\n$(jq -r '.metadata' <<< ${offlineJSON})\n"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Pool name : ${FG_LGRAY}$(jq -r '."pool-metadata".name' <<< ${offlineJSON})${NC}"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Ticker : ${FG_LGRAY}$(jq -r '."pool-metadata".ticker' <<< ${offlineJSON})${NC}"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Pledge : ${FG_LBLUE}$(formatAsset "$(jq -r '."pool-pledge"' <<< ${offlineJSON})")${NC} Ada"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Pledge : ${FG_LBLUE}$(formatLovelace "$(AdaToLovelace "$(jq -r '."pool-pledge"' <<< ${offlineJSON})")")${NC} Ada"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Margin : ${FG_LBLUE}$(jq -r '."pool-margin"' <<< ${offlineJSON})${NC} %"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Cost : ${FG_LBLUE}$(formatAsset "$(jq -r '."pool-cost"' <<< ${offlineJSON})")${NC} Ada"
[[ ${otx_type} = "Pool Registration" || ${otx_type} = "Pool Update" ]] && println DEBUG "Cost : ${FG_LBLUE}$(formatLovelace "$(AdaToLovelace "$(jq -r '."pool-cost"' <<< ${offlineJSON})")")${NC} Ada"
[[ ${otx_type} = "Asset Minting" || ${otx_type} = "Asset Burning" ]] && println DEBUG "Policy Name : ${FG_LGRAY}$(jq -r '."policy-name"' <<< ${offlineJSON})${NC}"
[[ ${otx_type} = "Asset Minting" || ${otx_type} = "Asset Burning" ]] && println DEBUG "Policy ID : ${FG_LGRAY}$(jq -r '."policy-id"' <<< ${offlineJSON})${NC}"
[[ ${otx_type} = "Asset Minting" || ${otx_type} = "Asset Burning" ]] && println DEBUG "Asset Name : ${FG_LGRAY}$(jq -r '."asset-name"' <<< ${offlineJSON})${NC}"
Expand Down
Loading

0 comments on commit 3143290

Please sign in to comment.