Repository navigation
feat(auction): encrypt Wraith Names auction recovery secrets - #238
Adedoyinjr wants to merge 20 commits into
Conversation
- Add unit-tests job that runs pnpm test:unit - Add intentional failing test to verify CI detects failures
- Remove ci-test.test.ts after verifying CI detects failures - All 105 unit tests pass
ci: add unit-test job to CI workflow
|
@kilo-code-bot[bot] is attempting to deploy a commit to the truthixify's projects Team on Vercel. A member of the Team first needs to authorize it. |
truthixify
left a comment
There was a problem hiding this comment.
Blocking findings:
-
src/pages/NamesAuctions.tsx:213-227broadcasts the on-chain commit first and only callssaveBidafter submission succeeds. If IndexedDB/localStorage encryption or persistence fails (quota, browser policy, serialization, tab shutdown), the deposit is committed but the only salt is a local variable that is then lost, so the user cannot reveal the bid. Persist and verify the encrypted recovery record before signing/broadcasting; retain a recoverable pending record across ambiguous submission failures, and test a storage failure around submission. -
src/store/nameWatchlistStore.tsx:403-425imports a backup by immediately overwriting the active encrypted vault with the imported one and resets the watchlist. Importing an older or different valid backup can therefore silently destroy the current browser's unrevealed bid secrets. Refuse replacement when a non-empty vault exists, or decrypt and merge with explicit conflict handling/confirmation after protecting the current vault; add a test with distinct current and imported bids. -
This head is currently conflicting and includes the commits from already-blocked PR #224, so none of the repository CI jobs ran for this PR (only the Vercel authorization status exists). Rebase the auction change onto current
developand get the unit/type/format/build jobs green so the claimed 134-test result is independently enforced.
Persist and read-back/verify the bid recovery record before signing or broadcasting the on-chain commit, so a storage failure can never leave a user without the salt needed to reveal. An ambiguous submission failure retains the persisted recovery record for retry or recovery after reload. Refuse to silently replace a non-empty encrypted vault on backup import; replacement requires explicit confirmation, and the current vault is preserved if validation, decryption, or persistence fails. Wrong-passphrase and corrupted backups are handled safely. Adds regression tests for storage-failure gating, pre-submission verification, record retention on submission failure, import refusal, explicit replacement, and failure rollback.
truthixify
left a comment
There was a problem hiding this comment.
The two code-level blockers from the prior review are fixed: saveBid is persisted and read-back verified before transaction submission, and backup import requires explicit replacement and validates before overwrite. The focused vault suites (34 tests) and branch build pass locally. This head is still conflicting with develop and remains stacked on the outdated #224 CI commits, so it cannot be merged or exercise the current required unit-test workflow. Please rebase onto current develop, drop the inherited #224 commits, and rerun CI; no additional vault-code blocker remains.
truthixify
left a comment
There was a problem hiding this comment.
Blocking findings on current head 732dfba:
-
src/pages/NamesAuctions.tsx:701-703,764-785,822makes an ambiguous submission unrecoverable in the UI. A timeout storessubmissionStatus: "unknown"(or a reload can leave"pending"), but only"committed"records are allowed to reveal or refund. The only unknown-state action is an explorer link; there is no path that reconciles the transaction hash and persistscommittedorfailed. A transaction that actually landed can therefore reach the reveal window while the saved secret is permanently gated out. Add deterministic reconciliation against Stellar RPC, persist the resolved state, and test reload -> confirmed -> reveal plus confirmed-not-submitted -> safe retry. -
This head still conflicts with
developand has no repository CI result (only the Vercel authorization failure). Rebase onto currentdevelopand get the required unit/type/format/build jobs green.
The focused vault/submission suites (39 tests), production build, and formatting pass locally; the blocker is the missing recovery workflow, not the cryptographic persistence itself.
# Conflicts: # .github/workflows/ci.yml # src/App.tsx # src/lib/stellar/names.ts # src/pages/NamesAuctions.tsx # src/store/nameWatchlistStore.test.ts # src/store/nameWatchlistStore.tsx
There was a problem hiding this comment.
Persisting the recovery secret before signing is now covered, but the ambiguous-submission path remains permanently wedged. NamesAuctions.tsx:703-704 treats only submissionStatus === "committed" as a committed bid, while reveal and refund are gated on hasCommittedBid at lines 824 and 860. An unknown result only gets an explorer link; there is no Horizon/Soroban reconciliation that promotes a successful hash to committed or a rejected hash to failed. After a timeout, even a bid that landed on-chain cannot be revealed or refunded from this UI. Add persisted/reload-safe transaction reconciliation and tests for unknown-to-committed and unknown-to-failed transitions before enabling the downstream actions.
truthixify
left a comment
There was a problem hiding this comment.
Blocking findings on current head b4d1ac6:
-
High correctness: src/lib/stellar/names.ts:755-765 treats every sendTransaction response except ERROR and TRY_AGAIN_LATER as a completed submission and returns its hash. In stellar-sdk 13.3.0, a successful sendTransaction call normally returns PENDING; that only confirms queue admission, not contract execution. src/lib/stellar/auctionBidSubmission.ts:69 then persists that PENDING transaction as committed, while src/lib/stellar/auctionBidReconciliation.ts:23-27 excludes committed records from later status checks. If execution subsequently reaches FAILED, the UI keeps a nonexistent bid committed, blocks a safe retry, and can expose reveal/refund actions for state that never landed. Keep PENDING/DUPLICATE records in the pending state and reconcile them through getTransaction until authoritative SUCCESS or FAILED, or await the terminal result before writing committed. Add a PENDING then FAILED regression that proves the bid becomes retryable, plus PENDING then SUCCESS.
-
Medium CI: the required build job is red because format:check fails on auctionBidReconciliation.test.ts, auctionBidSubmission.test.ts, names.ts, NamesAuctions.tsx, and nameWatchlistStore.tsx. Format those files and rerun the required gate.
The focused reconciliation/submission/store suites pass 38/38, TypeScript checks pass, and a production build succeeds locally. The complete remote patch was also clean against the known PolinRider indicators.
truthixify
left a comment
There was a problem hiding this comment.
The prior PENDING correctness blocker is fixed on exact head c422461: queued/ambiguous submissions remain reconcilable, and the focused suites pass 38/38. The required build gate is still red because format:check fails on auctionBidReconciliation.test.ts, auctionBidSubmission.test.ts, names.ts, NamesAuctions.tsx, and nameWatchlistStore.tsx. Format those files and rerun CI. This head has the same tree as #241, so please coordinate one canonical PR to avoid duplicate merges.
Summary
Security
Tests
Closes #214