chore(cbind): nim-ffi migration [4/9] — streams & custom protocols (+ echo example)#2775
Draft
gmelodie wants to merge 4 commits into
Draft
chore(cbind): nim-ffi migration [4/9] — streams & custom protocols (+ echo example)#2775gmelodie wants to merge 4 commits into
gmelodie wants to merge 4 commits into
Conversation
This was referenced Jul 7, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## chore/cbind/ffi/03-connectivity #2775 +/- ##
==================================================================
Coverage ? 81.15%
==================================================================
Files ? 170
Lines ? 31027
Branches ? 12
==================================================================
Hits ? 25180
Misses ? 5847
Partials ? 0 🚀 New features to boost your workflow:
|
2 tasks
vladopajic
approved these changes
Jul 7, 2026
543a063 to
021033a
Compare
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.
nim-ffi cbind migration — PR train
Part 4 of a 9-PR train that replaces the hand-rolled
cbind/C bindings with the generated nim-ffi codegen, landing it domain by domain so each PR stays reviewable and CI-green (build the FFI lib + generate bindings + build/run examples).Targets
chore/cbind/ffi/03-connectivity(stacked).This PR adds
streamIdhandles:readExactly,readLp,write,writeLp,close,closeWithEof,release.libp2pMountProtocol+ theonIncomingStream{.ffiEvent.}, plus the fullStreamRegistryrelease-waiter logic that keeps custom-protocol handlers alive across the FFI boundary.validateReadLengthhardening — rejects negative lengths, theMaxReadBytesceiling, and values that would narrow-overflow a 32-bitint(matters for linux-i386 CI).common.h,CMakeLists.txt,README.md,.clang-format, updatedMakefile, and theexamplesnimble task.clang-formatlinter step (the C files it guarded are rewritten here).Review artifact: Header diff shows the stream/protocol entry points and the incoming-stream event.