Skip to content

Commit 0c803ba

Browse files
authored
Merge pull request #262 from input-output-hk/chore/cardano-db-sync-3.1.0
Chore/cardano db sync 3.1.0 update
2 parents 82ee0d4 + 5cd6fb3 commit 0c803ba

File tree

7 files changed

+14
-6
lines changed

7 files changed

+14
-6
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This version is required for transitioning through the upcoming Shelley hard for
99
### Compatible with:
1010

1111
- [`cardano-node`: `1.18.0`](https://github.com/input-output-hk/cardano-node/releases/tag/1.18.0)
12-
- [`cardano-db-sync`: `3.0.0`](https://github.com/input-output-hk/cardano-db-sync/releases/tag/3.0.0) - Note: The database must be recreated using the new version.
12+
- [`cardano-db-sync`: `3.1.0`](https://github.com/input-output-hk/cardano-db-sync/releases/tag/3.1.0) - Note: The database must be recreated using the new version.
1313

1414
## Features
1515
### New Queries
@@ -41,17 +41,17 @@ configuration if required is a good strategy. Simply copying the top level `conf
4141
- `cardanoDbSync.slotDiffFromNetworkTip` **removed** in reponse to a change in strategy for determining
4242
sync status with `cardano-db-sync` determining sync status relies on a chain
4343
that has produce
44-
- `Block.slotWithinEpoch` **removed** due to complexity with variation across eras. The Genesis API has information
45-
for calculations based on context.
4644

4745
### Changed fields
4846
Dates we're previously formatted to ISO 3339, however ISO 8601 is being adopted with this release for
4947
alignment with the Shelley genesis file format and simplification when the precision is not required.
5048
- `2017-10-03T21:43:51.000Z` -> `2017-10-03T21:43:51Z`
51-
- `Block.createdAt` -> `Block.forgedAt`
5249
- `Block.createdBy` -> `Block.slotLeader` links to an object, with a nullable `stakePool` field. For
5350
previous behaviour, `Block.slotLeader.description` can be used, however the description prefixes have
5451
changed upstream from `SlotLeader` to `ByronGenesis`
52+
- `Block.createdAt` -> `Block.forgedAt`
53+
- `Block.slotWithinEpoch` -> `Block.slotInEpoch`
54+
5555

5656
## Chores
5757
- Migrations have been squashed into a single step.

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242
max-size: "400k"
4343
max-file: "20"
4444
cardano-db-sync-extended:
45-
image: inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-3.0.0}
45+
image: inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-3.1.0}
4646
command: [
4747
"--config", "/config/config.json",
4848
"--socket-path", "/node-ipc/node.socket"

packages/api-cardano-db-hasura/hasura/project/metadata/tables.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- previousBlockHash
6464
- protocolVersion
6565
- size
66+
- slotInEpoch
6667
- slotNo
6768
- transactionsCount
6869
- vrfKey

packages/api-cardano-db-hasura/hasura/project/migrations/1589369664961_init/up.sql

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CREATE VIEW "Block" AS
1313
block.tx_count AS "transactionsCount",
1414
block.epoch_no AS "epochNo",
1515
block."time" AS "forgedAt",
16+
block.epoch_slot_no AS "slotInEpoch",
1617
block.slot_no AS "slotNo",
1718
slot_leader.id AS "slot_leader_id",
1819
block.vrf_key As "vrfKey"

packages/api-cardano-db-hasura/schema.graphql

+2
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ type Block {
570570
merkelRoot: Hash32HexString
571571
number: Int
572572
opCert: Hash32HexString
573+
slotInEpoch: Int
573574
# Ouroboros Classic Epoch Boundary blocks (EBB) do not have a slot number
574575
slotNo: Int
575576
# Ouroboros Classic Epoch Boundary blocks (EBB) do not have a slot number
@@ -606,6 +607,7 @@ input Block_bool_exp {
606607
previousBlock: Block_bool_exp
607608
nextBlock: Block_bool_exp
608609
size: BigInt_comparison_exp
610+
slotInEpoch: Int_comparison_exp
609611
slotNo: Int_comparison_exp
610612
transactions: Transaction_bool_exp
611613
transactionsCount: text_comparison_exp

packages/api-cardano-db-hasura/src/example_queries/blocks/blocksByHashes.graphql

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ query blocksByHashes(
2020
merkelRoot
2121
number
2222
forgedAt
23-
createdBy
23+
slotLeader {
24+
description
25+
}
2426
previousBlock {
2527
hash
2628
number

packages/api-cardano-db-hasura/test/data_assertions/block_assertions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const block29021 = {
1111
forgedAt: '2017-09-30T15:03:11Z',
1212
createdBy: 'SlotLeader-8e8a7b0f4a23f07a',
1313
number: 29021,
14+
slotInEpoch: 7435,
1415
slotNo: 29035,
1516
previousBlock: {
1617
hash: '663c25ee1434e6d29f8bd08bd52ddbb16a30bb54ca3c69c815e3de7bc4c42770',
@@ -82,6 +83,7 @@ export const block29022 = {
8283
number: 29023
8384
},
8485
size: 631,
86+
slotInEpoch: 7436,
8587
slotNo: 29036,
8688
transactionsCount: '0'
8789
}

0 commit comments

Comments
 (0)