Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Incorrect processing of updates of the storage collection that stores empty tuples #14651

Open
2 tasks done
mezrin opened this issue Jul 26, 2023 · 1 comment
Open
2 tasks done
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@mezrin
Copy link

mezrin commented Jul 26, 2023

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

Issues:

  • Requests for storage items provide wrong values if a collection stores "empty tuple" / "no record".
  • Substrate node doesn't provide updates over WS for changes in such collections.

Steps to reproduce provided below.

Collection "Account" of the pallet "uniques" stores "empty tuple" / "no record".

pub(super) type Account<T: Config<I>, I: 'static = ()> = StorageNMap<

Another collection "Asset" of the same pallet stores a struct. And for "Asset" all works fine.
pub(super) type Item<T: Config<I>, I: 'static = ()> = StorageDoubleMap<

Seems there are some issues with the Substrate internal logic or API that arise when we request data for the collection that stores empty tuple.

We have the same issue with our own app that communicates with the blockchain node directly.
So it's not a bug in PolkadotJS.

Steps to reproduce

Precondition

  • Select Kusama assets hub, pallet "uniques"
  • create an NFT collection, mint several tokens in this collection

Scenario

  • open PolkadotJS
  • open Developer -> Chain state
  • select "uniques", "account". Provide params: accountID, collection ID, item ID
  • make a request. The result will be null, means the record with given keys exist and account owns the token
  • transfer NFT token to another address via any other app
  • record displayed by the PolkadotJS should switch to <none> - means there is no record with the given keys. But this doesn't happen.
  • make one more request with the same params: accountID, collection ID, item ID. The result is still null instead of <none>
  • make a request without an optional param ItemID - the list of tokens owned by AccountID in the provided CollectionID doesn't include the token been sent on previous step, as expected.
@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Jul 26, 2023
@bkchr
Copy link
Member

bkchr commented Aug 16, 2023

@jacogr I assume this is just some UI thing of polkadotjs?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests

2 participants