Skip to content

Commit

Permalink
Merge branch 'master' into release/cardano-services/0.27.x
Browse files Browse the repository at this point in the history
  • Loading branch information
gytis-ivaskevicius committed May 7, 2024
2 parents 07e4433 + 7c5e8d2 commit f6368f1
Show file tree
Hide file tree
Showing 166 changed files with 4,388 additions and 796 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
// eslint compains about TS enums hence disable here and enable @typescript-eslint/no-shadow
'import/no-unresolved': 0,
'jsdoc/multiline-blocks': ['error', { minimumLengthForMultiline: maxLineLength, noMultilineBlocks: true }],
'jsdoc/no-undefined-types': 0,
'jsdoc/require-jsdoc': 0,
'jsdoc/require-param': 0,
'jsdoc/require-param-type': 0,
Expand All @@ -47,6 +48,7 @@ module.exports = {
}
],
'new-cap': 0,
'no-bitwise': 0, // Bitwise operations (&, |, ^) execute in constant time regardless of the values involved. This means that using a bitwise AND (&) to accumulate comparison results ensures that the comparison takes the same amount of time regardless of where differences occur between the strings. Important to mitigate (CWE-208)
'no-magic-numbers': 0,
'no-restricted-imports': [
'error',
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/std-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
if: startsWith(github.event.release.name, '@cardano-sdk/cardano-services@')
uses: ./.github/workflows/std.yml
with:
deploy-staging-preprod: true
# staging-* is deployed, with the versions and services identical to dev-*, at the start of the Lace release process:
deploy-staging-preprod: false
deploy-dev-preprod: true
deploy-dev-mainnet: true
# Secrets have to be passed explicitly even if callee is in the same repo:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/std.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
for target in \
"dev-preview@us-east-1" \
"dev-preprod@us-east-1@v1" \
"dev-preprod@us-east-1@v2" \
"dev-mainnet@us-east-1" \
; do
nix run -L ".#cardano-services.${target}.plan" | tee k8s-plan.diff
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ WORKDIR /app/packages/cardano-services
CMD ["node", "dist/cjs/cli.js", "start-blockfrost-worker"]

FROM cardano-services as pg-boss-worker
WORKDIR /config
COPY compose/schedules.json .
ENV SCHEDULES=/config/schedules.json
WORKDIR /app/packages/cardano-services
CMD ["node", "dist/cjs/cli.js", "start-pg-boss-worker"]

Expand Down
11 changes: 11 additions & 0 deletions compose/aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Overrides for AArch64 processors, until we get official images:

services:
cardano-db-sync:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.0}
cardano-node:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
ogmios:
image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-5.6.0}
cardano-submit-api:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
1 change: 1 addition & 0 deletions compose/arm64.yml
22 changes: 15 additions & 7 deletions compose/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ services:
timeout: 1s
retries: 120
start_period: 100ms
image: inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.0}
image: ghcr.io/intersectmbo/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.2}
restart: on-failure
stop_signal: SIGINT
volumes:
Expand All @@ -128,21 +128,28 @@ services:
<<:
- *logging
- *with-postgres
image: ghcr.io/intersectmbo/cardano-smash-server:${CARDANO_DB_SYNC_VERSION:-13.1.0.2}
command: ['--config', '/config/cardano-db-sync/config.json']
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
RESTORE_SNAPSHOT: ${RESTORE_SNAPSHOT:-}
RESTORE_RECREATE_DB: N
SMASH_USER: ${SMASH_USER:-admin}
SMASH_PASSWORD: ${SMASH_PASSWORD:-change_m}
depends_on:
cardano-db-sync:
condition: service_healthy
build:
context: ../../
dockerfile: compose/smash/Dockerfile
ports:
- ${SMASH_PORT:-3100}:3100
restart: on-failure
stop_signal: SIGINT
healthcheck:
test: ['CMD-SHELL', 'curl -s --fail http://localhost:3100/api/v1/status']

