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

Avoid applying transactions twice for chunk producers #12649

Open
bowenwang1996 opened this issue Dec 19, 2024 · 0 comments
Open

Avoid applying transactions twice for chunk producers #12649

bowenwang1996 opened this issue Dec 19, 2024 · 0 comments

Comments

@bowenwang1996
Copy link
Collaborator

For a chunk producer, when they produce a chunk, they call verify_and_charge_transaction when they pull out transactions from the transaction pool. What it does here effectively is to compute the state update as of after all the transactions are applied. This computation also includes signature verification. However, the state update is then thrown away and when the chunk is applied, for the transaction portion, the same computation is done again. In the stateless validation context, this means that it takes chunk producers extra time before they can start distributing state witness. This becomes a big problem when a chunk contains thousands of transactions, as time spent on processing transactions becomes nontrivial.

To address this problem, I suggest caching the results on applying transactions after a chunk is produced, including the state update and state witness, so that a chunk producer doesn't need to duplicate the computation. Likely something related to congestion control and/or bandwidth scheduler needs to be adjusted to make sure the computation done is exactly the same between chunk production and chunk application.

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

No branches or pull requests

1 participant