-
Notifications
You must be signed in to change notification settings - Fork 587
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
[WIP] Ibcmodulev2 transfer application spike #7524
base: feat/ibc-eureka
Are you sure you want to change the base?
[WIP] Ibcmodulev2 transfer application spike #7524
Conversation
To me, this depends a lot on how long we expect v1 to live in our codebase. Short-term, this might be OK, I don't love the idea of a v2 depending on v1 and having these convoluted paths that might end up with weird bugs later. For one release, I might be OK :)
But the application would not know if the timestamp is the same as in the packet, unless only the application is allowed to construct new packets on all implementations? |
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.
I looked mainly at the high level interfaces. We want the sequence in ack and timeout as well.
@@ -27,6 +27,7 @@ type IBCModule interface { | |||
ctx context.Context, | |||
sourceChannel string, | |||
destinationChannel string, | |||
sequence uint64, |
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 should be added to OnAcknowledgementPacket
and OnTimeoutPacket
as well.
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.
yep makes sense!
Thinking a bit more about this, I was thinking it might be possible to create some type that is a subset of of the transfer keeper that has all the functionality that is shared (e.g. code regarding denoms/ native vs ibc etc. ) Extracting some interfaces/ functions into a the transfer v1 module, then having (potentially a new go mod for) transfer v2 import from v1 the required components/functions and implement all the new logic in a new keeper while re-using a subset from v1. Kind of similar to what is happening in this PR, but this is a bit messier just shoving it all in a sub directory. |
…fer-application-spike
…fer-application-spike
Description
This Spike was done by Cian & Nikolas to help inform the IBCModuleV2 interface definition and to get a PoC of what a transfer v2 module looks like and ensures that funigibility between v1 and v2 can be retained.
A few notes about what we did here before anything goes into the feature branch.
transfer/v2
. This keeper embeds the existing transfer/v1 keeper, and overrides functions required. E.g. the new OnRecv, Ack, Timeout etc.OnRecv
application callback, as this can be required by some applications. I think we probably need to add this to Ack/Timeout as well, but for now have not done so.This test ensures that fungibility remains and tokens can be sent back and forth using either the v1 or v2 router.
Questions
closes: #XXXX
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.