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

Check gas limit for builtin actors before calling their respective handle method #3752

Open
ekovalev opened this issue Feb 26, 2024 · 1 comment
Labels
C2-refactoring Refactoring proposal D1-core Gear Core

Comments

@ekovalev
Copy link
Member

ekovalev commented Feb 26, 2024

In the current implementation of the builtin actor framework (#3624) the builtin_dispatcher::run() doesn't check whether the gas provided is sufficient for the actor to execute a message - this can require decoding the message itself and, hence, is done inside the actor's handle function.
We might want to change this flow to let the builtin_dispatcher decide upfront if the gas limit is sufficient. One of the ways to do that is to make builtins report their maximum possible incurred gas cost and require the message gas limit to surpass that value. If the actually burned gas turns out to be less than that amount, the unused gas will naturally be returned to the gas tree.

@ekovalev ekovalev added D1-core Gear Core C2-refactoring Refactoring proposal labels Feb 26, 2024
@breathx
Copy link
Member

breathx commented Feb 26, 2024

And skip builtin message processing until next block in case that max of builtin weights is bigger than current gas allowance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-refactoring Refactoring proposal D1-core Gear Core
Projects
None yet
Development

No branches or pull requests

2 participants