lambdaclass / lambdaclass/lambda_ethereum_consensus

[Snappy] Support stream decoding with decoded size limit

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

Nobody has claimed this yet.

Dominant language
Elixir
Stars
109
Forks
41
PR merge metrics
No merged PRs in 30d

Description

The spec says about ssz_snappy's header:

Encoding-dependent header: Req/Resp protocols using the ssz_snappy encoding strategy MUST encode the length of the raw SSZ bytes, encoded as an unsigned protobuf varint.

A block request's response is basically:

[status] [edh] [encoded chunk] [status] [edh] [encoded chunk] [status] ...
edh = encoding-dependent-header

Limiting the size when decoding data that follows the edh would enable us to differentiate chunk ends from stream errors.

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

No file, test, or entry point is named in the issue. Start by locating the ssz_snappy decoding path and its handling of encoding-dependent headers, then inspect existing request/response stream tests; done means decoding can enforce the raw SSZ size from the header and distinguish chunk ends from stream errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.