Nethereum icon indicating copy to clipboard operation
Nethereum copied to clipboard

RPC.Eth: workaround in EthGetCode to allow [] as return value

Open webwarrior-ws opened this issue 3 years ago • 4 comments

Some servers, like nodes.mewapi.io/rpc/eth and www.ethercluster.com/etc, return empty array instead of "0x" for non-contract addresses. Example: {"jsonrpc":"2.0","id":1,"result":[]}. Handle that case and return "0x". In case of non-empty array, throw UnexpectedReplyException.

webwarrior-ws avatar Aug 03 '22 09:08 webwarrior-ws

Shouldn't those servers return the right result instead of the an empty array? This forces the extra check / workaround that you are putting in place, which should not be necessary.

juanfranblanco avatar Aug 03 '22 10:08 juanfranblanco

I sent a message to (MEW) via twitter, lets see what they think.

juanfranblanco avatar Aug 03 '22 12:08 juanfranblanco

Shouldn't those servers return the right result instead of the an empty array? This forces the extra check / workaround that you are putting in place, which should not be necessary.

I agree, talking with our node providers now

kvhnuke avatar Aug 03 '22 16:08 kvhnuke

Hey, this is actually an issue in https://github.com/openrelayxyz/cardinal-evm - which backs both MEW and EtherCluster. We've tagged v1.1.3 with the fix, and will have that out to our production environments in tomorrow's deployment window.

AusIV avatar Aug 03 '22 16:08 AusIV

Seems like the issue has been fixed in the 2 servers mentioned by @webwarrior-ws . This PR can be closed then, thanks!

knocte avatar Aug 16 '22 05:08 knocte