Skip to content

vrank: decode an absent report as an empty one - #1016

Open
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:fix/decode-empty-vrank-report
Open

vrank: decode an absent report as an empty one#1016
hyunsooda wants to merge 1 commit into
kaiachain:devfrom
hyunsooda:fix/decode-empty-vrank-report

Conversation

@hyunsooda

@hyunsooda hyunsooda commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

EncodeReport emits no bytes for an empty report while DecodeReport required a valid RLP list, so the pair did not round-trip and callers had to test the raw header field first. DecodeReport now accepts absent bytes, and both pre-checks are gone.

Types of changes

  • 🐛 Bug fix
  • ✨ Non-hardfork changes (node upgrade not required)
  • 💥 Hardfork / consensus-breaking changes
  • 🧪 Test improvements
  • 🧰 CI / build tool
  • ♻️ Chore / Refactor / Non-functional changes

Checklist

  • 📖 I have read the CONTRIBUTING GUIDELINES doc
  • 📝 I have signed in the PR comment I have read the CLA Document and I hereby sign the CLA in first time contribute after having read CLA
  • 🟢 Lint and unit tests pass locally with my changes ($ make test)

Related issues

Further comments

An empty report stays encoded as absent bytes, which an epoch-start header needs to distinguish a present-but-empty candidate list from absence.

EncodeReport emits no bytes for an empty report while DecodeReport required a
valid RLP list, so the pair did not round-trip and every caller had to test the
raw header field before decoding. DecodeReport now accepts absent bytes, and the
two pre-checks are gone: cfReport decodes directly, and VerifyHeader tests the
decoded report instead, which also skips the candidate lookup for a report
encoded as an explicit empty list.

Constraint: an empty report stays encoded as absent bytes, since an epoch-start header must carry a present-but-possibly-empty candidate list that byte comparison distinguishes from absence
Confidence: high
Scope-risk: narrow

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hyunsooda hyunsooda self-assigned this Aug 5, 2026
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