Skip to content

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

Currently there is a hack to ensure that we can fetch RequestIDs from all p2p messages handled by the chain router. We now only expect to be able to get a RequestID from responses (or timeouts). Inbound requests do not require a RequestID.

How this works

Moves checks around.

How this was tested

CI

Need to be documented in RELEASES.md?

@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 15:38
Copy link
Contributor

@Copilot 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 adjusts how RequestID expectations are enforced for inbound messages so that only response messages (or timeouts) require a valid RequestID.

  • Relocates the GetRequestID check in chain_router.go to occur after determining if an operation expects a response.
  • Simplifies GetRequestID in message/fields.go, removing the special-case allowance for AppGossip.

Reviewed Changes

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

File Description
snow/networking/router/chain_router.go Moved GetRequestID validation to after response-op check
message/fields.go Streamlined GetRequestID by dropping special-case for AppGossip
Comments suppressed due to low confidence (2)

snow/networking/router/chain_router.go:287

  • [nitpick] Consider adding unit tests for inbound operations without a RequestID to ensure they are handled correctly now that only response ops enforce this requirement.
requestID, ok := message.GetRequestID(m)

message/fields.go:88

  • The previous comment about AppGossip no longer applies after removing its special-case handling. Update or remove documentation to reflect that all messages now uniformly return false when missing a RequestID.
return 0, false

@StephenButtolph StephenButtolph requested review from a team and yacovm and removed request for a team June 3, 2025 15:48
@StephenButtolph StephenButtolph moved this to In Progress 🏗️ in avalanchego Jun 3, 2025
@StephenButtolph StephenButtolph added this pull request to the merge queue Jun 3, 2025
Merged via the queue into master with commit 664125d Jun 3, 2025
28 checks passed
@StephenButtolph StephenButtolph deleted the remove-request-id-expectation branch June 3, 2025 16:30
@github-project-automation github-project-automation bot moved this from In Progress 🏗️ to Done 🎉 in avalanchego Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants