Skip to content

Commit

Permalink
Merge branch 'master' into LW-10449-SDK-e2e-tests-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ce0la authored Jun 14, 2024
2 parents 9b9b6d3 + 1b364e8 commit fb421ef
Show file tree
Hide file tree
Showing 225 changed files with 17,504 additions and 16,598 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/std.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
type: boolean
required: true
default: false
deploy-dev-preprod-resync:
description: Deploy to dev-preprod-resync
type: boolean
required: true
default: false
deploy-staging-preprod:
description: Deploy to staging-preprod
type: boolean
Expand Down Expand Up @@ -104,6 +109,9 @@ jobs:
if [ "true" == ${{ inputs.deploy-dev-preprod || false }} ] ; then
echo '{"environment":"dev-preprod", "target":"dev-preprod@us-east-1@v2", "url": "https://dev-preprod.lw.iog.io/"}'
fi
if [ "true" == ${{ inputs.deploy-dev-preprod-resync || false }} ] ; then
echo '{"environment":"dev-preprod-resync", "target":"dev-preprod-resync@us-east-1@v2", "url": "https://dev-preprod-resync.lw.iog.io/"}'
fi
if [ "true" == ${{ inputs.deploy-staging-preprod || false }} ] ; then
echo '{"environment":"staging-preprod", "target":"staging-preprod@us-east-1@v2", "url": "https://staging-preprod.lw.iog.io/"}'
fi
Expand Down Expand Up @@ -218,6 +226,7 @@ jobs:
for target in \
"dev-preview@us-east-1" \
"dev-preprod@us-east-1@v2" \
"dev-preprod-resync@us-east-1@v2" \
"dev-mainnet@us-east-1" \
; do
git restore .kube
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-deploy-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ jobs:

- name: 🔬 Test - e2e - wallet at epoch 0
run: |
yarn workspace @cardano-sdk/e2e test:wallet
yarn workspace @cardano-sdk/e2e test:wallet
8 changes: 4 additions & 4 deletions compose/aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

services:
cardano-db-sync:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.0}
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.2.0.2}
cardano-node:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
ogmios:
image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-5.6.0}
image: ghcr.io/input-output-hk/ogmios-tracker/ogmios:v${OGMIOS_VERSION:-6.3.0}
cardano-submit-api:
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
image: ghcr.io/input-output-hk/ogmios-tracker/cardano-submit-api:${CARDANO_NODE_VERSION:-8.9.2}
15 changes: 9 additions & 6 deletions compose/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
depends_on:
ogmios:
condition: service_healthy
image: ghcr.io/intersectmbo/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.1.0.2}
image: ghcr.io/intersectmbo/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-13.2.0.2}
restart: on-failure
stop_signal: SIGINT
volumes:
Expand All @@ -122,7 +122,7 @@ services:
<<:
- *logging
- *with-postgres
image: ghcr.io/intersectmbo/cardano-smash-server:${CARDANO_DB_SYNC_VERSION:-13.1.0.2}
image: ghcr.io/intersectmbo/cardano-smash-server:${CARDANO_DB_SYNC_VERSION:-13.2.0.2}-docker
command: ['--config', '/config/cardano-db-sync/config.json']
environment:
POSTGRES_HOST: postgres
Expand All @@ -143,7 +143,7 @@ services:

cardano-node:
<<: *logging
image: public.ecr.aws/e8d0p1a5/cardano-node:${CARDANO_NODE_VERSION:-1.35.5}
image: ghcr.io/intersectmbo/cardano-node:${CARDANO_NODE_VERSION:-8.9.2}
command:
[
'run',
Expand All @@ -163,9 +163,12 @@ services:

ogmios:
<<: *logging
image: cardanosolutions/ogmios:v${OGMIOS_VERSION:-5.6.0}
image: cardanosolutions/ogmios:v${OGMIOS_VERSION:-6.3.0}
command:
['--host', '0.0.0.0', '--node-socket', '/ipc/node.socket', '--node-config', '/config/cardano-node/config.json']
depends_on:
cardano-node:
condition: service_started
healthcheck:
retries: 2000
ports:
Expand All @@ -176,7 +179,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: public.ecr.aws/e8d0p1a5/cardano-submit-api:${CARDANO_NODE_VERSION:-1.35.5}
image: ghcr.io/intersectmbo/cardano-submit-api:${CARDANO_NODE_VERSION:-8.9.2}
ports:
- 8090:8090
restart: on-failure
Expand Down Expand Up @@ -216,7 +219,7 @@ services:
POSTGRES_DB_FILE: /run/secrets/postgres_db_db_sync
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_USER_FILE: /run/secrets/postgres_user
image: postgres:${POSTGRES_VERSION:-11.5-alpine}
image: postgres:${POSTGRES_VERSION:-12.16-alpine}
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
interval: 10s
Expand Down
49 changes: 45 additions & 4 deletions nix/cardano-services/deployments/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ in
env.OVERRIDE_FUZZY_OPTIONS = "true";
};
handle-provider.enabled = true;
# asset-provider.enabled = true;
# asset-provider.enabled = true;
};

projectors = {
Expand Down Expand Up @@ -337,13 +337,13 @@ in
env.OVERRIDE_FUZZY_OPTIONS = "true";
};
handle-provider.enabled = true;
# asset-provider.enabled = true;
# asset-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool.enabled = true;
# asset.enabled = true;
# asset.enabled = true;
};

values = {
Expand Down Expand Up @@ -384,7 +384,7 @@ in
env.OVERRIDE_FUZZY_OPTIONS = "true";
};
handle-provider.enabled = true;
# asset-provider.enabled = true;
# asset-provider.enabled = true;
};

projectors = {
Expand All @@ -406,6 +406,44 @@ in
};
};

"dev-preprod-resync@us-east-1@v2" = final: {
name = "${final.namespace}-cardanojs-v2";
namespace = "dev-preprod-resync";
context = "eks-devs";
network = "preprod";
region = "us-east-1";

providers = {
backend = {
enabled = true;
env.NODE_EXTRA_OPTIONS = "--trace-gc";
};
stake-pool-provider = {
enabled = true;
env.OVERRIDE_FUZZY_OPTIONS = "true";
};
handle-provider.enabled = true;
};

projectors = {
handle.enabled = true;
stake-pool.enabled = true;
};

values = {
stakepool.databaseName = "stakepoolv2";
backend.allowedOrigins = lib.concatStringsSep "," allowedOriginsDev;
backend.hostnames = ["${final.namespace}.${baseUrl}"];

pg-boss-worker.enabled = true;

blockfrost-worker.enabled = true;
cardano-services = {
ingresOrder = 98;
};
};
};

"staging-preprod@us-east-1@v2" = final: {
name = "${final.namespace}-cardanojs-v2";
namespace = "staging-preprod";
Expand Down Expand Up @@ -435,6 +473,8 @@ in
stakepool.databaseName = "stakepoolv2";
blockfrost-worker.enabled = true;
pg-boss-worker.enabled = true;
pg-boss-worker.metadata-fetch-mode = "direct";
pg-boss-worker.queues = "pool-metadata,pool-metrics,pool-rewards";
cardano-services = {
ingresOrder = 98;
};
Expand Down Expand Up @@ -905,6 +945,7 @@ in
};

"ops-preview-1@us-east-1" = final: {
name = "${final.namespace}-cardanojs-v2";
namespace = "ops-preview-1";
network = "preview";
region = "us-east-1";
Expand Down
4 changes: 4 additions & 0 deletions packages/cardano-services-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.19.6](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services-client@0.19.5...@cardano-sdk/cardano-services-client@0.19.6) (2024-06-14)

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

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

**Note:** Version bump only for package @cardano-sdk/cardano-services-client
Expand Down
2 changes: 1 addition & 1 deletion 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.19.5",
"version": "0.19.6",
"description": "Cardano Services Client",
"engines": {
"node": ">=16.20.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
/* eslint-disable wrap-regex */
import { TxSubmissionError, TxSubmissionErrorCode } from '@cardano-sdk/core';

// TODO: LW-9890 Map cardano-submit-api to core errors
// For now this is a very superficial mapping, we should improve it in the future
const parseStringishError = (errorData: string) => {
if (/outsideofvalidity/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.OutsideOfValidityInterval, null, errorData);
}
if (/valuenotconserved/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.ValueNotConserved, null, errorData);
}
if (/nonadacollateral/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.NonAdaCollateral, null, errorData);
}
if (/incompletewithdrawals/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.IncompleteWithdrawals, null, errorData);
}
return null;
};

