Skip to content

Avoid formatting complete MessagePayload values in transport error logs #669

Description

@RyanKung

Problem

crates/core/src/swarm/transport.rs logs the complete MessagePayload when rejecting an oversized message:

tracing::error!("Message is too large: {:?}", payload);

Payloads can contain application data, transaction and relay metadata. Logging the complete structure is unnecessarily risky for deployments that treat transport/application contents as sensitive.

Proposed direction

Log only diagnostic metadata required to investigate the failure: encoded size, configured limit, transaction ID (if appropriate), message kind, and non-sensitive routing identifiers. Do not format message bodies, ciphertext, or arbitrary custom-message bytes.

Acceptance criteria

  • The oversized-message log path does not serialize or debug-format the full payload.
  • The replacement log retains size/limit and a safe correlation identifier.
  • Add a test or logging-focused regression check that sensitive custom-message content is absent from the emitted diagnostic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions