Skip to content

Format ABI byte arrays compactly - #2

Merged
someone235 merged 1 commit into
someone235:abifrom
michaelsutton:compact-abi-bytecode
Aug 28, 2026
Merged

Format ABI byte arrays compactly#2
someone235 merged 1 commit into
someone235:abifrom
michaelsutton:compact-abi-bytecode

Conversation

@michaelsutton

Copy link
Copy Markdown

Context

Pretty JSON currently writes every byte on a separate line. Compiled bytecode therefore makes portable ABI artifacts unnecessarily large and difficult to review.

Change

Mark bytecode and template hashes as byte sequences with serde_bytes.

The Sil JSON formatter now:

  • keeps byte arrays of up to 64 bytes on one line
  • wraps larger byte arrays at 64 bytes per line
  • preserves ordinary array formatting
  • remains a display convention, not a canonical hash encoding

silverc uses the new formatter. Snapshot coverage pins the byte-array boundaries and ordinary-array behavior.

Classify compiled bytecode and template hashes with serde_bytes.

Add project JSON formatting that keeps short byte arrays inline and wraps
larger arrays at 64 bytes per line. Keep ordinary arrays unchanged and use
the formatter for silverc output.
@someone235
someone235 force-pushed the compact-abi-bytecode branch from 85306da to 2f00058 Compare August 28, 2026 20:19
@someone235
someone235 merged commit 8172aaa into someone235:abi Aug 28, 2026
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.

2 participants