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

Don't execute transactions unless they will definitely fit in a block #1942

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

JamesHinshelwood
Copy link
Contributor

Previously, we would optimistically execute transactions from the pool, even if their gas limit exceeded the remaining gas, in case they actually used less gas after being executed.

However, this means we need to commit state after each transaction and unwind changes if our optimistic guess was wrong. Instead, we make the pessimistic assumption that transaction gas limits are accurate and don't execute a transaction unless we are guaranteed to have enough space for it.

@JamesHinshelwood JamesHinshelwood changed the title Don't execute transactions unless they will definately fit in a block Don't execute transactions unless they will definitely fit in a block Dec 3, 2024
Previously, we would optimistically execute transactions from the
pool, even if their gas limit exceeded the remaining gas, in case
they actually used less gas after being executed.

However, this means we need to commit state after each transaction
and unwind changes if our optimistic guess was wrong. Instead, we
make the pessimistic assumption that transaction gas limits are
accurate and don't execute a transaction unless we are guaranteed
to have enough space for it.
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Dec 4, 2024
Merged via the queue into main with commit e52dc2b Dec 4, 2024
5 checks passed
@JamesHinshelwood JamesHinshelwood deleted the dont-pull-big-txns branch December 4, 2024 08:48
shawn-zil added a commit that referenced this pull request Dec 5, 2024
github-merge-queue bot pushed a commit that referenced this pull request Dec 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.

Don't pull transactions from pool unless we are certain they will fit in the block
2 participants