Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AccountNFT with invalid marker #1589

Merged

Conversation

PeterChen13579
Copy link
Collaborator

@PeterChen13579 PeterChen13579 commented Aug 7, 2024

Fixes #1497
Mimics the behavior of the fix on Rippled side

@godexsoft godexsoft changed the title fix: AccountNFT with invalid Marker + unittest fix: AccountNFT with invalid marker Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.87%. Comparing base (2bd7ac3) to head (aadba7c).
Report is 15 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1589      +/-   ##
===========================================
+ Coverage    69.54%   69.87%   +0.33%     
===========================================
  Files          254      260       +6     
  Lines         9892     9921      +29     
  Branches      5463     5470       +7     
===========================================
+ Hits          6879     6932      +53     
+ Misses        1595     1589       -6     
+ Partials      1418     1400      -18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@godexsoft godexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, just a few nits 👍

src/rpc/handlers/AccountNFTs.cpp Outdated Show resolved Hide resolved
src/rpc/handlers/AccountNFTs.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@cindyyan317 cindyyan317 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff 👍

I think the marker is different in Clio, comparing with rippled. So rippled's approach might not work on Clio.
Also please check the document https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/account-methods/account_nfts#account_nfts, I think Clio's limit is also different.

@shawnxie999
Copy link
Collaborator

shawnxie999 commented Aug 7, 2024

@cindyyan317 rippled can directly fetch a page based on the NFTokenID marker. But clio can't do this, it has to traverse from the last page. So I assume that's why the marker is the ID of the page itself. I think we can still try to return a NFTokenID as a marker, but it would require clio to traverse from the last token page everytime a marker is provided, which would make the API less efficient

@cindyyan317
Copy link
Collaborator

@cindyyan317 rippled can directly fetch a page based on the NFTokenID marker. But clio can't do this, it has to traverse from the last page. So I assume that's why the marker is the ID of the page itself. I think we can still try to return a NFTokenID as a marker, but it would require clio to traverse from the last token page everytime a marker is provided, which would make the API less efficient

@shawnxie999 Thanks for the suggestion. According to the doc , the marker should be page id. We will flag this mismatch to rippled and discuss the correct fix.

For this PR, I think we don't mimic rippled. The marker is considered valid if it is a valid page object of account .

Copy link
Collaborator

@cindyyan317 cindyyan317 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@godexsoft godexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PeterChen13579 PeterChen13579 merged commit 7360c4f into XRPLF:develop Aug 27, 2024
19 checks passed
PeterChen13579 added a commit that referenced this pull request Aug 27, 2024
Fixes [#1497](#1497)
Mimics the behavior of the [fix on Rippled
side](XRPLF/rippled#5045)
PeterChen13579 added a commit that referenced this pull request Aug 27, 2024
Fixes [#1497](#1497)
Mimics the behavior of the [fix on Rippled
side](XRPLF/rippled#5045)
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.

"account_nfts" with unassociated marker is returning empty account_nfts instead of error.
5 participants