5afe / safe-react

Deprecated! New repo – https://github.com/safe-global/web-core
MIT License
332 stars 363 forks source link

`safeTxGas` estimation fails with non-Geth nodes #1515

Closed rmeissner closed 4 years ago

rmeissner commented 4 years ago

Title/Description

Estimating the safeTxGas for a Safe transaction fails with non-Geth nodes

Steps to reproduce

Create a transaction with an RPC that uses not a Geth node (e.g. on xDai basically all nodes are OpenEthereum / Nethermind)

Expected result

safeTxGas should be > 0 for valid transactions

Obtained result

safeTxGas is 0 and an error is logged

Screenshots

image

Misc

rmeissner commented 4 years ago

Apparently this is related to the rpc endpoint. https://rpc.xdaichain.com/ was used and this endpoint uses Nethermind which has a different error format then OpenEthereum and Geth.

web3_clientVersion : Nethermind/v1.9.13-0-72dba6574-20201019/X64-Linux/Core3.1.9

Payload for testing with a POST request (e.g. via Postman):

rmeissner commented 4 years ago

To test behaviour with an OpenEthereum node the https://dai.poa.network can be used.

rmeissner commented 4 years ago

Another reason might be that the batched request throws when used via metamask (as the screenshot, shows an MM error before). Maybe @mikheevm has more info.

rmeissner commented 4 years ago

@alfetopito identified the issue: It's failing on the estimateData call https://github.com/gnosis/safe-react/blob/8efafc1aaa83d731c46048648829002d0079e45c/src/logic/safe/transactions/gasNew.ts#L110-L114

alfetopito commented 4 years ago

I just checked and seems to not be working yet.

Tried with MM on xDai with both endpoints (from https://www.xdaichain.com/for-developers/developer-resources#json-rpc-endpoints):

I also tried with Nifty wallet (POA wallet) with similar results.

Same thing for Rinkeby with openethereum node. Working fine for geth endpoint.

I get the regular console errors for the gas estimation, but the value sent to the wallet is way under the needed amount (on MM 400k and 1.2m on Nifty vs ~5m required).

Results per wallet/network:

Nifty - Chrome

screenshot_2020-11-02_10-06-58 screenshot_2020-11-02_10-07-29

screenshot_2020-11-02_10-08-33 screenshot_2020-11-02_10-08-45

MM xDai https://dai.poa.network - Firefox

screenshot_2020-11-02_10-12-50 https://dashboard.tenderly.co/tx/xdai/0x4f4396cdf7d7e3987e701735903c8565d9ecba579d1f65981930ad1e2425a7fe/gas-usage

MM xDai https://rpc.xdaichain.com - Firefox

screenshot_2020-11-02_10-15-47 https://dashboard.tenderly.co/tx/xdai/0x95212479b24b3608b27fcf8d5da5c87b1d793dfb628fcb04e64c4e39dd96051f/gas-usage

MM Rinkeby https://staging-openethereum-tracing.rinkeby.gnosisdev.com/ - Firefox

screenshot_2020-11-02_10-36-48

https://dashboard.tenderly.co/tx/rinkeby/0x2b959475eb69eb31ef4db383eded4cc510d7f5cf24dc01d0752625d91e2a2ef9/gas-usage

MM Rinkeby regular endpoint (geth) - Firefox

No errors https://dashboard.tenderly.co/tx/rinkeby/0x6d950ca0abd1f0ff07158509d6e64baf21b099d49f847b569cc2816012c14dc2/gas-usage

hexyls commented 4 years ago

@dasanra This is still an issue, please see the error below:

Screen Shot 2020-11-17 at 11 18 54 am