Skip to content

fix: chat-delegate logs full state data at INFO level causing excessive log sizes #73

@sanity

Description

@sanity

Problem

The chat-delegate logs the full value byte array at INFO level on every store request:

// delegates/chat-delegate/src/handlers.rs:18-21
logging::info(
    format!("Delegate received StoreRequest key: {key:?}, value: {value:?}").as_str(),
);

With Debug formatting, a 300KB state becomes a ~1MB log line because each byte prints as [167, 109, 99, ...]. This causes:

  • 25MB+ of logs per hour on active nodes
  • Log lines up to 316KB each
  • Diagnostic reports failing to upload (413 Payload Too Large)

Suggested Fix

Either:

  1. Change to DEBUG level instead of INFO
  2. Truncate the value in the log: value: [{} bytes]
  3. Log only a hash/summary of the value

Example fix:

logging::info(
    format!("Delegate received StoreRequest key: {key:?}, value: [{} bytes]", value.len()).as_str(),
);

Workaround

freenet/freenet-core adds log size limits in diagnostic reports (10KB per line, 2MB total), but the underlying verbosity should still be fixed to reduce disk usage and improve log readability.

[AI-assisted - Claude]

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