-
Notifications
You must be signed in to change notification settings - Fork 62
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
ICS-030 Middleware support #184
Comments
I wrote an example of a design pattern for middleware contracts in the following gist: https://gist.github.com/bluele/39378422eb8c1cd55dfa5702b43978e0 In this example, I demonstrate the implementation of middleware that can be applied to an existing App contract by utilizing solidity inheritance. I believe this approach offers several advantages compared to using multiple contracts(e.g. #215):
|
okey, so super will call stack according order inheritance was done. |
i have read the code. it allows to reuse middleware for different apps and allows ro.stack middlewares to be executed in order via super. so it looms good. |
will redo like this approach with test. |
looks wrong. app should call sendPacket of parent, so it is no |
on receive or send |
will it be ok to do hybrid? super, in one direction, but still need to pass child address to its parent address to call. will modify like that. |
Ah, sorry, that code comment is confusing.
Exactly, middleware's sendPacket calling order must be in reverse order of the receivePacket calling order. Therefore, the inheritance order of the Sender and Receiver of each middleware must be reversed: The execution result may be easier to understand:
|
To make this design pattern available, the following modifications would be required:
|
WOW. I did know about override feature. trying. |
2 issue with approach:
but it gives single contract deployment of app stack - i guess it is way better. |
ICS20 works as before. i doubt timeout relats to my changs. ICS20 wihtout middleware |
|
fixed via ir. unit tests passed. i will test middleware on REAL input from Centauri and Osmosis cosmos chain soon. will add that copy into unit test after |
https://github.com/cosmos/ibc/tree/main/spec/app/ics-030-middleware
The text was updated successfully, but these errors were encountered: