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

Artist unable to mint #8535

Closed
JustLuuuu opened this issue Dec 11, 2023 · 7 comments · Fixed by #8583
Closed

Artist unable to mint #8535

JustLuuuu opened this issue Dec 11, 2023 · 7 comments · Fixed by #8583
Assignees
Labels
A-minting related to minting operations bug Something isn't working

Comments

@JustLuuuu
Copy link
Member

The artist is receiving this error while minting NFT on AHK.
Address: GyrKsk1toYMPD7dWwgTZcJf1TuBVY59UZPeU7xGCf89QMEu
2023-12-11 12 30 29

The artist tried again later, and minting worked. Still, this notification was unclear for the artist.

@JustLuuuu JustLuuuu added bug Something isn't working A-minting related to minting operations labels Dec 11, 2023
@daiagi
Copy link
Contributor

daiagi commented Dec 14, 2023

what happened?

✔️ minted nfts 1,2 (chain id and indexer id are in sync)
✔️ burn nft #2
(next chain id is now 2, next indexer id is 3)
✔️ mint nft #3 (means indexer synced already)
✔️ burn nft #3 (next chain id is 2, next indexer id is 4)

❌ mint nft #2
how?? chain id is 2 (because current items count is 1) but next id coming from indexer should have been either 3 (if minting on nft #3 isn't synced yet) or 4

mint nft #4 (this should of been the previous id assigned)

a bug is born

from this point on we have the situation where the series of nft ids is 1,2,4, instead of 1,2,3
which is same as the bug fixed in

but arriving there differently

once arriving to this point, minting nfts become dependent on the indexer syncing time and minting 1 nft after another becomes unpleasant
because the next id coming from chain is wrong (too low)

why we check id from chain?

we introduced id from chain in order to allow fast minting while indexer still syncs
but, we can only get count of unburned nfts from chain, and not truly the next id

Silly idea?

how about if we swallow this kind of error internally and continue to +1 the id until success (up until n retries)
@roiLeo @vikiival

@vikiival
Copy link
Member

how about if we swallow this kind of error internally and continue to +1 the id until success (up until n retries)

This will introduce another series of unpleasant bugs.

Transaction pool prio
429 on RPC :)

So iterate on n would require you to wait n minutes to get correct result.

Anyway fix is simple

You can check the array of minted nfts via chain and sort them by biggest sn .)

@daiagi
Copy link
Contributor

daiagi commented Dec 14, 2023

So iterate on n would require you to wait n minutes to get correct result.

yep, silly idea indeed

You can check the array of minted nfts via chain and sort them by biggest sn .)

well, using the wallet app, yes, we can
image

but using the js api, iirc i tried to pass null and undefined to the second param and it failed
https://polkadot.js.org/docs/substrate/storage#itemu32-u32-optionpalletnftsitemdetails

@vikiival
Copy link
Member

but using the js api, iirc i tried to pass null and undefined to the second param and it failed

https://polkadot.js.org/docs/api/cookbook/storage#how-do-i-use-entrieskeys-on-double-maps

@daiagi daiagi self-assigned this Dec 15, 2023
@kodabot
Copy link
Collaborator

kodabot commented Dec 15, 2023

ASSIGNED - @daiagi 🔒 LOCKED -> Saturday, December 16th 2023, 16:04:56 UTC -> 36 hours

@prury
Copy link
Member

prury commented Dec 15, 2023

@daiagi looking back i think #8302 and #8328 never went to prod

@vikiival
Copy link
Member

looking back i think #8302 and #8328 never went to prod

It went to main so I am 100% sure that is on prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-minting related to minting operations bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants