Fix transfer-row non_transferrable_by_owner copying is_soulbound - #47
Open
sausagee wants to merge 2 commits into
Open
Fix transfer-row non_transferrable_by_owner copying is_soulbound#47sausagee wants to merge 2 commits into
sausagee wants to merge 2 commits into
Conversation
Transfer soft-delete rows in get_nft_v2_from_token_data wrote is_soulbound into non_transferrable_by_owner. Those flags diverge when Untransferable is present and allow_ungated_transfer is true. Co-authored-by: Young Yang Liauw <sausagee@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
TokenOwnershipV2::get_nft_v2_from_token_datacorrectly splits two flags on the current-owner row:is_soulbound=Untransferableis present or!allow_ungated_transfernon_transferrable_by_owner=!allow_ungated_transferonlyTransfer soft-delete rows (previous owner,
amount = 0) then wrote:instead of
Some(non_transferrable_by_owner).Those values diverge when
Untransferableis present andallow_ungated_transferis stilltrue(same write-set shape as #46's burned-NFT case). In that state the current-owner row storesnon_transferrable_by_owner = falsewhile the previous-owner history / current rows storetrue.Noted as out of scope on #46. Upstream
aptos-labs/aptos-indexer-processors-v2already maps transfer rows with the owner-gated variable.Not covered by open PRs #16–#46 (#46 is the burn-path Option-nesting soulbound flag).
Root cause
Copy-paste field mapping: transfer history reused
is_soulboundfor the later-addednon_transferrable_by_ownercolumn.Fix
Use
non_transferrable_by_owneron both transfer history and previous-owner current rows, matching the current-owner path.Tests run (rustc 1.85.0)
cargo test -p processor --lib transfer_rows— 2 passedcargo test -p processor --lib— 26 passed; 18 failed only on missing Docker/GCS (processor_status_saver / parquet buffer), unrelatedcargo clippy -p processor --lib --tests -- -D warnings— cleancargo +nightly fmt -- --checkon the changed file — cleanOut of scope (checked, not filed)
object_metadatas.get(...).map(|obj| obj.untransferable.as_ref()).is_some()— already Fix burned NFT soulbound flag when ObjectCore is retained #46untransferable.as_ref().is_some()— already correctdomainsvsv2_1_domains: intentional Movement nameservice change