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

autopilot fallback address with callbacks #1047

Conversation

sampocs
Copy link
Collaborator

@sampocs sampocs commented Jan 6, 2024

Context

Took a first pass at implementing the fallback address using ibc callbacks instead of the keepers. This PR is far from complete, I'm just opening it so that you all can have a more concrete representation of what this solution would look like.

Potential Issues

Since autopilot is in a different stack, there's a significant amount of refactoring that would be needed to complete the callback wiring.

Most notably, as it currently sits in this PR, the callback will technically be executed via the records module. However:

  • (a) The records callback runs before the packet is sent down the stack (meaning the tokens wont be available to send to the fallback address), and
  • (b) There's a comment in the log linked above that says the callback will only work for transfers from the stakeibc module address (and I don't fully understand what it means but can dig in more later)

Remaining Work

  • Correctly execute the autopilot callback
    • Initial reaction is to sub out the records module from our stack with the callbacks module (like how we have it in stakeibc). That way callbacks can route to the relevant module (records vs autopilot).
      • However, the transfer module has to sit at the bottom of the stack, and the callbacks module is currently implemented such that it sits at the bottom of the stack, so it might not be trivial to do this.
    • Otherwise, another option would be to CallRegisteredICACallback from the autopilot OnAck/OnTimeout's (instead of from records).
      • However, this would require adding a guardrail to each module to make sure it doesn't run the callback from the other module.
  • Once the above is solved, we still need to make sure the packet is sent down the packet first. Unclear what changes are required for this atm.
  • Finally, would need to clean this up, test, and add unit tests

@sampocs
Copy link
Collaborator Author

sampocs commented Jan 9, 2024

closing this PR as we decided that this was too complex of an undertaking for the current timeline.

We'll revisit in the next few months what the best design for our middleware stack is.

@sampocs sampocs closed this Jan 9, 2024
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

Successfully merging this pull request may close these issues.

1 participant