Skip to content

fix: ReceiptsRoot encoding#15

Closed
dudong2 wants to merge 2 commits intobasechain/develop-v1.13.14from
fix/receiptsroot-encoding
Closed

fix: ReceiptsRoot encoding#15
dudong2 wants to merge 2 commits intobasechain/develop-v1.13.14from
fix/receiptsroot-encoding

Conversation

@dudong2
Copy link
Member

@dudong2 dudong2 commented May 16, 2025

Description

tl;dr

Currently, EmitReceiptsRootEvent emits receiptsRoot as string(receiptsRoot.Bytes()), which may contain non-UTF-8 characters and result in unreadable or invalid output.
This PR changes the emission to use receiptsRoot.Hex() instead, which is UTF-8 safe and human-readable.

Problem

  • string(receiptsRoot.Bytes()) can include invalid UTF-8 bytes (e.g. 0x00, 0x80–0xFF)
  • This leads to:
    • Escaped or malformed data in RPC responses
    • Inconsistent hash reconstruction in clients

FIx

sdk.NewAttribute(types.AttributeKeyEthereumReceiptsRoot, receiptsRoot.Hex())

Impact

  • Safer and cleaner receiptsRoot in events
  • No behavioral change — only improves compatibility with RPC consumers

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

dudong2 added 2 commits April 18, 2025 13:53
* feat: eip-1153 (Transient storage)

* feat: eip-5656 (MCOPY opcode)

* feat: eip-4844 (BLOBHASH opcode)

* feat: eip-7516 (BLOBBASEFEE opcode)

* chore: update go.mod

* test: add opcodes tests

* chore: fix comments

* test: comment out failed test
@dudong2 dudong2 deleted the branch basechain/develop-v1.13.14 May 16, 2025 07:41
@dudong2 dudong2 closed this May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant