paritytech / paritytech/trie

Guard against branch with one child and no value

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
274
Forks
72
PR merge metrics
No merged PRs in 30d

Description

When decoding nodes we should not allow branch with one child and no value.
This change requires changing the codec trait to allow the compact proof decoding in trie-db/src/proof/verify.rs (internally this proof can skip the value).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with trie-db/src/proof/verify.rs and trace the codec trait used for compact proof decoding. Check how branch nodes are decoded, then ensure a branch with one child and no value is rejected without preventing compact proofs from skipping the value. Done means invalid branches are guarded while valid compact proof decoding still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.