Skip to content

fix: create ordered trie when computing roots for transactions, receipts & withdrawals #225

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

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Aug 6, 2024

Motivation

These roots are currently being calculated using from_sorted_iter but without being sorted beforehand. This PR replaces this behavior with inserting directly into the trie to ensure that it is ordered, then computing the root (The same fix that has been previously applied to storage root)

Description

Fixes compute_transactions_root, compute_receipts_root & compute_withdrawals_root

Notes

After this change, the payloads created by kurtosis local net now pass the block hash validations in engine_NewPayloadV3

Closes None, but is needed for #51

@fmoletta fmoletta marked this pull request as ready for review August 6, 2024 18:29
@fmoletta fmoletta requested a review from a team as a code owner August 6, 2024 18:29
@fmoletta fmoletta added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit 412fcde Aug 7, 2024
5 checks passed
@fmoletta fmoletta deleted the fix-root-computations branch August 7, 2024 17:45
mpaulucci pushed a commit to mpaulucci/lambda_ethereum_rust that referenced this pull request Oct 16, 2024
…pts & withdrawals (lambdaclass#225)

**Motivation**

These roots are currently being calculated using `from_sorted_iter` but
without being sorted beforehand. This PR replaces this behavior with
inserting directly into the trie to ensure that it is ordered, then
computing the root (The same fix that has been previously applied to
storage root)

**Description**

Fixes `compute_transactions_root`, `compute_receipts_root` &
`compute_withdrawals_root`
<!-- A clear and concise general description of the changes this PR
introduces -->

**Notes**

After this change, the payloads created by kurtosis local net now pass
the block hash validations in `engine_NewPayloadV3`
<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes None, but is needed for lambdaclass#51

Co-authored-by: Federica Moletta <[email protected]>
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.

2 participants