firefly
firefly copied to clipboard
Migration Issue with ERC-1155 Token Pools
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 connectorff 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
contractswith the contract address and block number you deployed the contract in the step above - Add entries in your
docker-compose.override.ymlto use builds frommainfor FireFly Core and the Token Connector ff start dev- You should now be running onmainand with a new batch pin contractdocker stop dev_firefly_core_0docker stop dev_tokens_0_0- Delete the tokens event stream
docker start dev_firefly_core_0docker start dev_tokens_0_0curl -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
Would like to work on this @nguyer
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.
@Philip-21
Would like to work on this @nguyer
I have fixed this in https://github.com/hyperledger/firefly/pull/1388 and https://github.com/hyperledger/firefly-tokens-erc1155/pull/135
@Philip-21
Would like to work on this @nguyer
I have fixed this in #1388 and hyperledger/firefly-tokens-erc1155#135
Alright
@nguyer I think we can close this?