Repository navigation
fix(multiformats): give the byte decoders the code check of the model - #116
Open
IvanAnishchuk wants to merge 1 commit into
Open
IvanAnishchuk wants to merge 1 commit into
IvanAnishchuk wants to merge 1 commit into
Conversation
The model decoders of a multiaddr component, a multihash, and a CID refuse a registry member whose own code differs from the code on the wire. The ByteArray decoders took the member and skipped that comparison, so the two paths agreed only through a property of the generated table that nothing proves. ComponentWire.decodeAtB?, Multihash.decodeAtB?, and Cid.decodeAtB? now make the same comparison, with the same error as the model. The generated table maps each code by exact equality, so no input reaches the new branch today, and no check can drive it. Closes etheorem#109.
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.
Summary
Closes #109. The
ByteArraydecoders of a multiaddr component, a multihash, and a CID now refuse a registry member whose own code differs from the code on the wire. The model decoders already made that check.What changed
ComponentWire.decodeAtB?,Multihash.decodeAtB?, andCid.decodeAtB?make the same comparison as their models, with the same error.Test plan
lake build(every package, on the pinned toolchain) is green.lake testpasses, and passes again under+RTS -N1.property test, and with a test for its length cap.
and the description names the spec section the change follows.
(PLAN W5.9) is green.
Run locally on Linux with
lake build --wfailand every executable: 28205 checks passed, 0 failed, 4 skipped, on two threads and again withLEAN_NUM_THREADS=1. The existing property tests that pin eachByteArraydecoder to its model still pass, and so do the captured vectors. No input decodes differently, so the wire box does not apply.Risk / trust footprint
none
Notes for reviewers
No new check comes with this. The generated table maps each code by exact equality, so no input reaches the new branch today. The change makes the production path state the rule itself, so it no longer depends on how the table is built.
LICENSE (LGPL version 3)