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

Refactor Trie implementation #472

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@CoderZhi
Copy link
Collaborator

commented Jan 24, 2019

  1. Keep internal status, and do serialization and hash on commit only
  2. Serialize nodes in parallel

@CoderZhi CoderZhi requested a review from iotexproject/protocol-team as a code owner Jan 24, 2019

Show resolved Hide resolved db/trie/leafnode.go Outdated
Show resolved Hide resolved db/trie/branchnode.go Outdated
Show resolved Hide resolved db/trie/branchnode.go Outdated
Show resolved Hide resolved db/trie/branchroottrie.go Outdated
Show resolved Hide resolved db/trie/hashnode.go Outdated
Show resolved Hide resolved db/trie/hashnode.go
Show resolved Hide resolved db/trie/trienode.go Outdated
@codecov

This comment has been minimized.

Copy link

commented Jan 24, 2019

Codecov Report

Merging #472 into master will decrease coverage by 0.06%.
The diff coverage is 59.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #472      +/-   ##
==========================================
- Coverage   60.94%   60.88%   -0.07%     
==========================================
  Files         126      127       +1     
  Lines       11546    11614      +68     
==========================================
+ Hits         7037     7071      +34     
- Misses       3578     3622      +44     
+ Partials      931      921      -10
Impacted Files Coverage Δ
config/config.go 67.88% <ø> (ø) ⬆️
action/protocol/execution/evm/evmstatedbadapter.go 62.22% <ø> (+0.45%) ⬆️
db/trie/trie.go 56.66% <ø> (ø) ⬆️
db/trie/trienode.go 66.66% <0%> (-33.34%) ⬇️
endorsement/endorsementset.go 42.3% <0%> (ø) ⬆️
db/trie/leafiterator.go 0% <0%> (ø) ⬆️
db/trie/hashnode.go 31.57% <31.57%> (ø)
db/trie/branchroottrie.go 52.14% <45.67%> (-12.46%) ⬇️
action/protocol/execution/evm/contract.go 83.07% <60%> (-2.87%) ⬇️
db/trie/kvstore.go 60% <66.66%> (-15%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbe825d...611e007. Read the comment docs.

1 similar comment
@codecov

This comment has been minimized.

Copy link

commented Jan 24, 2019

Codecov Report

Merging #472 into master will decrease coverage by 0.06%.
The diff coverage is 59.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #472      +/-   ##
==========================================
- Coverage   60.94%   60.88%   -0.07%     
==========================================
  Files         126      127       +1     
  Lines       11546    11614      +68     
==========================================
+ Hits         7037     7071      +34     
- Misses       3578     3622      +44     
+ Partials      931      921      -10
Impacted Files Coverage Δ
config/config.go 67.88% <ø> (ø) ⬆️
action/protocol/execution/evm/evmstatedbadapter.go 62.22% <ø> (+0.45%) ⬆️
db/trie/trie.go 56.66% <ø> (ø) ⬆️
db/trie/trienode.go 66.66% <0%> (-33.34%) ⬇️
endorsement/endorsementset.go 42.3% <0%> (ø) ⬆️
db/trie/leafiterator.go 0% <0%> (ø) ⬆️
db/trie/hashnode.go 31.57% <31.57%> (ø)
db/trie/branchroottrie.go 52.14% <45.67%> (-12.46%) ⬇️
action/protocol/execution/evm/contract.go 83.07% <60%> (-2.87%) ⬇️
db/trie/kvstore.go 60% <66.66%> (-15%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbe825d...611e007. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

commented Jan 24, 2019

Codecov Report

Merging #472 into master will decrease coverage by 0.04%.
The diff coverage is 59.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #472      +/-   ##
==========================================
- Coverage   60.09%   60.05%   -0.05%     
==========================================
  Files         128      129       +1     
  Lines       11696    11756      +60     
==========================================
+ Hits         7029     7060      +31     
- Misses       3732     3770      +38     
+ Partials      935      926       -9
Impacted Files Coverage Δ
config/config.go 67.64% <ø> (ø) ⬆️
db/trie/trienode.go 100% <ø> (ø) ⬆️
action/protocol/execution/evm/evmstatedbadapter.go 62.22% <ø> (+0.45%) ⬆️
db/trie/trie.go 56.66% <ø> (ø) ⬆️
endorsement/endorsementset.go 40.24% <0%> (ø) ⬆️
db/trie/leafiterator.go 0% <0%> (ø) ⬆️
db/trie/hashnode.go 37.5% <37.5%> (ø)
db/trie/branchroottrie.go 52.14% <45.67%> (-12.46%) ⬇️
action/protocol/execution/evm/contract.go 83.07% <60%> (-2.87%) ⬇️
db/trie/kvstore.go 60% <66.66%> (-15%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a0cf74...287ccb0. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

commented Jan 24, 2019

Codecov Report

Merging #472 into master will decrease coverage by 0.06%.
The diff coverage is 59.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #472      +/-   ##
==========================================
- Coverage   60.94%   60.88%   -0.07%     
==========================================
  Files         126      127       +1     
  Lines       11546    11614      +68     
==========================================
+ Hits         7037     7071      +34     
- Misses       3578     3622      +44     
+ Partials      931      921      -10
Impacted Files Coverage Δ
config/config.go 67.88% <ø> (ø) ⬆️
action/protocol/execution/evm/evmstatedbadapter.go 62.22% <ø> (+0.45%) ⬆️
db/trie/trie.go 56.66% <ø> (ø) ⬆️
db/trie/trienode.go 66.66% <0%> (-33.34%) ⬇️
endorsement/endorsementset.go 42.3% <0%> (ø) ⬆️
db/trie/leafiterator.go 0% <0%> (ø) ⬆️
db/trie/hashnode.go 31.57% <31.57%> (ø)
db/trie/branchroottrie.go 52.14% <45.67%> (-12.46%) ⬇️
action/protocol/execution/evm/contract.go 83.07% <60%> (-2.87%) ⬇️
db/trie/kvstore.go 60% <66.66%> (-15%) ⬇️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbe825d...611e007. Read the comment docs.

@CoderZhi CoderZhi force-pushed the CoderZhi:trie_with_commit branch Jan 24, 2019

action/protocol/execution/evm/contract.go Outdated
@@ -134,7 +132,7 @@ func (c *contract) Snapshot() Contract {
dao: c.dao,
// note we simply save the trie (which is an interface/pointer)

This comment has been minimized.

Copy link
@dustinxie

dustinxie Jan 25, 2019

Contributor

this comment can be removed

@CoderZhi CoderZhi force-pushed the CoderZhi:trie_with_commit branch to 287ccb0 Jan 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.