fix: batch issues 1126, 1127, 1134, 1140 - #1175
Merged
vjuliaife merged 1 commit intoAug 30, 2026
Merged
Conversation
…1140 (investigations + seed/admin shortfall tooling) - vjuliaife#1126: audit-log write-path benchmark harness and investigation doc - vjuliaife#1127: deposit_reserve cost benchmark test and investigation doc - vjuliaife#1134: doc env standardization (apps/web/.env.local) - vjuliaife#1140: seed --shortfall demo + admin auto-top-up dry-run/execute command
|
@dimka90 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1126
Closes #1127
Closes #1134
Closes #1140
Summary
One batched PR delivering the four open TariffShield issues:
#1126 — Audit-log write-path latency (investigation)
apps/api/tests/benchmarks/audit-log-write-path.js(local Postgres-only harness).docs/investigations/audit-log-write-path.md: the audit append is O(1) (flat 1.2–1.4ms mean at 1× vs ~11× rows); it is ~half of the request's DB write latency because it is a second autocommit round-trip; wrapping read/write +logAuditin one transaction buys atomicity (latency delta within noise).#1127 — deposit_reserve cost vs prior deposits (investigation)
benchmark_deposit_cost_vs_prior_deposit_counttest +deposit_cost_after_prior_deposits/deposit_cost_isolated/DepositKindincontracts/tariff-shield/src/test.rs.docs/investigations/deposit-reserve-cost.md: bothdeposit_reserveanddeposit_collateralare O(1) in prior deposit count — flat ~282k CPU/47k memory isolated at prior=1/100/1000; identical per-kind behavior end to end.#1134 —
.env.localstandardization (docs)docs/FAQ.mdanddocs/environment-variables.mdupdated so web env setup usesapps/web/.env.localconsistently.#1140 — Shortfall auto top-up demo tooling
scripts/seed.ts: new--shortfallflag seeds a demo importer whose required collateral (80 XLM) exceeds deposited collateral (30 XLM) with 100 XLM in reserve → exactly 50 XLM auto_top_up, matching the README.scripts/admin.ts: newauto-top-up --importer-id <id> [--execute]command — computes the shortfall from DB ledger events (or live on-chain account when reachable), dry-runs by default, and with--executesubmits the on-chain call and records theauto_top_upcontract event.docs/local-dev.md: shortfall demo section in the Smoke Test Workflow.Verification
cargo test— new benchmark test passes (42 passed;benchmark_bulk_enforcement_pathsfails onmaintoo — pre-existing, unrelated).apps/apitypecheck + lint pass;@tariffshield/sdkbuilt locally for the typecheck.auto-top-updry-run exercised against local docker Postgres 17 (required 80 / collateral 30 / reserve 100 → move 50 XLM ✓).Note: no
.env,.env.local, orpackage-lock.jsonchanges are included (local-only).