Skip to content

Updates/dev update#605

Merged
alibabaedge merged 8 commits into
devfrom
updates/dev-update
Apr 22, 2026
Merged

Updates/dev update#605
alibabaedge merged 8 commits into
devfrom
updates/dev-update

Conversation

@m1amgn
Copy link
Copy Markdown
Contributor

@m1amgn m1amgn commented Apr 22, 2026

Fix and improve aztec tx data service

m1amgn added 8 commits April 21, 2026 20:50
Move tx-metric helpers from src/app/services/tx-service.ts into a dedicated utility module consumable by the upcoming update-aztec-tx-metrics daily cron job.

Fixes two regressions: (1) calculateAztecAverageFee now uses the correct getUiTxEffects(params, options) signature — previous code passed { cache: 'no-store' } as the first positional argument (query-params slot), and the redundant !tx.isOrphaned filter is removed since getUiTxEffects already returns confirmed tx effects only. (2) calculateAztecTps drops the isAztecFinalizedStatus(block.blockStatus) filter — the [from, to] window is bounded above by latestFinalizedHeight, so every block in the window is finalized by construction; the UI blocks endpoint lags on blockStatus in v4 alpha, which caused the filter to drop every block and return null.

Inner try/catch error swallowing is removed: the consuming job uses Promise.allSettled and needs the rejection to surface partial failures.
Writes totalTxs/txsLast24h/tps/avgFee to chain_tx_metrics and a daily
snapshot to chain_tx_daily_snapshots. Derives txs30d from the snapshot
30 days ago (falls back to oldest snapshot when 30d history is not yet
available). Preserves prior field values on partial indexer failures
via Prisma partial-update semantics.
- Only assign txsLast24h/tps/avgFee to the upsert `update` object when
  the settled result is fulfilled AND the value is non-null/undefined.
  Previously, a fulfilled-but-null helper would overwrite prior DB
  values with null, violating the spec's null-omission rule for
  `update`. The `create` path still writes null defaults, which is
  correct per spec (first-insert has no prior row to preserve).
- Rename logger namespace from 'update-aztec-tx-metrics' to
  'aztec-tx-metrics' to match spec.
Allows the Aztec indexer client to authenticate when deployed against
environments that gate the API behind a bearer token. When the env var
is unset the client behaves as before.
@alibabaedge alibabaedge merged commit 7ebf4c8 into dev Apr 22, 2026
1 check failed
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.

2 participants