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

chore(lib/trie): fix generation issues and add more generation test cases #2223

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Jan 21, 2022

Changes

  • Production code fixes: do not update generation when no change is done
  • Production code fix/safety: force new value node to have the current trie generation
  • Modify existing test cases to check generation values

Tests

go test ./internal/trie/... ./lib/trie/...

Issues

Primary Reviewer

@qdm12 qdm12 force-pushed the qdm12-trie-tests-2 branch from f92fd8b to 4681aae Compare January 21, 2022 16:17
@qdm12 qdm12 force-pushed the qdm12-trie-tests-generation branch from 796e577 to c0b3a4e Compare January 21, 2022 18:05
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #2223 (a07f891) into development (656fd8d) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #2223      +/-   ##
===============================================
+ Coverage        60.07%   60.14%   +0.07%     
===============================================
  Files              213      213              
  Lines            27740    27744       +4     
===============================================
+ Hits             16665    16687      +22     
+ Misses            9348     9332      -16     
+ Partials          1727     1725       -2     
Flag Coverage Δ
unit-tests 60.14% <100.00%> (+0.07%) ⬆️

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

Impacted Files Coverage Δ
lib/trie/trie.go 96.32% <100.00%> (+0.02%) ⬆️
dot/network/connmgr.go 89.04% <0.00%> (-1.37%) ⬇️
lib/blocktree/leaves.go 91.66% <0.00%> (-1.20%) ⬇️
dot/network/service.go 55.73% <0.00%> (-0.45%) ⬇️
lib/runtime/wasmer/imports.go 48.71% <0.00%> (+0.05%) ⬆️
lib/blocktree/blocktree.go 55.39% <0.00%> (+1.07%) ⬆️
dot/network/notifications.go 69.28% <0.00%> (+1.36%) ⬆️
dot/network/inbound.go 100.00% <0.00%> (+7.14%) ⬆️
lib/blocktree/node.go 70.80% <0.00%> (+7.29%) ⬆️

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 656fd8d...a07f891. Read the comment docs.

@qdm12 qdm12 force-pushed the qdm12-trie-tests-generation branch from c0b3a4e to c7cdc8f Compare January 21, 2022 21:45
@qdm12 qdm12 force-pushed the qdm12-trie-tests-2 branch 3 times, most recently from 6d9205c to 9c89821 Compare January 27, 2022 20:45
@qdm12 qdm12 force-pushed the qdm12-trie-tests-generation branch from c7cdc8f to 1f19e8d Compare January 27, 2022 21:31
Base automatically changed from qdm12-trie-tests-2 to development January 27, 2022 21:37
@qdm12 qdm12 force-pushed the qdm12-trie-tests-generation branch from 1f19e8d to f5c7037 Compare January 27, 2022 21:40
@qdm12 qdm12 marked this pull request as ready for review January 28, 2022 14:25
@qdm12 qdm12 changed the title chore(lib/trie): Fix generation issues and add more generation tests chore(lib/trie): Fix generation issues and add more generation test cases Jan 28, 2022
@qdm12 qdm12 force-pushed the qdm12-trie-tests-generation branch from f5c7037 to a07f891 Compare January 28, 2022 22:02
@noot noot changed the title chore(lib/trie): Fix generation issues and add more generation test cases chore(lib/trie): fix generation issues and add more generation test cases Jan 31, 2022
@noot noot merged commit 479ef1b into development Jan 31, 2022
@noot noot deleted the qdm12-trie-tests-generation branch January 31, 2022 16:03
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)
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