From 5bd98626e4691e40daca4727ea77d029c65262e2 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 5 Nov 2026 00:27:46 -0500 Subject: [PATCH 1/3] format: correct the resize note about Solidity bytesN --- schemas/pointer/expression.schema.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/schemas/pointer/expression.schema.yaml b/schemas/pointer/expression.schema.yaml index 4c60f717e3..d7b8318dca 100644 --- a/schemas/pointer/expression.schema.yaml +++ b/schemas/pointer/expression.schema.yaml @@ -310,8 +310,9 @@ $defs: as `` but with a number of bytes removed from the left (most significant) side until the bytes width equals ``. - (These cases match the behavior that Solidity uses for resizing its - `bytesN`/`uintN` types.) + (These cases match how Solidity converts between `uintN` types. + Solidity converts between `bytesN` types the other way: it pads and + truncates on the right.) type: object oneOf: - title: Resize to literal number of bytes From d194aff63ac81dd348c53b1aeded0845057e76f9 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 5 Nov 2026 15:37:07 -0500 Subject: [PATCH 2/3] format: add changelog entry for the resize note --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db94c6a773..4f1c22419f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,17 @@ The sections do not signal obligations; the prefixes do. ## Unreleased +### Changed + +- The description of the resize forms (`~sized`, `~wordsized`) said that + their left-side padding and truncation match how Solidity resizes both + `bytesN` and `uintN`. That holds only for `uintN`. Solidity pads and + truncates `bytesN` on the right. The description now says so ([#402]). + - Schemas: **ethdebug/format/pointer/expression** + - Producers: no change needed. The resize forms work as before. Note that + they cannot give a `bytesN` value its Solidity padding. + - Consumers: no change needed. The evaluation rules did not change. + ## 0.1.0-draft.2 — 2026-10-07 ### Changed @@ -720,3 +731,4 @@ First published version of the specification. [#318]: https://github.com/ethdebug/format/pull/318 [#323]: https://github.com/ethdebug/format/pull/323 [#325]: https://github.com/ethdebug/format/pull/325 +[#402]: https://github.com/ethdebug/format/pull/402 From e5c4821bfd0831bbfe3eaca2dc67049cf2697d06 Mon Sep 17 00:00:00 2001 From: "g. nicholas d'andrea" Date: Thu, 5 Nov 2026 15:53:14 -0500 Subject: [PATCH 3/3] format: give the bytesN padding workaround in the changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1c22419f..6a0621ab07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,8 +60,8 @@ The sections do not signal obligations; the prefixes do. `bytesN` and `uintN`. That holds only for `uintN`. Solidity pads and truncates `bytesN` on the right. The description now says so ([#402]). - Schemas: **ethdebug/format/pointer/expression** - - Producers: no change needed. The resize forms work as before. Note that - they cannot give a `bytesN` value its Solidity padding. + - Producers: no change needed. The resize forms work as before. To pad a + `bytesN` value on the right, concatenate it with zero bytes (`~concat`). - Consumers: no change needed. The evaluation rules did not change. ## 0.1.0-draft.2 — 2026-10-07