-
Notifications
You must be signed in to change notification settings - Fork 691
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Solana: Multiple Emitter Registrations Per Chain Are Allowed #1852
Comments
The proposed solution does block re-registrations, but does not cover a scenario where the registration needs to be updated for whatever reason. For other chains there is a way to do this via an upgrade governance, so I think we should at least outline a strategy for that here too. Firstly, the newly proposed account derived from the chain should contain the current emitter's address. Then the registration upgrade strategy could be as follows:
I'm not suggesting we should implement this strategy right now, but we should document it somewhere in case a registration needs to be updated again (like in the context of the current issue) |
My first reaction in reading the initial description was the likely eventual need to upgrade to a new endpoint for whatever reason. I agree with the sentiment that there should only be one active registration per chain and I @kcsongor approach to migrating to new changes when we are ready for it. No objection here, agree with the proposal. |
We need a playbook for when/if that happens. e.g. when brining up new chains, the old registrations VAAs still need to be replayed (in order) to ensure that they can't be replayed maliciously. For solana, |
I think this could be described in WH Notion (or in a markdown doc under a playbooks folder). I tend to like the idea of it living in the repo to start building out playbooks for operational tasks. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Expected Behavior
There should only be one contract per network which is trusted to emit token / nft bridge messages. Only one emitter per chain should be registered.
Current Behavior
The derivation for an
endpoint
, the account for which existence signifies that the emitter chain and address is registered, includes both emitter chain and emitter address.wormhole/solana/modules/token_bridge/program/src/api/governance.rs
Line 134 in de02c20
While the same emitter chain and address combination cannot be registered twice, due to the
AccountState::Uninitialized
requirement, nothing prevents two different addresses on the same chain from being registered. This is not an immediate concern as registration VAAs can only be created manually through governance, but it deviates from how the other implementations work and could lead to poor maintainer assumptions in the future.Possible Solution
Add an additional account to
RegisterChain
which is derived only on emitter chain, must be uninitialized, and gets initialized in this call. This should block the same chain from having multiple registrations. The use ofendpoint
should not be changed nor should this new account be added to other methods, e.g.CompleteTransfer
, as this could break existing integrators. A breaking change toRegisterChain
should be acceptable given its limited use only by the Guardians / maintainers and isn't expected to be called by any contracts.Context (Environment)
This was encountered when needing to update a registration in testnet and I found that other contracts required a migration but Solana just accepted a different registration for the same chain without modification 😅
The text was updated successfully, but these errors were encountered: