Skip to content

chore(trie): simplify Verify proof function#2661

Merged
qdm12 merged 1 commit intodevelopmentfrom
qdm12/trie/proof-simplify
Jul 22, 2022
Merged

chore(trie): simplify Verify proof function#2661
qdm12 merged 1 commit intodevelopmentfrom
qdm12/trie/proof-simplify

Conversation

@qdm12
Copy link
Copy Markdown
Contributor

@qdm12 qdm12 commented Jul 8, 2022

Changes

  • Merkle value for all encoded proof nodes is their encoding hash digest
  • Add comments
  • Update error wrapping strings

This is done following comments on https://substrate.stackexchange.com/questions/2892/proof-order-of-proof-encoded-nodes

Tests

go test github.com/ChainSafe/gossamer/lib/trie/proof

Issues

Primary Reviewer

@timwu20

- Merkle value for all encoded proof nodes is their encoding hash digest
- Add comments
- Update error wrapping strings
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 8, 2022

Codecov Report

Merging #2661 (2e0a243) into development (2bb2609) will increase coverage by 0.05%.
The diff coverage is 94.11%.

@@               Coverage Diff               @@
##           development    #2661      +/-   ##
===============================================
+ Coverage        62.40%   62.46%   +0.05%     
===============================================
  Files              211      211              
  Lines            27347    27347              
===============================================
+ Hits             17065    17081      +16     
+ Misses            8642     8630      -12     
+ Partials          1640     1636       -4     
Flag Coverage Δ
unit-tests 62.46% <94.11%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/trie/proof/verify.go 97.08% <94.11%> (+2.54%) ⬆️
lib/grandpa/message_handler.go 56.46% <0.00%> (-0.01%) ⬇️
lib/babe/epoch_handler.go 77.65% <0.00%> (+0.15%) ⬆️
dot/network/service.go 57.20% <0.00%> (+0.46%) ⬆️
dot/network/light.go 86.05% <0.00%> (+0.79%) ⬆️
dot/network/notifications.go 66.32% <0.00%> (+1.03%) ⬆️
lib/grandpa/vote_message.go 81.48% <0.00%> (+1.23%) ⬆️
lib/grandpa/message.go 63.30% <0.00%> (+2.15%) ⬆️

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 2bb2609...2e0a243. Read the comment docs.

Copy link
Copy Markdown
Contributor

@jimjbrettj jimjbrettj left a comment

Choose a reason for hiding this comment

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

lgtm

@qdm12 qdm12 merged commit 91d6619 into development Jul 22, 2022
@qdm12 qdm12 deleted the qdm12/trie/proof-simplify branch July 22, 2022 13:44
rrtti pushed a commit to polkadot-fellows/seeding that referenced this pull request Sep 29, 2022
I am Quentin Mc Gaw, a software engineer working the Go Polkadot host **Gossamer**.
I have been working full time on Gossamer since October 2021, mostly on the state trie and storage.
I have also made a [few minor pull requests](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12) to the Polkadot specification repository.

I am requesting to join the Fellowship at rank 1.

## Main contributions

### Gossamer

- Fix memory leaks
  - Trie encoding buffer pools usage fixed [#2009](ChainSafe/gossamer#2009)
  - Fix state map of tries memory leak [#2286](ChainSafe/gossamer#2286)
  - Fix sync benchmark [#2234](ChainSafe/gossamer#2234)
- Trie proof fixes ([#2604](ChainSafe/gossamer#2604), [#2661](ChainSafe/gossamer#2661))
- Fix end to end tests orchestration ([#2470](ChainSafe/gossamer#2470), [#2452](ChainSafe/gossamer#2452), [#2385](ChainSafe/gossamer#2385), [#2370](ChainSafe/gossamer#2370))
- State trie statistics ([#2378](ChainSafe/gossamer#2378), [#2310](ChainSafe/gossamer#2310), [#2272](ChainSafe/gossamer#2272))
- State trie fixes and improvements
  - Only deep copy nodes when mutation is certain [#2352](ChainSafe/gossamer#2352) and [#2223](ChainSafe/gossamer#2223)
  - Only deep copy necessary fields of a node [#2384](ChainSafe/gossamer#2384)
  - Use Merkle values for database keys instead of always hash [#2725](ChainSafe/gossamer#2725)
  - Opportunistic parallel Merkle value commputing [#2081](ChainSafe/gossamer#2081)
- Grandpa capped number of tracked messages ([#2490](ChainSafe/gossamer#2490), [#2485](ChainSafe/gossamer#2485))
- Add pprof HTTP service for profiling [#1991](ChainSafe/gossamer#1991)

Ongoing work:

- State trie lazy loading and caching
- State trie v1 support ([#2736](ChainSafe/gossamer#2736), [#2747](ChainSafe/gossamer#2747), [#2687](ChainSafe/gossamer#2687), [#2686](ChainSafe/gossamer#2686), [#2685](ChainSafe/gossamer#2685), [#2673](ChainSafe/gossamer#2673), [#2611](ChainSafe/gossamer#2611), [#2530](ChainSafe/gossamer#2530))

### Polkadot specification

➡️ [Pull requests from qdm12](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12)
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants