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

Gas metering for filters #450

Merged
merged 4 commits into from
Dec 19, 2024
Merged

Gas metering for filters #450

merged 4 commits into from
Dec 19, 2024

Conversation

hacheigriega
Copy link
Member

Explanation of Changes

Adding gas metering for filters as described in Issue #449.

The gas used amount is constant for a given filter type and replication factor regardless of whether the filter returned an error or not. If the filter was not applied at all, the gas used is zero.

The gas used towards filtering is subtracted from the gas limit we feed into the tally VM.
In addition, the tally gas used amount is now the sum of the gas used by the tally VM and the gas used by the filter.

Testing

Added checks to the existing filter tests

Related PRs and Issues

Closes #449

@hacheigriega hacheigriega requested a review from a team December 17, 2024 07:08
x/tally/keeper/filter.go Show resolved Hide resolved
x/tally/keeper/endblock.go Outdated Show resolved Hide resolved
@hacheigriega hacheigriega force-pushed the hy/improve-tests branch 2 times, most recently from 2f6bc9e to 035b083 Compare December 17, 2024 13:17
Base automatically changed from hy/improve-tests to main December 17, 2024 13:18
@hacheigriega hacheigriega merged commit 050dea4 into main Dec 19, 2024
15 of 17 checks passed
@hacheigriega hacheigriega deleted the hy/filter-gas branch December 19, 2024 12:03
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.

✨ Consensus filter gas consumption
3 participants