Skip to content

Commit aa68703

Browse files
authored
chore: prepare 1.4.0 (#604)
2 parents aaed9b6 + 3312b9c commit aa68703

File tree

114 files changed

+6558
-863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+6558
-863
lines changed

.env.IntegrationTest

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ REMOVE_SPENT_UTXOS=false
6464
#The number of safe blocks to keep in the store. 2160 blocks *(20 seconds/block in average)=4320 seconds=12 hours.
6565
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
6666
BLOCK_TRANSACTION_API_TIMEOUT_SECS=5
67+
REMOVE_SPENT_UTXOS_BATCH_SIZE=3000
6768

6869
YACI_SPRING_PROFILES=postgres,n2c-socat
6970
# database profiles: h2, h2-testdata, postgres
@@ -79,6 +80,8 @@ HOST_CLUSTER_API_PORT=10000
7980
HOST_OGMIOS_PORT=1337
8081
HOST_KUPO_PORT=1442
8182
HOST_VIEWER_PORT=5173
83+
PROMETHEUS_PORT=9090
84+
GRAFANA_PORT=3000
8285

8386
## Devkit env
8487
DEVKIT_ENABLED=true
@@ -149,4 +152,14 @@ CONTINUE_PARSING_ON_ERROR=false
149152
SYNC=false
150153

151154
## Peer Discovery
152-
PEER_DISCOVERY=false
155+
PEER_DISCOVERY=false
156+
157+
## Token Registry
158+
TOKEN_REGISTRY_ENABLED=false
159+
TOKEN_REGISTRY_BASE_URL=https://tokens.cardano.org/api
160+
TOKEN_REGISTRY_CACHE_TTL_HOURS=12
161+
TOKEN_REGISTRY_LOGO_FETCH=false
162+
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2
163+
164+
## Mithril version for Docker build
165+
MITHRIL_VERSION=2524.0

.env.docker-compose

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ SEARCH_LIMIT=100
5959

6060
## Yaci Indexer env
6161
INDEXER_DOCKER_IMAGE_TAG=main
62-
REMOVE_SPENT_UTXOS=false
63-
#The number of safe blocks to keep in the store. 2160 blocks *(20 seconds/block in average)=4320 seconds=12 hours.
64-
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
62+
REMOVE_SPENT_UTXOS=true
63+
#The number of safe blocks to keep in the store. 129600 blocks *(20 seconds/block in average)=30 days.
64+
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600
65+
REMOVE_SPENT_UTXOS_BATCH_SIZE=3000
6566
BLOCK_TRANSACTION_API_TIMEOUT_SECS=5
6667

6768
YACI_SPRING_PROFILES=postgres,n2c-socket
@@ -109,3 +110,14 @@ SYNC=true
109110

110111
## Peer Discovery
111112
PEER_DISCOVERY=false
113+
114+
## Token Registry
115+
TOKEN_REGISTRY_ENABLED=false
116+
# your local org token registry, e.g. http://myexchange.org/cardano-token-registry/api
117+
# https://tokens.cardano.org/api cannot be used as it is not possible to request hundreds of tokens due to security / DDOS attacks
118+
# if you use it, it will work for some requests but not others
119+
TOKEN_REGISTRY_BASE_URL=
120+
TOKEN_REGISTRY_CACHE_TTL_HOURS=12
121+
# by default fetching of logo is disabled as it can add up to a lot of bytes over the wire
122+
TOKEN_REGISTRY_LOGO_FETCH=false
123+
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2

.env.docker-compose-preprod

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ SEARCH_LIMIT=100
5959

6060
## Yaci Indexer env
6161
INDEXER_DOCKER_IMAGE_TAG=main
62-
REMOVE_SPENT_UTXOS=false
63-
#The number of safe blocks to keep in the store. 2160 blocks *(20 seconds/block in average)=4320 seconds=12 hours.
64-
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
62+
REMOVE_SPENT_UTXOS=true
63+
#The number of safe blocks to keep in the store. 129600 blocks *(20 seconds/block in average)=30 days
64+
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600
65+
REMOVE_SPENT_UTXOS_BATCH_SIZE=3000
6566
BLOCK_TRANSACTION_API_TIMEOUT_SECS=5
6667

6768
YACI_SPRING_PROFILES=postgres,n2c-socket
@@ -108,4 +109,12 @@ GRAFANA_PORT=3000
108109
POSTGRESQL_EXPORTER_PORT=9187
109110

110111
## Peer Discovery
111-
PEER_DISCOVERY=true
112+
PEER_DISCOVERY=true
113+
114+
## Token Registry
115+
# Externally hosted token registry is currently only available for mainnet
116+
TOKEN_REGISTRY_ENABLED=true
117+
TOKEN_REGISTRY_BASE_URL=http://preview.integrations.cf-systems.internal:8080/api
118+
TOKEN_REGISTRY_CACHE_TTL_HOURS=1
119+
TOKEN_REGISTRY_LOGO_FETCH=true
120+
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2

.env.docker-compose-profile-advanced-level

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ DB_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER=8
1515
DB_POSTGRES_MAX_PARALLEL_WORKERS=16
1616
DB_POSTGRES_SEQ_PAGE_COST=0.5
1717
DB_POSTGRES_JIT=off
18-
DB_POSTGRES_BGWRITER_LRU_MAXPAGES=100
18+
DB_POSTGRES_BGWRITER_LRU_MAXPAGES=300
1919
DB_POSTGRES_BGWRITER_DELAY=200ms
2020
DB_POSTGRES_WAL_BUFFERS=512MB
2121
DB_POSTGRES_CHECKPOINT_COMPLETION_TARGET=0.9
22+
DB_POSTGRES_AUTOVACUUM_MAX_WORKERS=5

.env.docker-compose-profile-mid-level

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ DB_POSTGRES_MAX_PARALLEL_WORKERS_PER_GATHER=4
1717
DB_POSTGRES_MAX_PARALLEL_WORKERS=8
1818
DB_POSTGRES_SEQ_PAGE_COST=1.0
1919
DB_POSTGRES_JIT=off
20-
DB_POSTGRES_BGWRITER_LRU_MAXPAGES=100
20+
DB_POSTGRES_BGWRITER_LRU_MAXPAGES=200
2121
DB_POSTGRES_BGWRITER_DELAY=200ms
22+
DB_POSTGRES_AUTOVACUUM_MAX_WORKERS=5

.env.h2

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ SEARCH_LIMIT=100
4040

4141
## Yaci Indexer env
4242
INDEXER_DOCKER_IMAGE_TAG=main
43-
REMOVE_SPENT_UTXOS=false
44-
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
43+
REMOVE_SPENT_UTXOS=true
44+
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600
45+
REMOVE_SPENT_UTXOS_BATCH_SIZE=3000
46+
4547
BLOCK_TRANSACTION_API_TIMEOUT_SECS=5
4648

4749
YACI_SPRING_PROFILES=h2,n2c-socket
@@ -102,3 +104,10 @@ CONTINUE_PARSING_ON_ERROR=false
102104

103105
## Indexer sync starts after node is at tip. Set false for offline mode.
104106
SYNC=false
107+
108+
## Token Registry
109+
TOKEN_REGISTRY_ENABLED=false
110+
TOKEN_REGISTRY_BASE_URL=https://tokens.cardano.org/api
111+
TOKEN_REGISTRY_CACHE_TTL_HOURS=12
112+
TOKEN_REGISTRY_LOGO_FETCH=false
113+
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2

.env.h2-testdata

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ SEARCH_LIMIT=100
4040

4141
## Yaci Indexer env
4242
INDEXER_DOCKER_IMAGE_TAG=main
43-
REMOVE_SPENT_UTXOS=false
44-
#The number of safe blocks to keep in the store. 2160 blocks *(20 seconds/block in average)=4320 seconds=12 hours.
45-
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=2160
43+
REMOVE_SPENT_UTXOS=true
44+
#The number of safe blocks to keep in the store. 129600 blocks *(20 seconds/block in average)=30 days.
45+
REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT=129600
46+
REMOVE_SPENT_UTXOS_BATCH_SIZE=3000
47+
4648
BLOCK_TRANSACTION_API_TIMEOUT_SECS=5
4749

4850
YACI_SPRING_PROFILES=h2-testdata,n2c-socket
@@ -103,3 +105,10 @@ CONTINUE_PARSING_ON_ERROR=false
103105

104106
## Indexer sync starts after node is at tip. Set false for offline mode.
105107
SYNC=false
108+
109+
## Token Registry
110+
TOKEN_REGISTRY_ENABLED=false
111+
TOKEN_REGISTRY_BASE_URL=https://tokens.cardano.org/api
112+
TOKEN_REGISTRY_CACHE_TTL_HOURS=12
113+
TOKEN_REGISTRY_LOGO_FETCH=false
114+
TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS=2

.github/workflows/pr-preprod-tests.yaml

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
timeout-minutes: 30
1919

2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222

2323
- name: Update local repository
2424
run: |
@@ -39,10 +39,35 @@ jobs:
3939
# Stop all services
4040
docker compose \
4141
--env-file .env.docker-compose-preprod \
42-
--env-file .env.docker-compose-profile-entry-level \
42+
--env-file .env.docker-compose-profile-mid-level \
4343
-f docker-compose.yaml \
4444
down
4545
46+
- name: Configure environment for full-history tests
47+
run: |
48+
cd /home/integration/git/cardano-rosetta-java
49+
50+
ensure_var() {
51+
local key="$1"
52+
local value="$2"
53+
local file=".env.docker-compose-preprod"
54+
if grep -q "^${key}=" "$file"; then
55+
sed -i "s#^${key}=.*#${key}=${value}#" "$file"
56+
else
57+
echo "${key}=${value}" >> "$file"
58+
fi
59+
}
60+
61+
ensure_var REMOVE_SPENT_UTXOS false
62+
ensure_var REMOVE_SPENT_UTXOS_LAST_BLOCKS_GRACE_COUNT 129600
63+
ensure_var DB_PORT 5433
64+
ensure_var TOKEN_REGISTRY_ENABLED true
65+
ensure_var TOKEN_REGISTRY_BASE_URL http://preview.integrations.cf-systems.internal:8080/api
66+
ensure_var TOKEN_REGISTRY_CACHE_TTL_HOURS 1
67+
ensure_var TOKEN_REGISTRY_LOGO_FETCH true
68+
ensure_var TOKEN_REGISTRY_REQUEST_TIMEOUT_SECONDS 2
69+
ensure_var PEER_DISCOVERY true
70+
4671
4772
- name: Build and start services with PR code
4873
run: |
@@ -55,7 +80,7 @@ jobs:
5580
# Build and start all services
5681
docker compose \
5782
--env-file .env.docker-compose-preprod \
58-
--env-file .env.docker-compose-profile-entry-level \
83+
--env-file .env.docker-compose-profile-mid-level \
5984
-f docker-compose.yaml \
6085
up --build -d --wait
6186
@@ -110,6 +135,17 @@ jobs:
110135
# Sync Python dependencies
111136
uv sync
112137
138+
- name: Create test environment file
139+
run: |
140+
cd /home/integration/git/cardano-rosetta-java
141+
142+
# Merge env files so tests can read actual configuration
143+
cat .env.docker-compose-preprod > .env.test
144+
cat .env.docker-compose-profile-mid-level >> .env.test
145+
146+
# Copy to tests directory
147+
cp .env.test tests/data-endpoints/.env
148+
113149
- name: Run smoke tests (validate test data)
114150
id: smoke_tests
115151
run: |
@@ -142,6 +178,7 @@ jobs:
142178
143179
# Run behavioral tests (skip smoke tests)
144180
uv run pytest -m "not smoke" \
181+
-n auto \
145182
--alluredir=./allure-results \
146183
--tb=short \
147184
-v || TEST_RESULT=$?
@@ -155,6 +192,27 @@ jobs:
155192
ROSETTA_URL: http://localhost:8082
156193
CARDANO_NETWORK: preprod
157194

195+
- name: Run construction API tests
196+
id: construction_test
197+
run: |
198+
export PATH="$HOME/.local/bin:$PATH"
199+
200+
cd /home/integration/git/cardano-rosetta-java/tests/integration
201+
202+
# Run construction API snapshot tests
203+
uv run test_construction_api.py \
204+
-v || CONSTRUCTION_RESULT=$?
205+
206+
# Output test result
207+
echo "construction_result=${CONSTRUCTION_RESULT:-0}" >> $GITHUB_OUTPUT
208+
209+
# Don't fail the whole job if construction tests fail
210+
# These are informational for now
211+
exit 0
212+
env:
213+
ROSETTA_URL: http://localhost:8082
214+
CARDANO_NETWORK: preprod
215+
158216
- name: Generate Allure report
159217
if: always()
160218
run: |
@@ -217,23 +275,26 @@ jobs:
217275
if: failure() && (steps.test.outcome == 'failure' || steps.test.outcome == 'cancelled')
218276
run: |
219277
cd /home/integration/git/cardano-rosetta-java
278+
sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
220279
221280
echo "⚠️ Test failed - stopping services"
222281
223282
# Stop all services cleanly
224283
docker compose \
225284
--env-file .env.docker-compose-preprod \
226-
--env-file .env.docker-compose-profile-entry-level \
285+
--env-file .env.docker-compose-profile-mid-level \
227286
-f docker-compose.yaml \
228287
down
229288
230289
# Check if migrations changed in this PR
231290
LAST_TAG=$(git tag --sort=-version:refname | head -1)
232-
git checkout $LAST_TAG
291+
git checkout -f $LAST_TAG
292+
sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
233293
234294
STABLE_MIGRATION_HASH=$(find yaci-indexer/src/main/resources/db/store -type f -name 'V*.sql' -exec md5sum {} \; | sort | md5sum | cut -d' ' -f1)
235295
236-
git checkout -
296+
git checkout -f -
297+
sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
237298
PR_MIGRATION_HASH=$(find yaci-indexer/src/main/resources/db/store -type f -name 'V*.sql' -exec md5sum {} \; | sort | md5sum | cut -d' ' -f1)
238299
239300
if [ "$STABLE_MIGRATION_HASH" != "$PR_MIGRATION_HASH" ]; then
@@ -242,7 +303,7 @@ jobs:
242303
# Start only the database
243304
docker compose \
244305
--env-file .env.docker-compose-preprod \
245-
--env-file .env.docker-compose-profile-entry-level \
306+
--env-file .env.docker-compose-profile-mid-level \
246307
-f docker-compose.yaml \
247308
up -d db
248309
@@ -262,33 +323,34 @@ jobs:
262323
for VERSION in $CHANGED_MIGRATIONS; do
263324
echo "Removing Flyway metadata for version: $VERSION"
264325
docker exec cardano-rosetta-java-db-1 sh -c \
265-
"PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java \
326+
"PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java -p 5433 \
266327
-c \"DELETE FROM preprod.flyway_schema_history WHERE version LIKE '${VERSION}%';\""
267328
done
268329
269330
echo "✓ Flyway metadata cleaned - all blockchain data preserved"
270331
else
271332
echo "No specific migration versions detected - truncating flyway history"
272333
docker exec cardano-rosetta-java-db-1 sh -c \
273-
"PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java \
334+
"PGPASSWORD=weakpwd#123_d psql -U rosetta_db_admin -d rosetta-java -p 5433 \
274335
-c 'TRUNCATE preprod.flyway_schema_history;'"
275336
fi
276337
277338
docker compose \
278339
--env-file .env.docker-compose-preprod \
279-
--env-file .env.docker-compose-profile-entry-level \
340+
--env-file .env.docker-compose-profile-mid-level \
280341
-f docker-compose.yaml \
281342
down
282343
fi
283344
284345
# Now safe to rollback
285346
LAST_TAG=$(git tag --sort=-version:refname | head -1)
286347
echo "Rolling back to stable version: $LAST_TAG"
287-
git checkout $LAST_TAG
348+
git checkout -f $LAST_TAG
349+
sed -i "s#^DB_PORT=.*#DB_PORT=5433#" .env.docker-compose-preprod
288350
289351
docker compose \
290352
--env-file .env.docker-compose-preprod \
291-
--env-file .env.docker-compose-profile-entry-level \
353+
--env-file .env.docker-compose-profile-mid-level \
292354
-f docker-compose.yaml \
293355
up -d
294356
@@ -305,4 +367,10 @@ jobs:
305367
sleep 5
306368
done
307369
308-
echo "✅ Rollback to $LAST_TAG completed"
370+
echo "✅ Rollback to $LAST_TAG completed"
371+
372+
- name: Restore baseline configuration
373+
if: always()
374+
run: |
375+
cd /home/integration/git/cardano-rosetta-java
376+
git restore .env.docker-compose-preprod

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ docker exec rosetta tail -f /logs/indexer.log
7575
- Controller implementations in `api/{domain}/controller/` implement generated interfaces
7676
- Always use @Nullable annotation in case of optional fields for function methods parameter inputs and outputs, records, DTOs, and entities
7777
- Avoid if { return } else {} , if we already have a return statement, we can just return the value, no need for else block
78+
- Use @NotNull annotation everywhere where we can be sure that value will not be null, use @Nullable in case value can be null sometimes
79+
- Considering that we will have @NotNull and @Nullable annotations, just put nulls checks only when you actually need it, if a field / property is annotated with @NonNull, there is no need for a null check in the code
7880

7981
### Database Architecture
8082
- **Hibernate JPA** for standard ORM operations

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ For every Release we provide pre-built docker images stored in the DockerHub Rep
100100
To start it use the following command:
101101

102102
```bash
103-
docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile --env-file ./docker/.env.docker-profile-mid-level -p 8082:8082 --shm-size=4g -d cardanofoundation/cardano-rosetta-java:1.3.3
103+
docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile --env-file ./docker/.env.docker-profile-mid-level -p 8082:8082 --shm-size=4g -d cardanofoundation/cardano-rosetta-java:1.4.0
104104
```
105105

106106
Changes to the configuration can be made by adjusting the `docker/.env.dockerfile` file. For more information on the environment variables, please refer to the [documentation](https://cardano-foundation.github.io/cardano-rosetta-java/docs/install-and-deploy/env-vars).
107107

108108
If you want to use the `cardano-submit-api` you can additionally expose port `8090`. It can then be used to submit raw cbor transaction (API documentation here: [Link](https://input-output-hk.github.io/cardano-rest/submit-api/))
109109

110110
```bash
111-
docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile --env-file ./docker/.env.docker-profile-mid-level -p 8090:8090 -p 8082:8082 --shm-size=4g -d cardanofoundation/cardano-rosetta-java:1.3.3
111+
docker run --name rosetta -v {CUSTOM_MOUNT_PATH}:/node --env-file ./docker/.env.dockerfile --env-file ./docker/.env.docker-profile-mid-level -p 8090:8090 -p 8082:8082 --shm-size=4g -d cardanofoundation/cardano-rosetta-java:1.4.0
112112
```
113113

114114
### Docker compose

0 commit comments

Comments
 (0)