-
Notifications
You must be signed in to change notification settings - Fork 204
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
remove GetConnectionIdFromICAPort, use connection ID from host zone #1179
Conversation
c919a4a
to
0180e14
Compare
Nice to get rid of those blocks of unnecessary code! Do we need changes to ICAs that are submitted via submittxs to ICAs that are not the delegate acct? E.g. the ICA to the withdrawal acct that sweep rewards (submitted in FeeBalanceCallback) As long as we address that question and integration test this I'm signed off |
@riley-stride sorry can you say more on this question / point to a specific example? I think all other references just grab the connection ID from the host zone (e.g. fee balance callback) |
Resolved in Slack with I'm signed off. |
Each ICA has it's own channel - and all channels are on the same connection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function GetConnectionIdFromICAPort returns the first connection ID that matches the port ID - but there can be more than one connection with a given port ID
What's the scenario where there are two connections associated with an ICA port ID? Is it due to migrating the connection on an active host zone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! This is a great catch, it's quite an edge case.
I'm surprised we use the port_id->connection_id
lookup when the connection_id
is so readily available, but on-board with changing it now.
Yeah the use case would be if a light client expired for a host and we had to update the connection. Hope to god we never have to worry about this on mainnet, but it already happened on testnet with dydx unfortunately :( |
Context
There are a couple issues with how the connection ID is handled that prevents the re-registering of a host zone after it's been unregistered. This is primarily relevant for testnet, but also indicates a flaw in the current logic.
Namely the issues are:
GetConnectionIdFromICAPort
returns the first connection ID that matches the port ID - but there can be more than one connection with a given port IDBrief Changelog
GetConnectionIdFromICAPort
ConnnectionId
from host zone in Delegation and SetWithdrawalAddress ICAsGetConnectionFromChannel
in place of the removed function in theOnChanOpenAck
callback