Skip to content

fix(satp-hermes): add missing await to async DB writes in Stage 3 asset operations#2

Open
mn-ram wants to merge 9 commits intomainfrom
fix/satp-hermes-unawaited-db-writes
Open

fix(satp-hermes): add missing await to async DB writes in Stage 3 asset operations#2
mn-ram wants to merge 9 commits intomainfrom
fix/satp-hermes-unawaited-db-writes

Conversation

@mn-ram
Copy link
Copy Markdown
Owner

@mn-ram mn-ram commented Apr 1, 2026

Summary

  • Add missing await to 12 fire-and-forget persistLogEntry() and storeProof() calls in mintAsset(), burnAsset(), and assignAsset() methods
  • Prevents unhandled promise rejections that crash the SATP gateway (exit code 255)
  • Eliminates silent loss of blockchain transaction proofs needed for crash recovery

Fixes #1

Problem

In Stage 3 services, the asset operation methods (mintAsset, burnAsset, assignAsset) call this.dbLogger.persistLogEntry() and this.dbLogger.storeProof() without await. Both are async methods that write to local + remote databases.

This is inconsistent — every other method in the same files correctly awaits these calls.

Without await:

  1. DB write errors become unhandled promise rejections → process crash
  2. Proofs may not persist before the method returns → silent data loss
  3. Crash recovery can't find proofs → re-executes operations → duplicate blockchain transactions

Changes

File Method Lines Fixed
stage3-server-service.ts mintAsset() 818, 827, 870, 880
stage3-server-service.ts assignAsset() 911, 921, 965, 977
stage3-client-service.ts burnAsset() 782, 792, 835, 844

Test plan

  • Verify existing SATP integration tests still pass
  • Verify Stage 3 asset operations correctly await DB writes
  • Confirm no remaining unawaited dbLogger calls in affected files

🤖 Generated with Claude Code

@mn-ram mn-ram force-pushed the fix/satp-hermes-unawaited-db-writes branch from a728e25 to feaca35 Compare April 1, 2026 10:32
Signed-off-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local>
@mn-ram mn-ram force-pushed the fix/satp-hermes-unawaited-db-writes branch from bcfe837 to e8cb345 Compare April 13, 2026 12:51
RafaelAPB and others added 8 commits April 13, 2026 16:26
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

fix(satp-hermes):  fix  getOAS

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

chore: update supported ledgers

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
…acti#4150)

Replaced vulnerable `pull_request_target` with `pull_request`.
Wrapped `echo` arguments in quotes to guard against command injections.

Signed-off-by: VRamakrishna <vramakr2@in.ibm.com>
Replace Promise.all with Promise.allSettled so a single plugin failure
during shutdown does not abort HTTP/gRPC server cleanup. Log the plugin
instance ID when a shutdown failure occurs.

Fixes hyperledger-cacti#4160

Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>
Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Consolidates 10 recent dependabot PRs (hyperledger-cacti#4228, hyperledger-cacti#4225, hyperledger-cacti#4224, hyperledger-cacti#4220, hyperledger-cacti#4219,
 and hyperledger-cacti#4218, hyperledger-cacti#4217, hyperledger-cacti#4214, hyperledger-cacti#4213, hyperledger-cacti#4210) into a single update.

| Package | From | To |
| --- | --- | --- |
| [@angular/compiler](https://github.com/angular/angular) | 17.3.11 | 19.2.20 |
| [@angular/core](https://github.com/angular/angular) | 17.3.11 | 19.2.20 |
| [ajv](https://github.com/ajv-validator/ajv) | 8.17.1 | 8.18.0 |
| [axios](https://github.com/axios/axios) | 1.13.4 | 1.15.0 |
| [basic-ftp](https://github.com/patrickjuchli/basic-ftp) | 5.1.0 | 5.2.2 |
| [diff](https://github.com/kpdecker/jsdiff) | - | (updated) |
| [dompurify](https://github.com/cure53/DOMPurify) | 3.3.1 | 3.3.3 |
| [fastify](https://github.com/fastify/fastify) | 4.28.1 | 5.8.3 |
| [flatted](https://github.com/WebReflection/flatted) | 3.3.3 | 3.4.2 |
| [immutable](https://github.com/immutable-js/immutable-js) | 4.3.7 | 4.3.8 |
| [lodash](https://github.com/lodash/lodash) | 4.17.23 | 4.18.1 |
| [markdown-it](https://github.com/markdown-it/markdown-it) | 14.1.0 | 14.1.1 |
| [multer](https://github.com/expressjs/multer) | 1.4.5-lts.1 | 2.1.1 |
| [picomatch](https://github.com/micromatch/picomatch) | - | (updated) |
| [qs](https://github.com/ljharb/qs) | 6.13.0 | 6.14.2 |
| [rollup](https://github.com/rollup/rollup) | 2.79.2 | 2.80.0 |
| [simple-git](https://github.com/steveukx/git-js) | 3.19.1 | 3.32.3 |
| [sjcl](https://github.com/bitwiseshiftleft/sjcl) | 1.0.8 | 1.0.9 |
| [undici](https://github.com/nodejs/undici) | 7.8.0 | 7.24.0 |
| [webpack](https://github.com/webpack/webpack) | 5.94.0 | 5.104.1 |
| [yaml](https://github.com/eemeli/yaml) | 1.10.2 | 1.10.3 |

All dependency updates from April 10-13, 2026 are included in this single commit.

Supersedes PRs: hyperledger-cacti#4228, hyperledger-cacti#4225, hyperledger-cacti#4224, hyperledger-cacti#4220, hyperledger-cacti#4219, hyperledger-cacti#4218, hyperledger-cacti#4217, hyperledger-cacti#4214, hyperledger-cacti#4213, hyperledger-cacti#4210

Signed-off-by: Sandeep Nishad <sandeepn.official@gmail.com>
- Add pre-check step to display commit messages with line numbers and character counts
- Fix config file reference from commitlint.config.mjs to commitlint.config.js
- Add verbose logging and proper error handling
- Fix shellcheck issues (use -r flag with read, proper variable quoting)
- Increase header-max-length from 72 to 80 characters
- Increase body-max-line-length from 80 to 102 characters
- Increase footer-max-line-length from 80 to 102 characters

This helps identify exactly which lines violate the character limits and provides
more flexibility for detailed commit messages.

Signed-off-by: Sandeep Nishad <sandeepn.official@gmail.com>
The mintAsset, burnAsset, and assignAsset methods in Stage 3 services
were calling persistLogEntry() and storeProof() without await, causing
fire-and-forget promises that lead to unhandled rejections, silent
proof loss, and potential duplicate blockchain transactions on crash
recovery.

Fixes hyperledger-cacti#4167

Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>
@mn-ram mn-ram force-pushed the fix/satp-hermes-unawaited-db-writes branch from e8cb345 to 3491829 Compare April 21, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(satp-hermes): Unawaited async DB writes in Stage 3 asset operations cause silent proof loss and unhandled rejections

5 participants