diff --git a/cardano-db-sync-extended/CHANGELOG.md b/cardano-db-sync-extended/CHANGELOG.md index 0de0a1213..de6a6984d 100644 --- a/cardano-db-sync-extended/CHANGELOG.md +++ b/cardano-db-sync-extended/CHANGELOG.md @@ -1,5 +1,12 @@ # Revision history for cardano-db-sync-extended +## 11.0.0 +* Note that this release requires the database to be dropped and recreated. +* Alonzo support. +* Database changes as per cardano-db changelog. +* Add run time validation that the on-disk schema matches what the app expects (#472). +* Add partial validation of `Reward` table. + ## 10.0.1 * Fix docker issue (#686). diff --git a/cardano-db-sync-extended/cardano-db-sync-extended.cabal b/cardano-db-sync-extended/cardano-db-sync-extended.cabal index 768d96e15..6712f6469 100644 --- a/cardano-db-sync-extended/cardano-db-sync-extended.cabal +++ b/cardano-db-sync-extended/cardano-db-sync-extended.cabal @@ -3,7 +3,7 @@ cabal-version: 2.4 -- http://haskell.org/cabal/users-guide/ name: cardano-db-sync-extended -version: 10.0.1 +version: 11.0.0 synopsis: The Extended Cardano DB Sync node description: A Cardano node that follows the Cardano chain and inserts data from the chain into a PostgresQL database. It is "extended" because it maintains an diff --git a/cardano-db-sync/CHANGELOG.md b/cardano-db-sync/CHANGELOG.md index b35ca8555..73e754afa 100644 --- a/cardano-db-sync/CHANGELOG.md +++ b/cardano-db-sync/CHANGELOG.md @@ -1,5 +1,12 @@ # Revision history for cardano-db-sync +## 11.0.0 +* Note that this release requires the database to be dropped and recreated. +* Alonzo support. +* Database changes as per cardano-db changelog. +* Add run time validation that the on-disk schema matches what the app expects (#472). +* Add partial validation of `Reward` table. + ## 10.0.1 * Fix docker issue (#686). diff --git a/cardano-db-sync/cardano-db-sync.cabal b/cardano-db-sync/cardano-db-sync.cabal index 1bb420e3b..d0fc8e343 100644 --- a/cardano-db-sync/cardano-db-sync.cabal +++ b/cardano-db-sync/cardano-db-sync.cabal @@ -3,7 +3,7 @@ cabal-version: 2.4 -- http://haskell.org/cabal/users-guide/ name: cardano-db-sync -version: 10.0.1 +version: 11.0.0 synopsis: The Cardano DB Sync node description: A Cardano node that follows the Cardano chain and inserts data from the chain into a PostgresQL database. diff --git a/cardano-db-tool/CHANGELOG.md b/cardano-db-tool/CHANGELOG.md index a16f16cbc..a4446e9fc 100644 --- a/cardano-db-tool/CHANGELOG.md +++ b/cardano-db-tool/CHANGELOG.md @@ -1,5 +1,11 @@ # Revision history for cardano-db-tool +## 11.0.0 +* Alonzo support. +* Database changes as per cardano-db changelog. +* Add a validation to ensure the sum of the AdaPots values per epoch is a constant (#718). +* Add reporting functionalities (balance, teansactions, reward history, latest rewards). + ## 10.0.0 * Add helper functionality for state snapshot generation. diff --git a/cardano-db-tool/cardano-db-tool.cabal b/cardano-db-tool/cardano-db-tool.cabal index c81563f44..3314782b8 100644 --- a/cardano-db-tool/cardano-db-tool.cabal +++ b/cardano-db-tool/cardano-db-tool.cabal @@ -3,7 +3,7 @@ cabal-version: 2.2 -- http://haskell.org/cabal/users-guide/ name: cardano-db-tool -version: 10.0.1 +version: 11.0.0 synopsis: Utilities to manage the cardano-db-sync databases. description: Utilities and executable, used to manage and validate the PostgreSQL db and the ledger database of the cardano-db-sync node diff --git a/cardano-db/CHANGELOG.md b/cardano-db/CHANGELOG.md index cf3f726c6..36062e412 100644 --- a/cardano-db/CHANGELOG.md +++ b/cardano-db/CHANGELOG.md @@ -1,5 +1,24 @@ # Revision history for cardano-db +## 11.0.0 +* Note that this release requires the database to be dropped and recreated. +* Many changed to support Alonzo release. +* Add Alonzo (smart contracts) related Redeemer and Script tables. +* Add an `epochNo` columm to StakeRegistration/Deregistration tables. +* Add instantaneous rewards to the `Reward` table. This adds two new reward sources (`treasury` and + `reserves` to the existing `owner` and `member` types) and makes the `poolId` NULLable (treasury + and reserves rewards are not associated with a pool). +* For the `EpochSyncTime` table change the `seconds` column from `double` to `Word64` and make it + non-NULLable. +* Fix the uniqueness constraint on the `CollateralTxIn` and `PoolMetadataRef` tables. +* For the `Reward` table, drop the `epochNo` column and relace it with `earnedEpoch` and + `spendableEpoch` +* Extend `ProtocolParams` and `EpochParams` tables for Alonzo. +* Add `opCertCounter` column to `Block` table. +* Drop `OrphanedRewrd` table (because it was incomplete can cannot be fixed). +* Fix `utxo_view` defined in schema (#744). +* Add `dataHash` field to the `TxOut` table. + ## 10.0.1 * Fix docker issue (#686). diff --git a/cardano-db/cardano-db.cabal b/cardano-db/cardano-db.cabal index 77c5c0f8c..a1eba0d6a 100644 --- a/cardano-db/cardano-db.cabal +++ b/cardano-db/cardano-db.cabal @@ -3,7 +3,7 @@ cabal-version: 2.2 -- http://haskell.org/cabal/users-guide/ name: cardano-db -version: 10.0.1 +version: 11.0.0 synopsis: A base PostgreSQL component for the cardano-db-sync node. description: Code for the Cardano DB Sync node that is shared between the cardano-db-node and other components. diff --git a/cardano-sync/CHANGELOG.md b/cardano-sync/CHANGELOG.md index 6a5cd628d..ba12d2ce4 100644 --- a/cardano-sync/CHANGELOG.md +++ b/cardano-sync/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for cardano-sync +## 11.0.0 +* Alonzo support. +* Database changes as per cardano-db changelog. + ## 10.0.1 * Fix docker issue (#686). diff --git a/cardano-sync/cardano-sync.cabal b/cardano-sync/cardano-sync.cabal index 41eb0ea95..637b1c78c 100644 --- a/cardano-sync/cardano-sync.cabal +++ b/cardano-sync/cardano-sync.cabal @@ -3,7 +3,7 @@ cabal-version: 2.2 -- http://haskell.org/cabal/users-guide/ name: cardano-sync -version: 10.0.1 +version: 11.0.0 synopsis: The Cardano Sync node description: A Cardano node that follows the Cardano chain and inserts data from the chain into a PostgresQL database. diff --git a/doc/schema.md b/doc/schema.md index 02f7d222e..13ee29159 100644 --- a/doc/schema.md +++ b/doc/schema.md @@ -1,6 +1,6 @@ # Schema Documentation for cardano-db-sync -Schema version: 10.0.0 (from branch **kderme/scripts-tables** which may not accurately reflect the version number) +Schema version: 11.0.0 (from branch **prerelease/11.0.x** which may not accurately reflect the version number) ### `schema_version` @@ -117,6 +117,7 @@ A table for transaction outputs. | `payment_cred` | hash28type | The payment credential part of the Shelley address. (NULL for Byron addresses). For a script-locked address, this is the script hash. | | `stake_address_id` | integer (64) | The StakeAddress table index for the stake address part of the Shelley address. (NULL for Byron addresses). | | `value` | lovelace | The output value (in Lovelace) of the transaction output. | +| `data_hash` | hash32type | The hash of the transaction output datum. (NULL for Txs without scripts). | ### `tx_in` @@ -127,8 +128,8 @@ A table for transaction inputs. | Column name | Type | Description | |-|-|-| | `id` | integer (64) | | -| `tx_in_id` | integer (64) | The Tx table index where this transaction is used as an input. | -| `tx_out_id` | integer (64) | The Tx table index where this transaction was created as an output. | +| `tx_in_id` | integer (64) | The Tx table index of the transaction that contains this transaction input | +| `tx_out_id` | integer (64) | The Tx table index of the transaction that contains this transaction output. | | `tx_out_index` | txindex | The index within the transaction outputs. | | `redeemer_id` | integer (64) | The Redeemer table index which is used to validate this input. | @@ -141,8 +142,8 @@ A table for transaction collateral inputs. | Column name | Type | Description | |-|-|-| | `id` | integer (64) | | -| `tx_in_id` | integer (64) | The Tx table index where this transaction is used as an input. | -| `tx_out_id` | integer (64) | The Tx table index where this transaction was created as an output. | +| `tx_in_id` | integer (64) | The Tx table index of the transaction that contains this transaction input | +| `tx_out_id` | integer (64) | The Tx table index of the transaction that contains this transaction output. | | `tx_out_index` | txindex | The index within the transaction outputs. | ### `meta` @@ -327,7 +328,7 @@ A table for metadata attached to a transaction. |-|-|-| | `id` | integer (64) | | | `key` | word64type | The metadata key (a Word64/unsigned 64 bit number). | -| `json` | jsonb | The JSON payload. | +| `json` | jsonb | The JSON payload if it can bde decoded as JSON. | | `bytes` | bytea | The raw bytes of the payload. | | `tx_id` | integer (64) | The Tx table index of the transaction where this metadata was included. | @@ -341,27 +342,12 @@ A table for rewards earned by staking. The rewards earned in epoch `N` are added |-|-|-| | `id` | integer (64) | | | `addr_id` | integer (64) | The StakeAddress table index for the stake address that earned the reward. | -| `type` | rewardtype | The source of the rewards; pool `member` vs pool `owner`. | +| `type` | rewardtype | The source of the rewards; pool `member`, pool `owner`, `treasury` or `reserve` payment. | | `amount` | lovelace | The reward amount (in Lovelace). | | `earned_epoch` | integer (64) | The epoch in which the reward was earned. | | `spendable_epoch` | integer (64) | | | `pool_id` | integer (64) | The PoolHash table index for the pool the stake address was delegated to when the reward is earned. Will be NULL for payments from the treasury or the reserves. | -### `orphaned_reward` - -A table for rewards earned by staking, but are orphaned. Rewards are orphaned when the stake address is deregistered before the rewards are distributed. - -* Primary Id: `id` - -| Column name | Type | Description | -|-|-|-| -| `id` | integer (64) | | -| `addr_id` | integer (64) | The StakeAddress table index for the stake address that earned the reward. | -| `type` | rewardtype | The source of the rewards; pool `member` vs pool `owner`. | -| `amount` | lovelace | The reward amount (in Lovelace). | -| `epoch_no` | integer (64) | The epoch in which the reward was earned. | -| `pool_id` | integer (64) | The PoolHash table index for the pool the stake address was delegated to when the reward is earned. Will be NULL for payments from the treasury or the reserves. | - ### `withdrawal` A table for withdrawals from a reward account. @@ -600,7 +586,8 @@ The pool offline (ie not on chain) for a stake pool. | `pool_id` | integer (64) | The PoolHash table index for the pool this offline data refers. | | `ticker_name` | string | The pool's ticker name (as many as 5 characters). | | `hash` | hash32type | The hash of the offline data. | -| `metadata` | string | The raw offline data. | +| `json` | jsonb | The payload as JSON. | +| `bytes` | bytea | The raw bytes of the payload. | | `pmr_id` | integer (64) | The PoolMetadataRef table index for this offline data. | ### `pool_offline_fetch_error` @@ -618,6 +605,18 @@ A table containing pool offline data fetch errors. | `fetch_error` | string | The text of the error. | | `retry_count` | uinteger | The number of retries. | +### `epoch_reward_total_received` + +This table is used to help validate the accounting of rewards. It contains the total reward amount for each epoch received from the ledger state and includes orphaned rewards that are later removed from the Reward table. + +* Primary Id: `id` + +| Column name | Type | Description | +|-|-|-| +| `id` | integer (64) | | +| `earned_epoch` | uinteger | The epoch in which the reward was earned. | +| `amount` | lovelace | The total rewards for the epoch in Lovelace. | + ### `reserved_pool_ticker` A table containing a managed list of reserved ticker names. diff --git a/docker-compose.yml b/docker-compose.yml index 14f664924..e63e1d66f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,7 +22,7 @@ services: max-file: "10" cardano-node: - image: inputoutput/cardano-node:1.27.0 + image: inputoutput/cardano-node:1.29.0 environment: - NETWORK=${NETWORK:-mainnet} volumes: @@ -36,7 +36,7 @@ services: max-file: "10" cardano-db-sync: - image: inputoutput/cardano-db-sync:10.0.1 + image: inputoutput/cardano-db-sync:11.0.0 environment: - NETWORK=${NETWORK:-mainnet} - POSTGRES_HOST=postgres