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

how to deal with reorg message on source chain? #46

Open
xiaoch05 opened this issue Dec 14, 2023 · 0 comments
Open

how to deal with reorg message on source chain? #46

xiaoch05 opened this issue Dec 14, 2023 · 0 comments

Comments

@xiaoch05
Copy link
Contributor

Helix uses the messageId of the underlying message as the unique identifier of the transaction, so when a reorg occurs on the source chain, it is possible that the same transaction will generate a different messageId to be sent to the destination chain.

For example, messageId is generated by hash(nonce, payload), the nonce is stored in the contract and is incremented.

  • UserA sends a transaction with nonce = 1 to a forked chain.
  • UserB sends a transaction that takes up nonce = 1 on the canonical chain
  • and then UserA's transaction is immediately packaged on the canonical chain and takes up nonce = 2.

At this point, UserA's transaction generates different messageId on the forked chain and the canonical chain, which will be considered as different messages on the target chain, generating a double spend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant