Skip to content

Conversation

@xinyuan-dev
Copy link
Contributor

This PR removes the dependency of peer lookup from raptorcast packet builder and postpone the lookup to actual message flushing phase. The change is meant to simplify the packet builder, and further makes it easier to build alternative protocols based on top of the packet builder.

Copilot AI review requested due to automatic review settings January 8, 2026 11:25
@xinyuan-dev xinyuan-dev force-pushed the xinyuan/remove-peer-lookup-from-builder branch from 32cc16a to 4f37955 Compare January 8, 2026 11:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the raptorcast packet builder to defer peer address lookups from the packet building phase to the message flushing phase. The key architectural change is that UdpMessage now stores a Recipient object (containing node identity) rather than a resolved SocketAddr, and address resolution is performed lazily when messages are actually sent.

Key changes:

  • Removed PeerAddrLookup generic parameter from MessageBuilder and PreparedMessageBuilder
  • Changed UdpMessage.dest field to UdpMessage.recipient to defer address resolution
  • Added explicit lifetime annotations to various metrics() methods returning ExecutorMetricsChain<'_>

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
monad-raptorcast/src/packet/builder.rs Removed peer lookup generic parameter and field from MessageBuilder, simplified constructor and PreparedMessageBuilder
monad-raptorcast/src/packet/mod.rs Changed UdpMessage to use Recipient instead of SocketAddr; made PeerAddrLookup public; updated UdpMessageBatcher to perform lookups during push
monad-raptorcast/src/packet/assembler.rs Made Recipient public; removed peer lookup from assemble function; refactored GSO aggregation into standalone AggregatedChunk struct
monad-raptorcast/src/packet/assigner.rs Added explicit lifetime annotations to ChunkAssignment return types
monad-raptorcast/src/lib.rs Updated MessageBuilder instantiation to remove peer_lookup parameter; added tuple and NameRecordLookup PeerAddrLookup implementations
monad-raptorcast/src/udp.rs Updated test to use new MessageBuilder::new signature
monad-raptorcast/src/util.rs Added explicit lifetime annotations to iterator return types
monad-raptorcast/src/decoding.rs Added explicit lifetime annotation to metrics() return type
monad-raptorcast/src/auth/socket.rs Added explicit lifetime annotation to metrics() return type
monad-raptorcast/src/auth/protocol.rs Added explicit lifetime annotation to metrics() trait method and implementations
monad-raptorcast/src/raptorcast_secondary/mod.rs Added explicit lifetime annotation to metrics() return type
monad-wireauth/src/api.rs Added explicit lifetime annotation to metrics() return type
monad-raptor/src/r10/nonsystematic/encoder.rs Added explicit lifetime annotation to Encoder constructor return type

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@xinyuan-dev xinyuan-dev changed the title Raptorcast: remove peer lookup from packet builder Raptorcast: Remove peer lookup from packet builder Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants