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

Blank state transitions do not update to state data #80

Closed
nicbus opened this issue Jun 30, 2023 · 5 comments · Fixed by #81
Closed

Blank state transitions do not update to state data #80

nicbus opened this issue Jun 30, 2023 · 5 comments · Fixed by #81
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nicbus
Copy link
Contributor

nicbus commented Jun 30, 2023

Using our rgb-sandbox I tried to issue 2 assets to the same UTXO, then transfer the first asset to another wallet and then check the the second asset's allocation, which I expect to be on the change outpout at that point.

What I find is that, after the transfer has completed, the second asset's allocation is still on the original issuance UTXO, which has now been spent.

To give an example, this is the situation after issuing the two assets:

  • wallet unspents:
   8a675edd1a228bdbe24254bf1675a057275b49ade7bac9049513a77a40c6f59b:0
  • 1st asset allocations
    amount=2000  utxo=8a675edd1a228bdbe24254bf1675a057275b49ade7bac9049513a77a40c6f59b:0
  • 2nd asset allocations
    amount=2000  utxo=8a675edd1a228bdbe24254bf1675a057275b49ade7bac9049513a77a40c6f59b:0

Then a transfer (txid 296ab67bd423551c87229e9371b85ee5c62b60417d8015bed146d49d71bb784f) sends 100 units of the first asset to another wallet and this is the resulting situation (on the issuer/sender side):

  • wallet unspents:
   296ab67bd423551c87229e9371b85ee5c62b60417d8015bed146d49d71bb784f:1
  • 1st asset allocations
    amount=1900  utxo=296ab67bd423551c87229e9371b85ee5c62b60417d8015bed146d49d71bb784f:1
  • 2nd asset allocations
    amount=2000  utxo=8a675edd1a228bdbe24254bf1675a057275b49ade7bac9049513a77a40c6f59b:0

This issue can be reproduced using this branch of rgb-sandbox.

@dr-orlovsky
Copy link
Member

I was able to replicate the issue, thank you for the sandbox environment.

From my debug information I see that the blank transition is created and the state is transferred correctly, i.e. stash state is correct and nothing is lost. The problem is that the blank transition is not indexed and not parsed to update cached state data in the inventory, so rgb can't "see" it.

Investigating the reasons why it happens.

@dr-orlovsky
Copy link
Member

Was this working correctly before the latest PRs?

@nicbus
Copy link
Contributor Author

nicbus commented Jul 3, 2023

Was this working correctly before the latest PRs?

Unfortunately I can't tell.

Checking a blank transfer was not part of rgb-sandbox before, as we were focusing on more basic transfer functionality, and has just been added in the attempt to cover more and more use cases.

@crisdut
Copy link
Member

crisdut commented Jul 5, 2023

This error is the same of that #60

@dr-orlovsky
Copy link
Member

Fixed with #81.

The tests with sandbox now pass for me (I updated the rgb-contracts crate to use the fixed version of rgb-std)

@dr-orlovsky dr-orlovsky changed the title blank transition not working Blank state transitions do not update to state data Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants