Skip to content

feat: truncate large hex values in log output#30

Open
samcm wants to merge 1 commit intomasterfrom
feat/log-hex-truncation
Open

feat: truncate large hex values in log output#30
samcm wants to merge 1 commit intomasterfrom
feat/log-hex-truncation

Conversation

@samcm
Copy link
Member

@samcm samcm commented Feb 14, 2026

Summary

  • Truncate hex strings longer than 256 characters in log output (e.g. blob data, large calldata) with a placeholder like 0x1234abcd...ef567890 <131072 bytes>
  • Preserves hashes (66 chars), addresses (42 chars), and KZG commitments/proofs (98 chars)
  • Only affects console log display — module processing (Xatu, metrics) and proxy behavior receive full untruncated data
  • Enabled by default; opt out with --no-truncate / SNOOPER_NO_TRUNCATE=true

Blob data (~128KB per blob) and large calldata make snooper logs
unreadable. Walk the parsed JSON tree before logging and replace any
hex string longer than 256 characters with a truncated placeholder
(e.g. 0x1234abcd...ef567890 <131072 bytes>).

Enabled by default; opt out with --no-truncate / SNOOPER_NO_TRUNCATE.
Only affects console log display — module processing (Xatu, metrics)
and proxy behavior receive full untruncated data.
@samcm samcm requested a review from pk910 as a code owner February 14, 2026 06:48
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