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

txpool should use consensus rule to prepare block header #1343

Closed
jangko opened this issue Nov 30, 2022 · 0 comments · Fixed by #1352
Closed

txpool should use consensus rule to prepare block header #1343

jangko opened this issue Nov 30, 2022 · 0 comments · Fixed by #1352
Labels
bug Something isn't working txpool tx pool related issue

Comments

@jangko
Copy link
Contributor

jangko commented Nov 30, 2022

as revealed by runTxPoolCliqueTest in test_txpool2.nim, when a transaction call a contract that modify storage using prevrandao or difficulty value from block header, the result can be different if the header is prepared later by consensus engine.

basically, the txpool should aware of consensus rule when preparing block header.
the rule should be applied inside the txpool not outside after the header produce by txpool.

so far we are just lucky passing hive test case because they only use transaction calling contract without modifying account storage using value produced by different consensus rule.

currently the txpool only use pow rule to prepare header. and the sealing engine piggyback txpool with clique and POS, that is a wrong approach. the consensus rule should be moved into the consensus folder, and called by txpool.

this is conjoint with issue #1329

@jangko jangko added bug Something isn't working txpool tx pool related issue labels Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working txpool tx pool related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant