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: do not hash header if header is still changing #462

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

Conversation

protolambda
Copy link
Collaborator

Description

In the block-building code (triggered by miner package commitTransaction, which is used by engine-API) it runs this code-path where every time a transaction is applied, it takes the template block-header and re-encodes and hashes it.
This same function is also used by the op-program version of the engine-API.

This is inefficient in the same way in upstream L1 geth block-building code too.

One way to temporay-fix it, is to not compute the block-hash, when the state-root is still not set. A zero state-root implies that the block-building is not done.

This is a temporary fix. Ideally we improve the geth block-building API, so it's not running into this thing to begin with. Constructing receipts on the way is one thing, but trying to hydrate the metadata before the block is even finished is just bad.

This PR is a draft to help track this optimization until upstream block-building is improved.

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.

1 participant