Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting errors on ETH-like networks #1251

Closed
FrederikBolding opened this issue Jan 23, 2021 · 9 comments
Closed

Formatting errors on ETH-like networks #1251

FrederikBolding opened this issue Jan 23, 2021 · 9 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@FrederikBolding
Copy link

We've been having an issue with fetching transaction receipts on ETH-like networks for the new version of MyCrypto. The problem occurs because networks like RSK return an invalid root for transaction receipts which isn't a valid hash. (There may be other such formatting errors on other networks)

The error in question:
invalid hash (arg="hash", value="0x01", version=4.0.48)

Would it be possible to have settings for looser formatting requirements to use ethers.js with more networks? For our use-case we don't necessarily always care that the receipt upholds the entire formatting requirement.

Thanks for building such a great library! ❤️

@zemse
Copy link
Collaborator

zemse commented Jan 24, 2021

Maybe you can use raw rpc as a work around.

// raw rpc result (unformatted)
const result = await provider.send('eth_getTransactionReceipt', ['0xYourTxHash']);

@FrederikBolding
Copy link
Author

For now we've ended up doing a hack described here: rsksmart/rskj#1328 (comment)

Our implementation of that is here:
https://github.com/MyCryptoHQ/MyCrypto/blob/master/src/services/EthService/network/providerHandler.ts#L115-L118

Would however prefer that this was handled by ethers 😄

@ricmoo
Copy link
Member

ricmoo commented Feb 1, 2021

Can you provide a JSON-RPC url and a transaction hash used to reproduce this?

My guess is this is related to #952, but I haven't been able to reproduce it. I think it is caused by a non-Ethereum network incorrectly implementing EIP-658, but it is something I can adjust for, if I can reproduce it.

Also, you are using a very old version of ethers, you should try updating to a more recent version (although I do not expect that to solve this issue) since I won't port this change back to v4, it would only be available in v5 anyways. :)

Thanks in advance! :)

@ricmoo ricmoo added enhancement New feature or improvement. investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Feb 1, 2021
@bguiz
Copy link

bguiz commented Feb 1, 2021

My guess is this is related to #952, but I haven't been able to reproduce it.

Yes, this does indeed look like the same/ similar error I've been running into.

See: #952 (comment)

@FrederikBolding
Copy link
Author

Can you provide a JSON-RPC url and a transaction hash used to reproduce this?

My guess is this is related to #952, but I haven't been able to reproduce it. I think it is caused by a non-Ethereum network incorrectly implementing EIP-658, but it is something I can adjust for, if I can reproduce it.

Also, you are using a very old version of ethers, you should try updating to a more recent version (although I do not expect that to solve this issue) since I won't port this change back to v4, it would only be available in v5 anyways. :)

Thanks in advance! :)

We bumped Ethers to v5 recently, so that shouldn't be an issue 👍

You can try using eth_getTransactionReceipt on 0x1eb618c304116932b643daefdd85ee35dbab6192f4d8c5cde2a15cf8bf90c58e via this node: mycrypto.rsk.co. That is how I reproduced it initially.

@ricmoo
Copy link
Member

ricmoo commented Feb 1, 2021

I've updated the (closed) issue on RSK. If someone knows the right person to bug to re-open, please go ahead and do that.

I've added logic locally that correct this. I'm just testing it out right now.

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Feb 1, 2021
@ricmoo
Copy link
Member

ricmoo commented Feb 1, 2021

This should be addressed in 5.0.27. Please try it out and let me know if you still have any issues.

Thanks! :)

@FrederikBolding
Copy link
Author

FrederikBolding commented Feb 2, 2021

Looks to be working! I will be bumping our version and removing the hack that we used. I'll report back if we see any further issues! Thanks for the fast response!

@ricmoo
Copy link
Member

ricmoo commented Feb 5, 2021

Awesome!

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

4 participants