diff --git a/.changeset/tricky-bees-switch.md b/.changeset/tricky-bees-switch.md new file mode 100644 index 000000000..685770cb0 --- /dev/null +++ b/.changeset/tricky-bees-switch.md @@ -0,0 +1,5 @@ +--- +"ponder": patch +--- + +Fixed a bug with traces containing invalid byte sequences. diff --git a/packages/core/src/sync-store/encoding.ts b/packages/core/src/sync-store/encoding.ts index d18e3d03f..69307db40 100644 --- a/packages/core/src/sync-store/encoding.ts +++ b/packages/core/src/sync-store/encoding.ts @@ -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,