Skip to content

Update EIP-8142: Various blob encoding-decoding fixes#11763

Open
Thegaram wants to merge 2 commits into
ethereum:masterfrom
Thegaram:fix-eip-8142-update-encoding-decoding
Open

Update EIP-8142: Various blob encoding-decoding fixes#11763
Thegaram wants to merge 2 commits into
ethereum:masterfrom
Thegaram:fix-eip-8142-update-encoding-decoding

Conversation

@Thegaram

@Thegaram Thegaram commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This PR addresses various issues and inconsistencies in the blob encoding/decoding logic in EIP-8142:

  • Fix field element encoding. Ethereum interprets blob bytes as big-endian-encoded field elements (see execution-specs, also blob encoding in ethrex and scroll). So chunk_to_blob should set the first byte of each field element to 0, instead of setting the last byte.
  • Consistent endianness. Use big-endian encoding for bal_length and txs_length in the 8-byte blob payload header.
  • Stricter blob decoding. Cover two error cases in blobs_to_execution_payload_data (array overindexing and malleable trailing data). Though engine_newPayload re-encodes using the canonical zero-padding, so this was not a correctness issue.

@Thegaram Thegaram requested a review from eth-bot as a code owner June 4, 2026 13:44
@github-actions github-actions Bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-core labels Jun 4, 2026
@eth-bot

eth-bot commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

File EIPS/eip-8142.md

Requires 1 more review from Authors: @frisitano, @jsign, @kevaundray, @nerolation, @soispoke

@eth-bot eth-bot added the a-review Waiting on author to review label Jun 4, 2026

@frisitano frisitano left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - left a comment inline

Comment thread EIPS/eip-8142.md Outdated
Comment thread EIPS/eip-8142.md
Comment on lines +249 to +250
bal_length = len(bal_bytes).to_bytes(4, 'big')
txs_length = len(txs_bytes).to_bytes(4, 'big')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that field elements are represented as big-endian - does that mean that we should have all encodings use the same standard? What's the rationale/decision space here and implications?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does that mean that we should have all encodings use the same standard?

No, that's not necessary, this change is optional.

I see value in consistently using big-endian encoding. It is already used for the blob field elements, and for RLP encoding, we might as well use it for these two integers.

I did a quick search in https://github.com/ethereum/execution-specs. It seems that the EL tends to use big-endian in most cases, though there are a few exception.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation - sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-review Waiting on author to review c-update Modifies an existing proposal s-draft This EIP is a Draft t-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants