Skip to content

fix(builder-codes): put the code length after the code in the example suffix - #1906

Open
sktbrd wants to merge 1 commit into
base:masterfrom
sktbrd:fix/builder-code-suffix-byte-order
Open

fix(builder-codes): put the code length after the code in the example suffix#1906
sktbrd wants to merge 1 commit into
base:masterfrom
sktbrd:fix/builder-code-suffix-byte-order

Conversation

@sktbrd

@sktbrd sktbrd commented Sep 1, 2026

Copy link
Copy Markdown

The dataSuffix example in the Builder Codes overview encodes the code length before the code. ox — which this page recommends for generating the suffix — encodes it after, and the Base builder dashboard issues the same order ox produces.

page:  0x07 62617365617070 00 8021…    length first
ox:    0x62617365617070 07 00 8021…    length after the code

Verified with ox@0.14.34:

import * as Attribution from "ox/erc8021/Attribution";
Attribution.toDataSuffix({ codes: ["baseapp"] });
// 0x62617365617070070080218021802180218021802180218021

Same 25 bytes, same 00 id byte, same trailing 8021 magic — only the length byte moves.

Why this one is worth fixing

The wrong order fails quietly. Feeding the current example's ordering to ox's own parser throws nothing and returns a valid-looking result whose code is reversed, which resolves to no registered builder. Transactions index as unattributed, the integrator earns nothing, and no error surfaces anywhere in the stack.

We found it only because we pinned our own suffix byte-for-byte against the value the builder dashboard issued for our code, rather than deriving it from the docs. An integrator who follows the page and trusts a successful transaction would have no signal at all.

Also worth noting for anyone reading the page alongside the spec: ERC-8021 is not merged upstream (ethereum/ERCs #1209 and #1883 are both open), so there is no canonical document to arbitrate between the two orderings. ox and the dashboard agreeing is the strongest available evidence.

… suffix

The `dataSuffix` example encodes the length byte before the code. `ox`, which
this page recommends, encodes it after — and the Base builder dashboard issues
the same order ox produces.

  page:  0x07 62617365617070 00 8021...   length first
  ox:    0x62617365617070 07 00 8021...   length after the code

Verified with ox 0.14.34:

  Attribution.toDataSuffix({ codes: ["baseapp"] })
  // 0x62617365617070070080218021802180218021802180218021

Same 25 bytes, same id byte, same trailing 8021 magic — only the length byte
moves.

Worth fixing because the wrong order fails quietly. Feeding the current example
to ox's own parser throws nothing and returns a valid-looking result whose code
is reversed, resolving to no registered builder: transactions index as
unattributed, the integrator earns nothing, and no error is raised anywhere. We
caught it only by pinning our suffix byte-for-byte against the value our
dashboard issued.
@cb-heimdall

Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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