Skip to content

feat(proto): expand qlog support#181

Merged
Frando merged 15 commits intomain-irohfrom
Frando/qlog-qnt
Dec 2, 2025
Merged

feat(proto): expand qlog support#181
Frando merged 15 commits intomain-irohfrom
Frando/qlog-qnt

Conversation

@Frando
Copy link
Member

@Frando Frando commented Nov 23, 2025

This expands the qlog support:

  • Allow to set the vantage point for qlog traces
  • Record frames for received packets
  • Record frames for sent packets
  • Record ConnectionStarted event

@Frando Frando changed the title feat: expand qlog support (on top of protocol-simplifications) feat: Expand qlog support (on top of protocol-simplifications) Nov 23, 2025
@n0bot n0bot bot added this to iroh Nov 23, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Nov 23, 2025
@Frando Frando changed the title feat: Expand qlog support (on top of protocol-simplifications) feat: Expand qlog support Nov 25, 2025
Copy link
Collaborator

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks great, but let's add good doc comments. Even for internal APIs.

The other main comment is that the qlog module is cfg-disabling all the bodies of functions so that the callsites don't have to have cfg everywhere. I think you should continue that style for the newly added methods. That would get rid of a lot of cfg lines.

}

stream.emit_event(orig_rem_cid, EventData::PacketReceived(event), now);
#[cfg(feature = "qlog")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the philosophy of this module is to keep all/most the cfgs inside the function bodies. That way the call sites are not littered with cfgs. And the compiler is expected to optimise out the noop function calls. So you probably should follow the same pattern for these new impls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, maybe. For QlogRecvPacket it's straightforward, will change. I kept the cfg initially for QlogSentPacket::frame, which takes a qlog::QuicFrame. Constructing this from the raw data sometimes involves calculations, so to make sure to not do these when qlog is disabled I made the fn be configured out in that case. Maybe I just keep the cfg for that one only.

Base automatically changed from protocol-simplification to main-iroh December 1, 2025 11:33
feat: add ConnectionStarted to qlog

feat: track received packets in qlog

fix: cid groups, padding size, cleanups

fixup vantage_point method signature

chore: clippy
@Frando Frando requested a review from flub December 2, 2025 09:35
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 84.30584% with 78 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.68%. Comparing base (cb60f6d) to head (145ba10).

Files with missing lines Patch % Lines
quinn-proto/src/connection/qlog.rs 83.39% 46 Missing ⚠️
quinn-proto/src/config/transport.rs 0.00% 16 Missing ⚠️
quinn-proto/src/connection/mod.rs 89.18% 16 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##           main-iroh     #181      +/-   ##
=============================================
+ Coverage      76.38%   76.68%   +0.30%     
=============================================
  Files             83       83              
  Lines          22286    22663     +377     
=============================================
+ Hits           17023    17379     +356     
- Misses          5263     5284      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Frando Frando enabled auto-merge December 2, 2025 12:31
@dignifiedquire dignifiedquire changed the title feat: Expand qlog support feat(proto): expand qlog support Dec 2, 2025
@Frando Frando disabled auto-merge December 2, 2025 12:45
## Description

Based on #179 

This moves the QuicFrame generation into the `qlog` module. The public
interface for recording frames in sent packets now either takes a
`crate::Frame`, or for frame types where constructing such a frame would
have a cost, there's a specialized method on the `QlogSentPacket`.

This keeps the mapping between frames and `qlog::QuicFrame` localized
instead of spread out through the crate, and will make it much easier to
add support for more frames.

## Breaking Changes

<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->
@Frando Frando enabled auto-merge December 2, 2025 14:08
@Frando Frando added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main-iroh with commit 2380578 Dec 2, 2025
27 of 28 checks passed
@Frando Frando deleted the Frando/qlog-qnt branch December 2, 2025 14:29
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants