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

feat(trie): add empty variant support #2665

Closed
wants to merge 4 commits into from

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Jul 12, 2022

Changes

  • Decode header using variant struct of bits + bit mask
  • Add empty variant header
  • Remove now unneeded encodeRoot (taken care by new variant) - no compatibility change at all
  • (Side change) more readable decode test cases
  • Do not allow header 00000000 when decoding, if v0 is used (blocked by versioning PR)
  • Make sure encoding and decoding new lines are test covered

Note: this blocks addition of other node variants

Tests

go test -count 1  ./internal/trie/... ./lib/trie/...

Issues

#2418

Primary Reviewer

@qdm12 qdm12 mentioned this pull request Jul 12, 2022
14 tasks
@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #2665 (67c79b5) into development (8fd2188) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           development    #2665      +/-   ##
===============================================
+ Coverage        62.96%   62.97%   +0.01%     
===============================================
  Files              211      212       +1     
  Lines            27113    27148      +35     
===============================================
+ Hits             17071    17097      +26     
- Misses            8482     8489       +7     
- Partials          1560     1562       +2     
Flag Coverage Δ
unit-tests 62.97% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
internal/trie/node/decode.go 95.55% <100.00%> (+0.10%) ⬆️
internal/trie/node/encode.go 93.75% <100.00%> (+0.56%) ⬆️
internal/trie/node/header.go 100.00% <100.00%> (ø)
internal/trie/node/variants.go 100.00% <100.00%> (ø)
lib/trie/trie.go 99.36% <100.00%> (-0.01%) ⬇️
lib/babe/verify.go 88.88% <0.00%> (-2.35%) ⬇️
dot/network/utils.go 58.33% <0.00%> (-1.93%) ⬇️
dot/sync/message.go 66.21% <0.00%> (-0.68%) ⬇️
dot/types/babe.go 34.72% <0.00%> (ø)
lib/runtime/wasmer/imports.go 55.43% <0.00%> (+0.17%) ⬆️
... and 2 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 8fd2188...67c79b5. Read the comment docs.

@dimartiro
Copy link
Contributor

Closed in favour of #3295

@dimartiro dimartiro closed this Jun 16, 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.

2 participants