ethers-provider-flashbots-bundle icon indicating copy to clipboard operation
ethers-provider-flashbots-bundle copied to clipboard

UTF8 Replacement bytes "EFBFBD" in Revert error reason

Open vicnaum opened this issue 3 years ago • 1 comments

Unable to decode the revert error from Simulation (and probably from real txs too).

What I've noticed when I decode the revert string to HEX, is that it contains a lot of "EFBFBD" bytes: image

"EFBFBD" is used as a standard UTF8 replacement bytes if the source byte cannot be encoded into UTF8: https://blog.gdssecurity.com/labs/2015/2/18/when-efbfbd-and-friends-come-knocking-observations-of-byte-a.html

image

As you can see it couldn't encode 9C.

If you replace EFBFBD with any random byte (like "FF") - then you have a proper length ABI-Encoded custom error (with 4 bytes in the beginning, and 32+32 bytes two uints after).

I'm not sure where this replacement happens - on the Ethers side (in fetchJson they use toUTF8 encoding) or on Flashbots Relay side.

But if it happens on Ether's side - maybe we can use another connector?

vicnaum avatar Nov 25 '22 22:11 vicnaum

can confirm I am also facing this issue. Was struggling to understand why that is but this issue seems to be on point of my conclusion as well.

Can we bump this? It's pretty frustrating not being able to get the correct return bytes of a transaction and corrupt the result. Although I am pretty sure that's coming from the backend relay and its not an issue with this package

rori4 avatar Feb 19 '23 16:02 rori4