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

[Non-breaking changes] Chore: Update derive SHA for stacktrie #375

Conversation

c98tristan
Copy link
Contributor

@c98tristan c98tristan commented Jul 24, 2023

This PR update deriveSha function for stacktrie. DeriveSha creates the tree hashes of transactions, receipts, and withdrawals in a block header.

goos: darwin
goarch: amd64
pkg: github.com/tomochain/tomochain/core/types
cpu: VirtualApple @ 2.50GHz
                        │     old     │                new                 │
                        │   sec/op    │   sec/op     vs base               │
DeriveSha200/std_trie-8   215.6µ ± 2%   198.2µ ± 1%  -8.04% (p=0.000 n=20)

                        │      old      │                 new                  │
                        │     B/op      │     B/op      vs base                │
DeriveSha200/std_trie-8   279.85Ki ± 0%   61.23Ki ± 0%  -78.12% (p=0.000 n=20)

                        │     old     │                 new                 │
                        │  allocs/op  │  allocs/op   vs base                │
DeriveSha200/std_trie-8   2.888k ± 0%   1.647k ± 0%  -42.97% (p=0.000 n=20)

Copy link

@trinhdn2 trinhdn2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also make sure that the test units are updated alongside with these changes. There are lots of untouched hashing operations in unit tests.

consensus/clique/clique.go Outdated Show resolved Hide resolved
trie/database.go Outdated Show resolved Hide resolved
core/types/block.go Show resolved Hide resolved
core/types/block_test.go Outdated Show resolved Hide resolved
@trinhdn2
Copy link

This PR can be marked as non-breaking, and the merge destination needs to be changed from tomochain:master to tomochain:upgrade-core-develop

@c98tristan c98tristan changed the base branch from master to upgrade-core-develop July 25, 2023 07:18
@c98tristan c98tristan changed the title Chore: Update derive SHA for stacktrie [Non-breaking] Chore: Update derive SHA for stacktrie Jul 25, 2023
@c98tristan c98tristan changed the title [Non-breaking] Chore: Update derive SHA for stacktrie [Non-breaking changes] Chore: Update derive SHA for stacktrie Jul 25, 2023
@c98tristan c98tristan force-pushed the feat/update-trie-to-stacktrie branch from 08dbcbb to 72ca227 Compare July 25, 2023 09:54
@trinhdn2 trinhdn2 force-pushed the feat/update-trie-to-stacktrie branch from 25f9c44 to 260f47e Compare August 1, 2023 04:18
@tungng98 tungng98 deleted the branch BuildOnViction:upgrade-core-develop December 10, 2023 16:51
@tungng98 tungng98 closed this Dec 10, 2023
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.

4 participants