safe-global / safe-eth-py

Safe-eth-py includes a set of libraries to work with Ethereum and relevant Ethereum projects
https://safe-eth-py.readthedocs.io/en/latest/quickstart.html
MIT License
166 stars 175 forks source link

Failing prediction of address for Chiado #541

Closed JacqueGM closed 1 year ago

JacqueGM commented 1 year ago

While using this package to work with the testnet chiado, we faced an issue regarding the prediction of the address.. After debuging locally we realise that the eth_estimateGas calls fails for Chiado while the same call for Gnosis works.

curl https://rpc.chiadochain.net \        
  -X POST \     
  -H "Content-Type: application/json" \
  --data '{"method":"eth_estimateGas","params":[  {"to": "0x66c0FE88C2Aef9DE75CB725E8bCCE61891DF4393","value": "1"}],"id":1,"jsonrpc":"2.0"}'
 curl https://rpc.gnosischain.com/ \       
  -X POST \     
  -H "Content-Type: application/json" \
  --data '{"method":"eth_estimateGas","params":[  {"to": "0x450Fc3eAc8b847a759Cb05790cE7A1f465ac0cE8","value": "1"}],"id":1,"jsonrpc":"2.0"}'

If we change the value from 1 to 0 then it retunds and address. This values come directly from the line below.

https://github.com/safe-global/safe-eth-py/blob/2fcf1eca51f25a16924521f23bb17bce6125b5f3/gnosis/safe/safe_create2_tx.py#L251

Can you help us to understand the different behaivour for both chains towards the same call? and wether is possible to hardcode that value to 0. From what we tried this doesnt seem to affect the address prediction for gnosis.

Uxio0 commented 1 year ago

You are posting a direct call to the RPC so there's nothing to do with this library. I will let Gnosis team about this

JacqueGM commented 1 year ago

that's the call that the code does, that's why I put it as an exampleso if we change the value in safe_create2_tx the transactions changes and it can get executed... @Uxio0

Uxio0 commented 1 year ago

Still, it needs to be fixed on the RPC side.

If you run

curl https://rpc.chiadochain.net/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_estimateGas","params":[{"to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293000","value":"0x1"}],"id":1,"jsonrpc":"2.0"}'

You get an insufficient funds error, and that doesn't happen in any other network. I recall we used payment: 1 at that point to prevent this kind of issues, so I won't remove for a concrete case for a RPC misbehaving

JacqueGM commented 1 year ago

got it - who can I ask to address this issue? we send it to some people in gnosis but not response so far...

Uxio0 commented 1 year ago

You can open issues here: https://github.com/gnosischain/issues/issues

Also the issue was reported on: https://github.com/NethermindEth/nethermind/issues/4197