chore(trie): refactor existing header encoding#2530
Merged
qdm12 merged 9 commits intodevelopmentfrom Jul 4, 2022
Merged
Conversation
257277e to
56069ef
Compare
bfb210f to
affc826
Compare
Codecov Report
@@ Coverage Diff @@
## development #2530 +/- ##
===============================================
- Coverage 61.98% 61.94% -0.05%
===============================================
Files 215 215
Lines 28450 28485 +35
===============================================
+ Hits 17636 17644 +8
- Misses 9064 9087 +23
- Partials 1750 1754 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
56069ef to
7312da8
Compare
bd11034 to
03ba959
Compare
6 tasks
cac4740 to
f8864a7
Compare
ae17eb0 to
a509c65
Compare
f8864a7 to
fcb9ae2
Compare
EclesioMeloJunior
requested changes
Jun 7, 2022
03895a5 to
37c3d46
Compare
2fd8ea9 to
d49a53d
Compare
EclesioMeloJunior
approved these changes
Jun 16, 2022
9d788fc to
8b029e3
Compare
8b029e3 to
acc6f90
Compare
- Remove `encode_doc.go` - Add `README.md` with Codec section - Update comments for `Encode` and `Decode` methods - Add `node` package comment
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
acc6f90 to
a7d7c14
Compare
timwu20
reviewed
Jun 29, 2022
timwu20
approved these changes
Jun 29, 2022
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)
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
TLDR: Match more closely the polkadot spec documentation in the code, to allow further changes for new node variants. This doesn't add new node variants yet, this is coming in the next PR.
encodeHeaderencodes the first header byte + extra partial key length bytes instead of the convoluted/not-modularencodeHeader+encodeKeyLengthdecodeHeaderfunction to get variant + partial key length, instead of convoluted in-line header code inDecode+ further header decoding indecodeLeafanddecodeBranchdecodeKeymaximum check for last bytedecodeKeymaximum check to accept maximum value6553565535uint16forpartialKeyLengthTests
go test lib/trie/... internal/trie/...Issues
Primary Reviewer
@EclesioMeloJunior