Repository navigation
fix(network): read the first byte of a wire transaction without a default - #5457
Merged
Merged
Conversation
…ault The wire check of a Transactions message read the type byte with a defaulting accessor, which check-accessors forbids in new code. A match on the first byte now gives the empty case its value explicitly, with the same meaning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Master CI fails in check-accessors since #5454: the wire check of a Transactions message reads the type byte with
Option.getD, a defaulting accessor that new code may not add. This change replaces it with amatchon the first byte, so the empty case gets its value explicitly and the meaning stays the same.The problem
The build job reports
new: Option.getD EthLib.Execution.Network.mayBroadcastWire 1.The baseline of defaulting accessors may only shrink, so extending it is not a fix.
The idea
mayBroadcastWirenow matches on the first byte of a typed transaction.A first byte is a type, and the type decides. An empty byte array has no type byte, so it may go whole, as before.
The proof that the wire form agrees with the transaction drops the two
Optionrewrite lemmas that it no longer needs.Checks
lake build --wfail EthLib EthLib.Proofs EthLib.Exports: passes.lake env .lake/build/bin/check-accessors: passes, 87 entries (86 in the baseline and 1 in the sources).lake env .lake/build/bin/check-decls: 0 findings, 0 new.check_layers.py,check_comment_code.py,soundness_facts.py --check,check_lean_layout.py(base and--all --rule wrap): pass.🤖 Generated with Claude Code