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

Migration Issue with ERC-1155 Token Pools #1457

Closed
nguyer opened this issue Jan 29, 2024 · 5 comments
Closed

Migration Issue with ERC-1155 Token Pools #1457

nguyer opened this issue Jan 29, 2024 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@nguyer
Copy link
Contributor

nguyer commented Jan 29, 2024

While testing upgrading from v1.2.2 to the current code in main I discovered that token events can get "stuck" in a certain situation.

Steps to reproduce:

  • Create a FireFly stack on v1.2.2 (default, using no release or manifest options) with an ERC-1155 token connector
    • ff init dev -t erc1155
  • Create a token pool
  • Deploy the current Batch Pin contract from main
  • ff stop dev
  • Update your FireFly Core config file by adding a new entry under contracts with the contract address and block number you deployed the contract in the step above
  • Add entries in your docker-compose.override.yml to use builds from main for FireFly Core and the Token Connector
  • ff start dev - You should now be running on main and with a new batch pin contract
  • docker stop dev_firefly_core_0
  • docker stop dev_tokens_0_0
  • Delete the tokens event stream
  • docker start dev_firefly_core_0
  • docker start dev_tokens_0_0
  • curl -X POST "http://127.0.0.1:5108/api/v1/init" to re-create the event stream
  • FireFly begins throwing an error on the duplicate token pool forever

NOTE: This also blocks any future token pools from being created and I think any transfers from being indexed as well

@nguyer nguyer added the bug Something isn't working label Jan 29, 2024
@nguyer nguyer added this to the v1.3.0 milestone Jan 29, 2024
@Philip-21
Copy link
Contributor

Would like to work on this @nguyer

@nguyer
Copy link
Contributor Author

nguyer commented Feb 2, 2024

Upon more investigation this is due to the fact that the format of the token pool locator changed between v1.2.2 and now. I discussed this with @awrichar and we decided that adding an alternateLocators: []string to the token pool creation event which the connector sends back to FireFly will allow the token connector to inform FireFly of any previous locators by which this pool may have been referenced. On the token pool creation event (and only that one) if FireFly sees a new locator but has a record for a token pool with a matching alternateLocator it will update its database to use the new locator.

@nguyer
Copy link
Contributor Author

nguyer commented Feb 2, 2024

@Philip-21

Would like to work on this @nguyer

I have fixed this in #1388 and hyperledger/firefly-tokens-erc1155#135

@Philip-21
Copy link
Contributor

@Philip-21

Would like to work on this @nguyer

I have fixed this in #1388 and hyperledger/firefly-tokens-erc1155#135

Alright

@EnriqueL8
Copy link
Contributor

@nguyer I think we can close this?

@nguyer nguyer closed this as completed Apr 25, 2024
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
None yet
Development

No branches or pull requests

3 participants