Skip to content

core/stateless: fix witness RLP backward compat with WIT/0 peers#2068

Merged
cffls merged 2 commits intomasterfrom
fix_witness
Feb 19, 2026
Merged

core/stateless: fix witness RLP backward compat with WIT/0 peers#2068
cffls merged 2 commits intomasterfrom
fix_witness

Conversation

@cffls
Copy link
Copy Markdown
Contributor

@cffls cffls commented Feb 19, 2026

Nodes upgraded from WIT/0 to WIT/1 were incorrectly jailing WIT/0 peers with "rlp: too few elements for stateless.ExtWitness". A 5-field ExtWitness encoding (Context, Headers, Codes, State, Keys) was accidentally introduced during an upstream geth merge, replacing the original 3-field wire format (Context, Headers, State) that WIT/0 peers still use.

Introduce BorWitness as the canonical 3-field wire format. EncodeRLP now encodes using BorWitness (State only, codes excluded). DecodeRLP tries BorWitness first and falls back to ExtWitness for backward compatibility with peers that temporarily ran the extended encoding.

ExtWitness is retained as the representation for the JSON debug API (ExecutionWitness, ExecutionWitnessByHash) and as the fallback decode target for the transitional period.

Nodes upgraded from WIT/0 to WIT/1 were incorrectly jailing WIT/0 peers
with "rlp: too few elements for stateless.ExtWitness". A 5-field
ExtWitness encoding (Context, Headers, Codes, State, Keys) was
accidentally introduced during an upstream geth merge, replacing the
original 3-field wire format (Context, Headers, State) that WIT/0 peers
still use.

Introduce BorWitness as the canonical 3-field wire format. EncodeRLP now
encodes using BorWitness (State only, codes excluded). DecodeRLP tries
BorWitness first and falls back to ExtWitness for backward compatibility
with peers that temporarily ran the extended encoding.

ExtWitness is retained as the representation for the JSON debug API
(ExecutionWitness, ExecutionWitnessByHash) and as the fallback decode
target for the transitional period.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
12.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.61%. Comparing base (6f2d79b) to head (00920dd).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
core/stateless/encoding.go 85.18% 2 Missing and 2 partials ⚠️

❌ Your patch status has failed because the patch coverage (85.18%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2068      +/-   ##
==========================================
+ Coverage   49.60%   49.61%   +0.01%     
==========================================
  Files         873      873              
  Lines      150616   150641      +25     
==========================================
+ Hits        74715    74746      +31     
+ Misses      70841    70834       -7     
- Partials     5060     5061       +1     
Files with missing lines Coverage Δ
core/stateless/encoding.go 63.49% <85.18%> (+63.49%) ⬆️

... and 14 files with indirect coverage changes

Files with missing lines Coverage Δ
core/stateless/encoding.go 63.49% <85.18%> (+63.49%) ⬆️

... and 14 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Member

@kamuikatsurgi kamuikatsurgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nits

@cffls cffls merged commit 6b0405c into master Feb 19, 2026
42 of 44 checks passed
@kamuikatsurgi kamuikatsurgi deleted the fix_witness branch February 19, 2026 07:09
manav2401 added a commit that referenced this pull request Feb 20, 2026
…) (#2072)

* core/stateless: fix witness RLP backward compat with WIT/0 peers

Nodes upgraded from WIT/0 to WIT/1 were incorrectly jailing WIT/0 peers
with "rlp: too few elements for stateless.ExtWitness". A 5-field
ExtWitness encoding (Context, Headers, Codes, State, Keys) was
accidentally introduced during an upstream geth merge, replacing the
original 3-field wire format (Context, Headers, State) that WIT/0 peers
still use.

Introduce BorWitness as the canonical 3-field wire format. EncodeRLP now
encodes using BorWitness (State only, codes excluded). DecodeRLP tries
BorWitness first and falls back to ExtWitness for backward compatibility
with peers that temporarily ran the extended encoding.

ExtWitness is retained as the representation for the JSON debug API
(ExecutionWitness, ExecutionWitnessByHash) and as the fallback decode
target for the transitional period.

* Add test

Co-authored-by: Jerry <jerrycgh@gmail.com>
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.

4 participants