Skip to content

Scan all batch offer roots during fallback resolution#106

Draft
KeeganEad wants to merge 1 commit into
superrare:mainfrom
KeeganEad:keegan/clawpatch-batch-offer-root-scan
Draft

Scan all batch offer roots during fallback resolution#106
KeeganEad wants to merge 1 commit into
superrare:mainfrom
KeeganEad:keegan/clawpatch-batch-offer-root-scan

Conversation

@KeeganEad

Copy link
Copy Markdown
Contributor

Finding

clawpatch finding fnd_sig-feat-service-b01553a6a4-ceb2_2205db459a: batch offer token-resolution fallback only scanned the latest 10,000 blocks for BatchOfferCreated events. Long-lived active offers created before that window could not be accepted or revoked by contract/tokenId when rare-api direct proof lookup needed root candidates.

Assessment

Confirmed real bug. The fallback is correctness-critical after rare-api direct lookup returns a resolution error, and an active offer can remain fillable past the fixed lookback window. The fix keeps the public SDK API unchanged and preserves the existing 10,000-block query size as an internal pagination chunk.

Fix

  • Replace the fixed recent lookback with a backward paginated event scan from latest block to genesis.
  • Preserve newest-root-first ordering and root deduplication.
  • Continue filtering candidate roots by current fillable status before asking rare-api for proofs.
  • Add a unit regression for an active offer event older than the former 10,000-block window.

Validation

  • npx vitest run test/unit/sdk/batch-offer.test.ts --config vitest.config.ts
  • npm run typecheck
  • npm run lint
  • clawpatch revalidate --finding fnd_sig-feat-service-b01553a6a4-ceb2_2205db459a --plain -> fixed

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.

1 participant