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

bug: Seeing multiple blockchain transaction confirmed events for a single transaction #1614

Open
EnriqueL8 opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@EnriqueL8
Copy link
Contributor

EnriqueL8 commented Jan 10, 2025

What happened?

I have a FireFly namespace setup with a token connector and evmconnect. I submitted a blockchain invoke operation that resulted in a transaction to EVMConnect. In the meantime, I have FireFly and the Token Connector connected each through their own web socket to EVMConnect on a separate Event Stream.

Once EVMConnect confirms that the transaction has been submitted correctly it will submitted an event on the event stream to all connected sockets see https://github.com/hyperledger/firefly-transaction-manager/blob/b66a96a45b3b66d17d9aa913e5d2584c6da1da42/pkg/fftm/transaction_events_handler.go#L94

Thus FireFly and the Token Connector both receive a blockchain transaction submitted event, the token connector forwards that event to FireFly and you end up with two events on the transaction.

This did not happen every single time! Sometimes I only got one event, it might be related to the best effort of TX confirmation events in the web socket as per the comment in the code linked.

What did you expect to happen?

I would expect to only see one confirmation but based on this background that one Transaction object could have multiple blockchain transactions it could make sense to see multiple events (but not in the case of one blockchain tx):

Currently in FireFly there are two related objects which represent an attempt to perform a blockchain transaction:

  • The FireFly Transaction object - one of these is created for each high-level type of action being performed, and there could be zero, one or (in the future) more than one blockchain transaction associated with this.
  • The Blockchain Operation object - the ID of this is used when calling EthConnect/EVMConnect. This is a re-submittable item, and a new ID is generated if a user chooses to submit it again.

How can we reproduce it (as minimally and precisely as possible)?

Setup a FireFly stack with EVMConnect and a Token Connector. Submit a transaction to any smart contract and look at the transaction object to see the blockchain events associated with it.

@EnriqueL8 EnriqueL8 added the bug Something isn't working label Jan 10, 2025
@EnriqueL8
Copy link
Contributor Author

EnriqueL8 commented Jan 13, 2025

This is the line in the token connector https://github.com/hyperledger/firefly-tokens-erc20-erc721/blob/e353ba7dfbe794ad2f6efb47bef0c1dbbb4e1f7d/src/websocket-events/websocket-events.base.ts#L125-L129 which will broadcast the TX receipt to all the clients connected

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

1 participant