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

core/{state, vm}: update stateless gas costs to follow the verkle-gen-7 testnet #31014

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gballet
Copy link
Member

@gballet gballet commented Jan 10, 2025

Adding values to the witness introduces a new class of issues for computing gas: if there is not enough gas to cover adding an item to the witness, then the item should not be added to the witness.

The problem happens when several items are added together, and that process runs out of gas. The witness gas computation needs a way to signal that not enough gas was provided. These values can not be hardcoded, however, as they are context dependent, i.e. two calls to the same function with the same parameters can give two different results.

The approach is to return both the gas that was actually consumed, and the gas that was necessary. If the values don't match, then a witness update OOG'd. The caller should then charge the consumed value (remaining gas will be 0) and error out.

Why not return a boolean instead of the wanted value? Because when several items are touched, we want to distinguish which item lacked gas.

@gballet gballet added the verkle label Jan 10, 2025
@gballet gballet force-pushed the kaustinen7-gas-costs branch from a74494a to 9f3ab25 Compare January 10, 2025 09:33
… testnet

Co-authored-by: Ignacio Hagopian <[email protected]>

Signed-off-by: Guillaume Ballet <[email protected]>
@gballet gballet force-pushed the kaustinen7-gas-costs branch from 9f3ab25 to c92a0d4 Compare January 10, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant