Skip to content

Latest commit

 

History

History
259 lines (215 loc) · 18.4 KB

CHANGELOG.md

File metadata and controls

259 lines (215 loc) · 18.4 KB

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

3.0.0 (2020-11-05)

This new major version, now based on the current Node.js LTS, brings the second round of Shelley-era features to the API. Most notably, rewards, active stake captured at each epoch boundary, transaction metadata, protocol parameters in effect during the epoch, and custom types for the Bech32 values covered by CIP5.

You may be impacted by breaking changes, which are listed below.

Compatible with:

⚠ BREAKING CHANGES

  • Omitting the limit in queries will now return 2500 records, rather than 100
  • WHITELIST_PATH is now ALLOW_LIST_PATH
  • HASURA_CLI_PATH is now required configuration, however it's set in the Dockerfile and nix service by default.
  • All schema instances for stake addresses are now validated for the correct prefix using a custom scalar
  • Block.vrfKey and the associated input types are now a validated for the correct prefix using a custom scalar
  • StakePool.id and the associated input types are now a validated for the correct prefix using a custom scalar
  • Hash32HexString -> Hash32Hex
  • Hash32HexString_comparison_exp -> Hash32Hex_comparison_exp
  • SlotLeader.hash, StakePool.hash, StakePoolOwner.hash are now Hash28Hex type
  • Block.vrfKey is now the bech32 encoded value as per CIP5. It's now typed as VRFVerificationKey.

Features

  • Rewards (46cc878)
    • top-level queries rewards and rewards_aggregate
    • StakePool.rewards and StakePool.rewards_aggregate
  • StakePool.id (3fc763c)
    • Bech32 encoded, prefixed with pool
  • Introduce ActiveStake concept (1b66fee)
    • Snapshot of the stake linked to a registered stake key, per epoch.
    • This features adds an activeStake query, and extends the Epoch type to include activeStake and activeStake_aggregate fields.
    • top-level activeStake_aggregate query (8e13a52)
  • Epoch.protocolParams and Epoch.nonce (c08d652)
  • Transaction.metadata (8cec6e8)
  • Custom GraphQL scalars

Improvements

  • consolidate api-genesis with api-cardano-db-hasura(0f927c4)
  • upgrade to Node.js 14 (950852a)
  • Require explicit path to hasura CLI executable (ca22d42)
  • Remove depreciated config option WHITELIST_PATH (a2d00ff)
  • Change Hasura record limit from 100 to 2500 (212bc47), closes #333
  • server configuration lifted to Dockerfile (167ff42)
  • expose the API port (Removes the hard-coding) (e422734)

Bug Fixes

  • accurately allocate hashes to 28 byte type (f9597bc)
  • add port and custom column names to pool_relay mapping (879a51a), closes #328 #329
  • Change Block.vrfKey type to String (a34c8aa)
  • properly type ShelleyProtocolParams (a7a2c3a)
  • remove invalid Genesis.shelley.protocolMagicId (a73ba1e), closes #327
  • remove StakePool.withdrawals field (46dd937)
  • typo in missing config error message (d904a72)

2.2.0 (2020-09-24)

Compatible with:

Features

  • api-cardano-db-hasura: add Transaction.withdrawals (b608cc8)
  • client-ts: combine graphql schemas in client package (bd52a16), closes #273

2.1.0 (2020-09-17)

Compatible with:

Features

  • api-cardano-db-hasura: add custom $SECRET_DIR support for docker image (ff79b10)
  • api-cardano-db-hasura: add Epoch.fees (4482338)
  • api-cardano-db-hasura: add Transaction.deposit (2726d80)
  • Add build arg to include genesis files (c06912d)
  • Improve logging during retry attempts (e24df95)
  • replace DB polling with postgres notification listener for migrations (e42eb3d)

