vacp2p / nim-libp2p

libp2p implementation in Nim
https://vacp2p.github.io/nim-libp2p/docs/
MIT License
242 stars 52 forks source link

add `{.async: (raises).}` to `libp2p/stream` modules #1050

Closed etan-status closed 4 months ago

etan-status commented 4 months ago

Annotate stream modules with {.async: (raises).} to simplify exception handling.

All modules need to be updated atomically, otherwise the method mechanism does not find overrides anymore. Also, because close functions have a tendency to start writing RST packets and reading EOF packets, close and read/write need to be done together.

Higher modules have not been touched unless necessary, e.g., to remain compatible when plugging in callbacks.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 83.92371% with 59 lines in your changes are missing coverage. Please review.

Project coverage is 82.76%. Comparing base (8294d5b) to head (393ae49).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050/graphs/tree.svg?width=650&height=150&src=pr&token=UR5JRQ249W&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) ```diff @@ Coverage Diff @@ ## unstable #1050 +/- ## ============================================ + Coverage 82.73% 82.76% +0.03% ============================================ Files 91 91 Lines 15586 15666 +80 ============================================ + Hits 12895 12966 +71 - Misses 2691 2700 +9 ``` | [Files](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | Coverage Δ | | |---|---|---| | [libp2p/muxers/mplex/coder.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL211eGVycy9tcGxleC9jb2Rlci5uaW0=) | `92.68% <100.00%> (+2.93%)` | :arrow_up: | | [libp2p/protocols/connectivity/relay/rconn.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9jb25uZWN0aXZpdHkvcmVsYXkvcmNvbm4ubmlt) | `97.36% <100.00%> (-2.64%)` | :arrow_down: | | [libp2p/transports/wstransport.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3RyYW5zcG9ydHMvd3N0cmFuc3BvcnQubmlt) | `84.97% <93.33%> (+1.06%)` | :arrow_up: | | [libp2p/upgrademngrs/muxedupgrade.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3VwZ3JhZGVtbmdycy9tdXhlZHVwZ3JhZGUubmlt) | `85.24% <88.88%> (+1.37%)` | :arrow_up: | | [libp2p/muxers/mplex/lpchannel.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL211eGVycy9tcGxleC9scGNoYW5uZWwubmlt) | `82.60% <93.33%> (+0.74%)` | :arrow_up: | | [libp2p/protocols/secure/noise.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvbm9pc2Uubmlt) | `90.09% <83.33%> (+0.43%)` | :arrow_up: | | [libp2p/stream/bufferstream.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3N0cmVhbS9idWZmZXJzdHJlYW0ubmlt) | `93.84% <88.88%> (+4.69%)` | :arrow_up: | | [libp2p/stream/connection.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3N0cmVhbS9jb25uZWN0aW9uLm5pbQ==) | `91.13% <90.90%> (+1.95%)` | :arrow_up: | | [libp2p/stream/chronosstream.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3N0cmVhbS9jaHJvbm9zc3RyZWFtLm5pbQ==) | `84.46% <86.95%> (+1.13%)` | :arrow_up: | | [libp2p/protocols/secure/secure.nim](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im#diff-bGlicDJwL3Byb3RvY29scy9zZWN1cmUvc2VjdXJlLm5pbQ==) | `72.13% <80.00%> (-0.60%)` | :arrow_down: | | ... and [5 more](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im) | | ... and [14 files with indirect coverage changes](https://app.codecov.io/gh/status-im/nim-libp2p/pull/1050/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=status-im)
etan-status commented 4 months ago
dryajov commented 4 months ago

Bumping to latest master with the GitHub update seems to break it.

etan-status commented 3 months ago