-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(pop-api): add call filter #49
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.
Allowed calls should be explicit rather than module-wide and the included test contract shouldnt be located within examples.
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.
It would be good to set the same filter for pallet-contracts in general ?
In case some contracts decide to not use pop-api
to call the runtime.
We do not want to expose call_runtime directly because then we may break contracts with runtime upgrades. If we were to utilize the CallFilter in pallet-contracts, we would have to ONLY allow calls going into the Pop API pallet. Then we can filter a second layer in to ensure the next call is allowed |
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.
LGTM. Would ideally be good to address the clippy warnings in extensions.rs
, perhaps when resolving conflicts after runtime split is merged.
2581118
to
b655413
Compare
Adds an allowed list call filter to chain extension.
pallet-contracts
'sCallFilter
is not being used because it will allowb contracts to directly usecall_runtime
. Once the pop api pallet is introduced, the call filter should be implemented there.There is a new example contract for testing purposes that tests that the call filter works.