cardano-node:
<<: *logging
image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
image: public.ecr.aws/e8d0p1a5/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
command:
[
'run',
Expand Down Expand Up @@ -175,7 +182,7 @@ services:

cardano-submit-api:
command: --config /config/cardano-submit-api/config.json --listen-address 0.0.0.0 --socket-path /ipc/node.socket $SUBMIT_API_ARGS
image: inputoutput/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
image: public.ecr.aws/e8d0p1a5/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
ports:
- 8090:8090
restart: on-failure
Expand All @@ -200,8 +207,9 @@ services:
<<: *sdk-environment
API_URL: http://0.0.0.0:3003
QUEUES: ${QUEUES:-pool-delist-schedule,pool-metadata,pool-metrics,pool-rewards}
SCHEDULES: ${SCHEDULES:-/config/schedules.json}
STAKE_POOL_PROVIDER_URL: http://provider-server:3000/
METADATA_FETCH_MODE: ${METADATA_FETCH_MODE:-direct}
METADATA_FETCH_MODE: ${METADATA_FETCH_MODE:-smash}
SMASH_URL: ${SMASH_URL:-http://cardano-smash:3100/api/v1}
healthcheck:
test: ['CMD-SHELL', 'curl -s --fail http://localhost:3003/v1.0.0/health']
Expand Down
File renamed without changes.
19 changes: 0 additions & 19 deletions compose/smash/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions compose/smash/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions compose/smash/init.sh

This file was deleted.

3 changes: 3 additions & 0 deletions compose/x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nothing to override – for x86_64 processors we use the official `amd64` images.

{}
3 changes: 3 additions & 0 deletions nix/cardano-services/deployments/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ in
providers = {
backend = {
enabled = true;
env.NODE_EXTRA_OPTIONS = "--trace-gc";
};
stake-pool-provider = {
enabled = true;
Expand Down Expand Up @@ -330,6 +331,7 @@ in
backend = {
enabled = true;
replicas = 3;
env.NODE_EXTRA_OPTIONS = "--trace-gc";
};
stake-pool-provider = {
enabled = true;
Expand Down Expand Up @@ -402,6 +404,7 @@ in
providers = {
backend = {
enabled = true;
env.NODE_EXTRA_OPTIONS = "--trace-gc";
};
stake-pool-provider = {
enabled = true;
Expand Down
15 changes: 15 additions & 0 deletions nix/cardano-services/oci-images.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@ let
path = self.outPath;
};
};

setupSchedules =
std.lib.ops.mkSetup "schedules" [
{
regex = ".*";
mode = "0444";
}
] ''
mkdir -p $out/config
cp ${builtins.path { path = self + "/compose/schedules.json"; }} $out/config/schedules.json;
'';
in {
cardano-services = std.lib.ops.mkStandardOCI {
name = "926093910549.dkr.ecr.us-east-1.amazonaws.com/cardano-services";
operable = cell.operables.cardano-services;
config.Env = [
"SCHEDULES=/config/schedules.json"
];
setup = [setupSchedules];
meta.description = "Minimal Cardano Services OCI Image";
meta.versions = builtins.fromJSON (builtins.readFile (self + /packages/cardano-services-client/supportedVersions.json));
meta.buildInfo = buildInfo;
Expand Down
2 changes: 1 addition & 1 deletion nix/cardano-services/operables.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
mainnet preprod preprod_p2p preview preview_p2p testnet vasil-dev vasil-dev_p2p vasil-qa
*/
cardanoServicesPath = pkg: "${pkg}/libexec/incl/packages/cardano-services";
runCardanoServices = pkg: "${lib.getExe pkg.nodejs} ${cardanoServicesPath pkg}";
runCardanoServices = pkg: "${lib.getExe pkg.nodejs} \${NODE_EXTRA_OPTIONS:-} ${cardanoServicesPath pkg}";
in {
cardano-services = std.lib.ops.mkOperable rec {
package = cell.packages.cardano-services;
Expand Down
2 changes: 1 addition & 1 deletion nix/cardano-services/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ in {
postInstall = ''
cat > $out/bin/cli <<EOF
#!${nixpkgs.bash}/bin/bash
exec "${nixpkgs.nodejs}/bin/node" "$out/libexec/$sourceRoot/packages/cardano-services/dist/cjs/cli.js" "\$@"
exec "${nixpkgs.nodejs}/bin/node" ''${NODE_EXTRA_OPTIONS:-} "$out/libexec/$sourceRoot/packages/cardano-services/dist/cjs/cli.js" "\$@"
EOF
chmod a+x $out/bin/cli
'';
Expand Down
22 changes: 22 additions & 0 deletions packages/cardano-services-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.19.3](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.19.2...@cardano-sdk/cardano-services-client@0.19.3) (2024-05-02)

**Note:** Version bump only for package @cardano-sdk/cardano-services-client

## [0.19.2](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.19.1...@cardano-sdk/cardano-services-client@0.19.2) (2024-04-26)

**Note:** Version bump only for package @cardano-sdk/cardano-services-client

## [0.19.1](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.19.0...@cardano-sdk/cardano-services-client@0.19.1) (2024-04-23)

**Note:** Version bump only for package @cardano-sdk/cardano-services-client

## [0.19.0](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.18.0...@cardano-sdk/cardano-services-client@0.19.0) (2024-04-15)

### ⚠ BREAKING CHANGES

* upgrade cardano-services, cardano-services-client, e2e and util-dev packages to use version 0.28.0 of Axios

### Miscellaneous Chores

* upgrade Axios version to 0.28.0 ([59fcd06](https://github.com/input-output-hk/cardano-js-sdk/commit/59fcd06debc2712ca9fdd027400450d52a21caeb))

## [0.18.0](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.17.10...@cardano-sdk/cardano-services-client@0.18.0) (2024-03-26)

### ⚠ BREAKING CHANGES
Expand Down
4 changes: 2 additions & 2 deletions packages/cardano-services-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-sdk/cardano-services-client",
"version": "0.18.0",
"version": "0.19.3",
"description": "Cardano Services Client",
"engines": {
"node": ">=16.20.2"
Expand Down Expand Up @@ -56,7 +56,7 @@
"dependencies": {
"@cardano-sdk/core": "workspace:~",
"@cardano-sdk/util": "workspace:~",
"axios": "^0.27.2",
"axios": "^0.28.0",
"class-validator": "^0.14.0",
"json-bigint": "~1.0.0",
"ts-log": "^2.2.4"
Expand Down
47 changes: 47 additions & 0 deletions packages/cardano-services/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,53 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.28.3](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.28.2...@cardano-sdk/cardano-services@0.28.3) (2024-05-02)

### Bug Fixes

* **cardano-services:** correct mapping of chain history redeemer purpose ([b27bcac](https://github.com/input-output-hk/cardano-js-sdk/commit/b27bcac3e807f97f9b1555a8e7df81d58d797006))

## [0.28.2](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.28.1...@cardano-sdk/cardano-services@0.28.2) (2024-04-26)

### Features

* **cardano-services:** implement location and distance new options in stake pools fuzzy search ([8deeed7](https://github.com/input-output-hk/cardano-js-sdk/commit/8deeed739c2b8d6f9b73a2fccfd6be85f0566f38))

### Bug Fixes

* add needed params in the docker composer file to activate batch pool delisting from smash server ([22eb99d](https://github.com/input-output-hk/cardano-js-sdk/commit/22eb99de65fefcc29bc19885f405ca4f2020a54d))
* **cardano-services:** ensure only leader and member rewards are used to compute stake pool rewards ([b5805fc](https://github.com/input-output-hk/cardano-js-sdk/commit/b5805fcc5490632e5e4be126b07c23ba594bb0e2))

## [0.28.1](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.28.0...@cardano-sdk/cardano-services@0.28.1) (2024-04-23)

### Features

* use publicly available SMASH docker image ([e29cc9c](https://github.com/input-output-hk/cardano-js-sdk/commit/e29cc9c7ff70495efe8ccf51779bcfb8b05ea335))

## [0.28.0](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.27.1...@cardano-sdk/cardano-services@0.28.0) (2024-04-15)

### ⚠ BREAKING CHANGES

* upgrade cardano-services, cardano-services-client, e2e and util-dev packages to use version 0.28.0 of Axios

### Features

* optimize projector to not write irrelevant blocks ([132a9f6](https://github.com/input-output-hk/cardano-js-sdk/commit/132a9f63c6927ec82af0ea39516c720d0674ad20))

### Bug Fixes

* **cardano-services:** address projection now applies store operators in correct order ([2178cda](https://github.com/input-output-hk/cardano-js-sdk/commit/2178cdadddb0841c19d8cdea438fec14b4fe0e98))
* **cardano-services:** emergency fix for lw-10209 ([abbf5fe](https://github.com/input-output-hk/cardano-js-sdk/commit/abbf5fed603e1c7e4cc133146035e88248f75f5b))
* the projection now always stores blocks when it reaches tip - k ([ba01291](https://github.com/input-output-hk/cardano-js-sdk/commit/ba01291c66178d372527f3fb07dceafd147c3891))

### Miscellaneous Chores

* upgrade Axios version to 0.28.0 ([59fcd06](https://github.com/input-output-hk/cardano-js-sdk/commit/59fcd06debc2712ca9fdd027400450d52a21caeb))

## [0.27.1](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.27.0...@cardano-sdk/cardano-services@0.27.1) (2024-04-03)

**Note:** Version bump only for package @cardano-sdk/cardano-services

## [0.27.0](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.26.6...@cardano-sdk/cardano-services@0.27.0) (2024-03-26)

### ⚠ BREAKING CHANGES
Expand Down
4 changes: 4 additions & 0 deletions packages/cardano-services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ services:
volumes:
- ./config/network/${NETWORK:-mainnet}:/config

cardano-smash:
volumes:
- ./config/network/${NETWORK:-mainnet}:/config

cardano-submit-api:
volumes:
- ./config/network/${NETWORK:-mainnet}:/config
Expand Down
2 changes: 0 additions & 2 deletions packages/cardano-services/environments/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
METADATA_FETCH_MODE="smash"
SMASH_URL="http://cardano-smash:3100/api/v1"
SCHEDULES="environments/.schedule.local.json"
2 changes: 0 additions & 2 deletions packages/cardano-services/environments/.env.mainnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
METADATA_FETCH_MODE="smash"
SMASH_URL="https://smash.cardano-mainnet.iohk.io/api/v1"
SCHEDULES="environments/.schedule.mainnet.json"
TOKEN_METADATA_SERVER_URL="https://tokens.cardano.org"
3 changes: 1 addition & 2 deletions packages/cardano-services/environments/.env.preprod
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
OGMIOS_PORT=${OGMIOS_PORT:-1339}
METADATA_FETCH_MODE="direct"
SCHEDULES="environments/.schedule.preprod.json"
SMASH_URL="https://preprod-smash.world.dev.cardano.org/api/v1"
3 changes: 1 addition & 2 deletions packages/cardano-services/environments/.env.preview
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
OGMIOS_PORT=${OGMIOS_PORT:-1340}
METADATA_FETCH_MODE="direct"
SCHEDULES="environments/.schedule.preview.json"
SMASH_URL="https://preview-smash.world.dev.cardano.org/api/v1"
10 changes: 0 additions & 10 deletions packages/cardano-services/environments/.schedule.mainnet.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/cardano-services/environments/.schedule.preprod.json

This file was deleted.

0 comments on commit f6368f1

Please sign in to comment.