-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add PFM Support to Agoric (Pegasus) #8463
Conversation
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.
Okay, I've finally gotten a handle on what it is you're doing here. I agree that PFM support is important at this time, but I want to factor it differently.
I think we can leverage Agoric's modularity to follow Strangelove's PFM middleware architecture more closely. I would suggest that PFM can be implemented by wrapping Pegasus's Connection
handler object then supplying that wrapper to the Network API to control the IBC channel instead of the original handler. That wrapper can intercept the Connection's callbacks, and use them to drive all the PFM logic without modifying Pegasus directly.
I'll reach out offline so we can discuss more about this.
.then(resolve) | ||
.catch((reason) => { | ||
if (retries - 1 > 0) { | ||
setTimeout(() => { |
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.
setTimeout
doesn't exist on chain, instead we need to use the TimerService.
I think this one is obsolete. If work resumes feel free to re-open. |
Description
This PR adds a PFM contract into Pegasus to add Packet Forward Middleware support for Agoric. This is crucial for EVM call support for Calypso and Squid Router.
What this does is allow for IBC transfers to append either a forward transfer message to an IBC transfer or a contract call to the IBC transfer.
Security Considerations
This follows typical ocap security principals. The contract uses the namesByAddress lookup to find a publicFacet that was publically exposed to run functions on the facet. Thus you MUST purposely expose your instance facet to be called by PFM. If you can't access it, you can't run it.
The only other thing is, that this means on IBC transfer, all assets forwarded with the PFM message will be pushed into that message. Meaning, that if the forward is an IBC transfer, it forwards ALL of those assets to the next chain. If it's a contract call it sends ALL of the payment from the IBC transfer into the contract call. On failure, the assets just live in the users (the receivers address on the original IBC transfers) account.
Scaling Considerations
No
Testing Considerations
I added tests for the additions. They should be fine but let me know if we need more!
Upgrade Considerations
I would imagine Pegasus in some capacity would need to be upgraded? In order to add support to mainnet/testnet live Pegasus contract?