Skip to content

Commit

Permalink
fix: null bytes in trace.error and trace.revertReason (#1426)
Browse files Browse the repository at this point in the history
* null bytes for traces

* chore: changeset

* Update tricky-bees-switch.md
  • Loading branch information
kyscott18 authored Jan 9, 2025
1 parent b09c37f commit bd52302
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-bees-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ponder": patch
---

Fixed a bug with traces containing invalid byte sequences.
6 changes: 4 additions & 2 deletions packages/core/src/sync-store/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ export function encodeTrace({
input: trace.input,
functionSelector: trace.input.slice(0, 10) as Hex,
output: trace.output ?? null,
revertReason: trace.revertReason ?? null,
error: trace.error ?? null,
revertReason: trace.revertReason
? trace.revertReason.replace(/\0/g, "")
: null,
error: trace.error ? trace.error.replace(/\0/g, "") : null,
value: trace.value ? hexToBigInt(trace.value) : null,
index: trace.index,
subcalls: trace.subcalls,
Expand Down

0 comments on commit bd52302

Please sign in to comment.