export const mapCardanoTxSubmitError = (errorData: unknown): TxSubmissionError | null => {
if (typeof errorData === 'string') {
if (/outsideofvalidity/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.OutsideOfValidityInterval, null, errorData);
}
if (/valuenotconserved/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.ValueNotConserved, null, errorData);
}
if (/nonadacollateral/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.NonAdaCollateral, null, errorData);
}
if (/incompletewithdrawals/i.test(errorData)) {
return new TxSubmissionError(TxSubmissionErrorCode.IncompleteWithdrawals, null, errorData);
}
return parseStringishError(errorData);
} else if (typeof errorData === 'object' && errorData) {
// cardano-submit-api started returning json instead of raw string.
// For the moment, simply stringify it. In the future we may want to make use of it.
return parseStringishError(JSON.stringify(errorData));
}
return null;
};
2 changes: 1 addition & 1 deletion packages/cardano-services-client/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// auto-generated using ../scripts/createVersionSource.js
export const apiVersion = {
assetInfo: '1.0.0',
chainHistory: '3.0.1',
chainHistory: '3.1.0',
handle: '1.0.0',
networkInfo: '1.0.0',
rewards: '1.0.0',
Expand Down
3 changes: 2 additions & 1 deletion packages/cardano-services-client/supportedVersions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
],
"chainHistory": [
"3.0.0",
"3.0.1"
"3.0.1",
"3.1.0"
],
"handle": [
"1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,28 @@ describe('mapCardanoTxSubmitError', () => {
expect(mapCardanoTxSubmitError(errorData)).toBeNull();
});
});

describe('json errors', () => {
const errorData = {
contents: {
contents: {
contents: {
era: 'ShelleyBasedEraConway',
error: [
'ConwayUtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (ValueNotConservedUTxO (MaryValue (Coin 0) (MultiAsset (fromList []))) (MaryValue (Coin 4999969413825) (MultiAsset (fromList []))))))',
'ConwayUtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (BadInputsUTxO (fromList [TxIn (TxId {unTxId = SafeHash "5f968400f05638454896883ae0f34491e14d748194a10df3f5a7fe2d10f52373"}) (TxIx 1)]))))'
],
kind: 'ShelleyTxValidationError'
},
tag: 'TxValidationErrorInCardanoMode'
},
tag: 'TxCmdTxSubmitValidationError'
},
tag: 'TxSubmitFail'
};

it('can map ValueNotConservedError to TxSubmissionErrorCode.ValueNotConserved', () => {
expect(CardanoNodeUtil.isValueNotConservedError(mapCardanoTxSubmitError(errorData))).toBeTruthy();
});
});
});
4 changes: 4 additions & 0 deletions packages/cardano-services/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.28.6](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.28.5...@cardano-sdk/cardano-services@0.28.6) (2024-06-14)

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

## [0.28.5](https://github.com/input-output-hk/cardano-js-sdk/compare/@cardano-sdk/cardano-services@0.28.4...@cardano-sdk/cardano-services@0.28.5) (2024-06-05)

### Features
Expand Down
6 changes: 3 additions & 3 deletions packages/cardano-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,14 @@ for each of them can be an easy way to iterate over all the impacted models.

See [code coverage report]

[cardano db sync]: https://github.com/input-output-hk/cardano-db-sync
[cardano node]: https://github.com/input-output-hk/cardano-node
[cardano db sync]: https://github.com/IntersectMBO/cardano-db-sync
[cardano node]: https://github.com/IntersectMBO/cardano-node
[cli]: ./src/cli.ts
[code coverage report]: https://input-output-hk.github.io/cardano-js-sdk/coverage/cardano-services
[install and build]: ../../README.md#install-and-build
[ogmios]: https://ogmios.dev/
[postgresql]: https://www.postgresql.org/
[prometheus]: https://prometheus.io/
[provider]: ../core/src/Provider
[submit-api]: https://github.com/input-output-hk/cardano-node/tree/master/cardano-submit-api
[submit-api]: https://github.com/IntersectMBO/cardano-node/tree/master/cardano-submit-api
[txsubmithttpservice]: ./src/TxSubmit/TxSubmitHttpService.ts
Loading

0 comments on commit fb421ef

Please sign in to comment.