Skip to content

Comments

feat: separate trace logs from normal WAL transmission#18

Draft
djm07073 wants to merge 2 commits intomainfrom
feat/trace-separation
Draft

feat: separate trace logs from normal WAL transmission#18
djm07073 wants to merge 2 commits intomainfrom
feat/trace-separation

Conversation

@djm07073
Copy link

@djm07073 djm07073 commented Feb 8, 2026

Summary

Implement trace log separation. Trace logs are stored locally by cosmos-sdk and only sent when consensus failure occurs.

Background

  • Trace logs (_msg: "store trace set") record all KV operations, resulting in large data volume
  • Sending every trace wastes network/storage, so we only send on failure

Changes

  • trace_store.go: Load specific height traces from SDK's range files (trace-{min}-{max}.gz)
  • agent.go: Send/delete traces based on failure_heights in ingest response
  • cleanup.go: Trace file cleanup logic

- Add frame_parser.go for trace/non-trace log separation using byte matching
- Add trace_store.go for height-indexed trace file management
- Modify agent.go for 2-phase transmission (non-trace first, then trace for failures)
- Add trace cleanup loop to manage disk usage
- extractHeight now parses 'height' field from StoreTraceSet JSON
- Uses bytes.Index for fast height extraction without JSON unmarshalling
- Update cleanup.go for range-based trace files
- Add TraceDir config option
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.

1 participant