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

x/wasm hooks #1683

Open
jhernandezb opened this issue Oct 28, 2023 · 3 comments
Open

x/wasm hooks #1683

jhernandezb opened this issue Oct 28, 2023 · 3 comments
Milestone

Comments

@jhernandezb
Copy link
Contributor

For a couple of months I've been thinking about a cosmwasm system where there can be namespaces: ability to upload codes to a namespace where they can interact each other but also open permissions to other namespaces you can think of like linux namespaces and a firewall.

First I thought just playing around with a fork but then I think that this could also be achieved if another module had access to hooks like

BeforeInstantiate()
BeforeExecute()
BeforeStore()
BeforeMigrate()

then anx/namespace module can just subscribe to hooks and apply whatever logic.

This is just an idea but not sure if others would find this interesting our useful

@alpe alpe added the discussion label Nov 8, 2023
@alpe
Copy link
Member

alpe commented Nov 8, 2023

Thanks for bringing this topic up. I am happy to see new ideas and use cases rising.
We could replace the keeper instance with an interface in msg_server so that you can play around without the need for a fork for now.

@jhernandezb
Copy link
Contributor Author

Thanks for bringing this topic up. I am happy to see new ideas and use cases rising. We could replace the keeper instance with an interface in msg_server so that you can play around without the need for a fork for now.

Are intra contract calls routed through msg_server? If so that would help me with exactly what I want

@alpe
Copy link
Member

alpe commented Nov 10, 2023

Are intra contract calls routed through msg_server?

yes, you can find all the message handling in https://github.com/CosmWasm/wasmd/blob/v0.44.0/x/wasm/keeper/handler_plugin.go#L54

The wasm keeper has private functions to not mess with the authorization system but we could provide some adapter here to help you out

@alpe alpe added this to the v0.46.0 milestone Nov 15, 2023
@hashedone hashedone modified the milestones: v0.46.0, v0.51 Dec 11, 2023
@chipshort chipshort modified the milestones: v0.51, v0.52 Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants