Skip to content

Housekeeping: log path, dead code, and informal handshake fields #32

Description

@iTranscend
  1. Hardcoded, relative log file path. The log path is the hardcoded relative string "thala-node.log", writing to the current working directory regardless of --data-dir. A 1.7 MB log file currently sits in the repository root.

  2. Dead code. src/tracing_config.rs is completely empty (0 bytes) — tracing config actually lives in shared/src/tracing.rs. Separately, Node::_task_queue: VecDeque<TaskId> is declared but never read or written; the leading underscore only silences the warning.

  3. Informal message fields on handshake structs. ConnectionReq and ConnectionResp each carry an Option<String> message used only for debug strings like "Sup peer" and "Sup peer at 127.0.0.1:5674". These serve no protocol purpose and waste serialized bandwidth.

Locations

// src/main.rs — hardcoded relative log path
let tracing_config = TracingConfig {
    enable_file_logging: true,
    file_path: Some("thala-node.log".to_string()),
    ...
};

// src/node.rs / src/message.rs — informal message fields
message: Some(format!("Sup peer at {}", peer_addr)),
message: Some("Sup peer".to_string()),

Fix

  • Default the log file path to {data_dir}/thala-node.log, resolved after CLI args are parsed, and add *.log to .gitignore.
  • Delete the empty src/tracing_config.rs (and its mod declaration) and remove the _task_queue field and its initializer.
  • Remove the message field from both handshake structs and all construction sites.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcleanup

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions