Skip to content

fix: unify request queues, harden indexing cancellation, exact stroop conversion, single contract config - #707

Merged
Calebux merged 2 commits into
zintarh:mainfrom
jones43r:feature/632-634-636-639-queue-cancel-amounts-contract
Oct 1, 2026
Merged

Calebux merged 2 commits into
zintarh:mainfrom
jones43r:feature/632-634-636-639-queue-cancel-amounts-contract

Conversation

@jones43r

Copy link
Copy Markdown
Contributor

Summary

  • fix(horizon): horizonRequestQueue and sorobanRequestQueue duplicate the same throttling logic #632: New src/utils/requestQueue.ts is one queue parameterized by endpoint, concurrency, retry policy, and error classifier. HorizonRequestQueue and SorobanRequestQueue are now thin configurations of it, with the same backoff, concurrency cap, and AbortSignal cancellation. Their public APIs are unchanged. useRateLimit is documented as the client-side half that reads the shared rateLimitStore. Direct tests cover ordering, concurrency, retry, abort, and clear.
  • fix(indexer): cancellation is not guaranteed to stop in-flight work #634: The indexer ConcurrencyManager (now in app/services/concurrencyManager.ts) is abort-aware. Queued requests are dropped on cancel, and results that resolve after an abort are discarded. The run captures its signal once, because abortIndexingRequests() clears the shared controller. A final abort check means a cancelled run never hands back a result to be stored. Adds the regression test from test(indexer): add cancellation regression test #290.
  • fix(stellar): stroop conversion has no property test for round-tripping #636: formatXlm now formats from the exact bigint and truncates instead of rounding up, so no conversion path goes through a float. Seeded property tests over the full Int64 range cover lossless round-trip, exactness above Number.MAX_SAFE_INTEGER, and display truncation that never exceeds the real amount.
  • fix(config): contract address configuration is spread across scripts and env #639:
    • config/contractAddress.ts is the single source of truth for which contract the app uses.
    • validate:env validates the resolved addresses and runs as prebuild. The build fails when no address is configured, or when one is malformed or the placeholder.
    • Removes setup-contract-address.sh, check-contract-config.js, check-contract-deployment.mjs and verify-contracts.mts, which duplicated each other.
    • The footer shows the active contract address.
    • Documents CRON_SECRET in .env.example so validate:env passes.

Closes #632
Closes #634
Closes #636
Closes #639

Validation

  • jest: the new requestQueue, indexingCancellation and stellarAmount.property suites pass. The existing sorobanRequestQueue, stellarAmount(s), Footer, horizonIndexer and trustlineService suites pass.
  • validate:env exits 1 when addresses are missing or malformed, and 0 with a valid one.
  • These failures also happen on main:
    • The networkSwitchService, mintWrapArgs, useFreighterWallet and contracts suites fail (the last two because of the stellar-sdk ESM transform in jest).
    • tsc reports errors in files this PR doesn't touch.
    • Lint flags the require() lines in validate-env.js.

… formatting, single contract config

- Extract one RequestQueue used by Horizon and Soroban with shared backoff, concurrency cap and AbortSignal cancellation
- Make indexer ConcurrencyManager abort-aware and discard results that resolve after cancellation
- Format XLM from bigint so no conversion path goes through a lossy float; add stroop round-trip property tests
- Resolve contract address in config/contractAddress.ts, enforce it in validate:env on prebuild, drop redundant scripts, show active contract in footer

Closes zintarh#632
Closes zintarh#634
Closes zintarh#636
Closes zintarh#639
@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown

@jones43r is attempting to deploy a commit to the zintarh Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@jones43r 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! 🚀

Learn more about application limits

…ontract

Resolve modify/delete conflict on src/utils/stellarAmounts.ts: main (zintarh#586)
merged it into the canonical src/utils/stellarAmount.ts, so keep the
deletion, move this branch's helpers (including the exact-bigint formatXlm)
into stellarAmount.ts, and point all importers at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Calebux
Calebux merged commit cda6a01 into zintarh:main Oct 1, 2026
1 check failed
@Calebux

Calebux commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution! This PR conflicted with recent changes on main, so the conflicts were resolved during merge:

  • app/components/__tests__/Footer.test.tsx: Kept the target branch's complete test restructuring and added this PR's wrapStore mock and contract address test.

Resolved and merged with PRmaster. Your commits are included in the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants