Skip to content

Classify ownerOf reverts by revert data, not error variant#66

Merged
Praz314159 merged 1 commit into
mainfrom
fix/owner-scan-revert-classification
Jul 3, 2026
Merged

Classify ownerOf reverts by revert data, not error variant#66
Praz314159 merged 1 commit into
mainfrom
fix/owner-scan-revert-classification

Conversation

@Praz314159

@Praz314159 Praz314159 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes
    • Fixed token-position lookups so burned or non-existent positions no longer stop the full enumeration.
    • Improved error handling to distinguish genuine transport failures from contract reverts, making position loading more reliable across providers.
    • Updated the changelog to reflect the corrected burned-token handling behavior.

get_positions_by_owner skips burned/non-existent tokens by catching the
ownerOf revert, but how a revert surfaces is provider-dependent: some
RPC providers decode it into a contract error, others wrap the raw
JSON-RPC error response (code 3, revert data attached) as a transport
error. The scan treated the latter as a network failure and aborted the
enumeration on any market with a burned position.

Recognize reverts by the presence of revert data on the error response
and skip them regardless of encoding; only genuine transport failures
(no revert payload) propagate.
@Praz314159
Praz314159 merged commit 760d953 into main Jul 3, 2026
6 of 7 checks passed
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f7c4db5-79b3-474c-ba94-d39d4b40fc7b

📥 Commits

Reviewing files that changed from the base of the PR and between 0a88844 and 03332d8.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • src/client/queries.rs

📝 Walkthrough

Walkthrough

Modified error handling in get_positions_by_owner to distinguish TransportErrors with revert data (treated as burned/non-existent tokens) from those without (propagated as fatal errors). Updated CHANGELOG.md to describe the fix.

Changes

Burned-token detection fix

Layer / File(s) Summary
Revert-data based error classification
src/client/queries.rs, CHANGELOG.md
ownerOf TransportErrors are inspected for revert data; errors with revert data are ignored as burned tokens, while errors without revert data are still propagated. Changelog entry updated to reflect this fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Estimated code review effort

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/owner-scan-revert-classification

Comment @coderabbitai help to get the list of available commands.

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