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

fix: Handle fallback hooks & entrypoint/self-call/public selector runtime execution hooks #112

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

Zer0dot
Copy link
Contributor

@Zer0dot Zer0dot commented Jul 25, 2024

Motivation

This PR addresses an issue flagged by @0xrubes where execution hooks would be run twice in the case of an allowed caller calling into a fallback function.

It also addresses an issue where execution hooks would be skipped when the caller is the account or the entrypoint, or when the called selector is public.

Solution

We now correctly handle the return values from _checkPermittedCallerAndAssociatedHooks() in the fallback function, and we now run the execution hooks in the latter function regardless of who the caller is or if the selector is public.

Note that permission hooks are only run when a validation function (executeWithAuthorization()) or direct-call validation is used.

…-call, public selectors and entrypoint calls
Copy link
Contributor

@adamegyed adamegyed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We need to expand test coverage in the future to include cases like this.

@Zer0dot Zer0dot merged commit b71d6c9 into v0.8-develop Jul 25, 2024
3 checks passed
@Zer0dot Zer0dot deleted the zer0dot/fix-direct-call-fallback-hooks branch July 25, 2024 22:19
adamegyed pushed a commit that referenced this pull request Jul 26, 2024
adamegyed pushed a commit that referenced this pull request Aug 5, 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.

2 participants