Bug Fixes

  • add missing GraphQL model for Delegation.transaction (3ac55b1)
  • address ordering type mismatch in GraphQL schema (45f3c73)
  • ensure migration is run before introspection (079a248)
  • include @types/* packages in workspace devDependencies (6c5f075)
  • include pools without metadata in StakePool view (d978094)
  • api-cardano-db-hasura: harden schema introspection (3ca88b4), closes #281
  • scope allow list to graphql path (bee2005), closes #303
  • api-cardano-db-hasura: improve error handling with Cardano query delegation (4e532a3)
  • api-cardano-db-hasura: Move each query to separate test (3b29f48)
  • api-cardano-db-hasura: Properly model and relate StakePoolRetirements (a5fef40)
  • api-cardano-db-hasura: Support 28 byte hex encoded hashes (9e28ffa)
  • server: better align server config options (30a7534)
  • server: rename whitelist to allow-list (eeeafa9)
  • server: return HTTP 403 errors when rejecting disallowed queries (b8892ca)

2.0.0

This new major version brings the first round of Shelley-era features to the API, introduces a new genesis file API package, and hardens the migrations and metadata handling. This version is required for transitioning through the upcoming Shelley hard fork.

Compatible with:

Features

New Queries

  • stakePools, stakePools_aggregate
  • delegations, delegations_aggregate
  • stakeRegistrations, stakeRegistrations_aggregate
  • stakeDeregistrations, stakeDeregistrations_aggregate
  • withdrawals, withdrawals_aggregate
  • genesis
  • Metadata and SQL migrations are now performed within the application layer, and make the service immune to schema being removed should cardano-db-sync restart. using the Hasura CLI, which is included in the Dockerfile and NixOS service, however outside of this you must install and place hasura on PATH.
  • A new API package @cardano-graphql/api-genesis allows access to the network genesis files. It's integrated into the server, with the config exposed as environment variables. As usual, the docker-compose.yaml serves as a good reference.

Breaking Changes ⚠️

  • The docker-compose file now mounts configuration managed in the repository, restoring the usual separation of concerns with service configuration. The Docker images still have the configuration included at build time, however in practice, being ready to managing your own configuration if required is a good strategy. Simply copying the top level config and committing to source control gives you full control over the services using their native interface.

Removed fields

  • Cardano.networkName removed. Use network magic from the genesis API identify networks.
  • Cardano.protocolConst, Cardano.slotDuration, Cardano.startTime, Cardano.slotsPerEpoch removed. Access this info from the Genesis API.
  • cardanoDbSync.slotDiffFromNetworkTip removed in reponse to a change in strategy for determining sync status with cardano-db-sync determining sync status relies on a chain that has produce

Changed fields

Dates we're previously formatted to ISO 3339, however ISO 8601 is being adopted with this release for alignment with the Shelley genesis file format and simplification when the precision is not required.

  • 2017-10-03T21:43:51.000Z -> 2017-10-03T21:43:51Z
  • Block.createdBy -> Block.slotLeader links to an object, with a nullable stakePool field. For previous behaviour, Block.slotLeader.description can be used, however the description prefixes have changed upstream from SlotLeader to ByronGenesis
  • Block.createdAt -> Block.forgedAt
  • Block.slotWithinEpoch -> Block.slotInEpoch

Chores

  • Migrations have been squashed into a single step.

1.0.0

Features

  • Optimised versions of some key aggregated queries:
    • Block.transactionsCount
    • Epoch.transactionsCount
    • Epoch.blocksCount
  • Cardano.networkName
  • Transaction.size
  • Transaction.blockIndex
  • Allow explicit ordering of Transaction.outputs by their natural index
  • Cardano now matches the postgres view, and is an improvement over the previous version which performed two queries.
  • CLI tool cgql with commands to assist with Docker-based deployments, including init, snapshotting, and db rebuild.
  • Establish relationships to easily access transaction and block information from inputs and outputs
    • TransactionInput.transaction
    • TransactionInput.sourceTransaction (where it was an output)
    • TransactionOutput.transaction
  • CardanoDbMeta via Query.cardanoDbMeta exposes information to understand if the dataset is complete including: initialized, syncPercentage, and slotDiffFromNetworkTip. The epoch data is incomplete until initialized = true , which takes around 2 hours for the initial sync as of block number 4388632. syncPercentage or slotDiffFromNetworkTip provides progress.
  • The codebase is now modularized to enable new API segments to be added alongside as an extension, composition of services for more use-cases, ability to import the executable schema and host on a different server. The packages are published, to npm, or can be built from source:
    • @cardano-graphql/server
    • @cardano-graphql/api-cardano-db-hasura
    • @cardano-graphql/client-ts
    • @cardano-graphql/cli
    • @cardano-graphql/util-dev
    • @cardano-graphql/util
  • Packages are now managed via an offline npm package cache, to facilitate reproducible builds when the --offline flag is passed to yarn install

Breaking changes

  • PostgreSQL views are now being managed in this codebase, so either switch to the new Docker image inputoutput/cardano-graphql-hasura, or use the Hasura CLI as demonstrated in the entrypoint This change was needed to be compatible with the migration strategy determind by cardano-db-sync, where the migrations need to be applied on each start of the service. The custom Docker image makes it possible to check your own docker-compose file into source control, as it supports Docker secrets, and also removes the requirement to clone this source repo to get data for mounting at runtime.
  • Transaction and Block IDs are now labelled as hash, aligning with the domain terminology.
  • Block.merkelRootHash -> Block.merkelRoot
  • The aggregated and known very large numbers are now typed as String. Cardano JS has utilities to work with these return values, currently limited to currency conversion.
  • Transaction.fee previously String, now BigInt
  • Entrypoint for the service previously found in ./dist/index.js is now ./packages/server/dist/index.js after building.
  • Cardano.blockHeight removed in favour of Cardano.tip.number, where tip = the most recent Block. This unlocks more information such as slotNo, and capability to traverse the chain etc.
  • Dates are now coerced to RFC 3339 UTC date-time strings

Chores

  • Updates to Hasura 1.2.1
  • Improves CI process by consolidating the Jest snapshot files.

0.4.0

Features

  • Block.nextBlock
  • Block.epochNo is a workaround for the less performant Block.epoch.number

0.3.0

Features

  • Can now scope aggregated queries to the same filters as the non-aggregated counterparts
  • Improves the domain-specific input type filtering, enabling control of results for Address summaries, and to deal with the model edge-cases such as Epoch Boundary Blocks needing to be excluded in most cases.
  • Adds logical operators to filter fields, allowing stacking and more powerful expressions.
  • Adds Block.createdBy identifier

Fixes

  • Corrected unnecessarily nullable fields in schema.
  • Removed invalid Epoch_order_by fields

Chores

  • Updates the pacakage manager to Yarn
  • Runs the test suite on Jenkins with e2e assurance, deploying the service in a Docker container, and using an instance of ApolloClient to call the HTTP server. Previously the same setup suited to local development was being used, and was missing the full simulation of a real client.

0.2.1

Features

  • Extends API to include support for aggregated Epoch results
  • Extends API to include network metadata: protocolConst, slotDuration, and startTime

0.2.0

Features

  • Extends API to include support for aggregated results
  • Optional in-memory cache
  • More control over nested list results
  • Adds a load test

Fixes

0.1.6

Initial pre-production release, scoped to the Byron-era network.