tahowallet / extension

Taho, the community owned and operated Web3 wallet.
https://taho.xyz
GNU General Public License v3.0
3.11k stars 394 forks source link

Gnosis Safe creation transaction fails to broadcast #2127

Open brandoncurtis opened 2 years ago

brandoncurtis commented 2 years ago

Discord Discussion Link

No response

What browsers are you seeing the problem on?

Chrome

What were you trying to do?

Deploy a new Gnosis Safe using the gnosis-safe.io UI and Ledger Nano X.

What did not work?

The Safe creation transaction repeatedly fails to broadcast.

Fails whether or not I change the fee rate from the default.

Based on the displayed fee on the Ledger and the errors in the logs, I believe this is a problem in fee calculation resulting in an insufficient fee.

Version

v0.15.0

Relevant log output

SerialFallbackProvider.send
Skipping fallback for unidentified error,{"code":-32000,"response":"{\"jsonrpc\":\"2.0\",\"id\":17345,\"error\":{\"code\":-32000,\"message\":\"err: max fee per gas less than block base fee: address [REDACTED] maxFeePerGas: 8000000000 baseFee: 16715458487 (supplied gas 272084)\"}}"},for provider,{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"[REDACTED]
    at SerialFallbackProvider.send (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:58321:24) 

SerialFallbackProvider.send
Skipping fallback for unidentified error,{"code":-32000,"response":"{\"jsonrpc\":\"2.0\",\"id\":17362,\"error\":{\"code\":-32000,\"message\":\"err: max fee per gas less than block base fee: address [REDACTED] maxFeePerGas: 8000000000 baseFee: 17221112807 (supplied gas 272084)\"}}"},for provider,{"_isProvider":true,"_events":[],"_emitted":{"block":-2},"formatter":{"formats":{"transaction":{},"transactionRequest":{},"receiptLog":{},"receipt":{},"block":{},"blockWithTransactions":{},"filter":{},"filterLog":{}}},"anyNetwork":false,"_network":{"name":"homestead","chainId":1,"ensAddress":"[REDACTED]
    at SerialFallbackProvider.send (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:58321:24) 

ChainService.populateEVMTransactionNonce
Got chain nonce,8,existing nonce,17,using,18
    at ChainService.populateEVMTransactionNonce (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:59109:22),    at async SigningService.signTransaction (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:71260:40),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:73745:47,    at async Promise.all (index 0),    at async Emittery.emit (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:6698:11),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:72486:9,    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:63016:20 

ChainService.broadcastSignedTransaction
Error broadcasting transaction,[object Object],{"reason":"invalid BigNumber value","code":"INVALID_ARGUMENT","argument":"value","value":null}
    at ChainService.broadcastSignedTransaction (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:59248:24),    at chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62824:39,    at async ProviderBridgeService.routeSafeRequest (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62274:28),    at async ProviderBridgeService.routeContentScriptRPCRequest (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62307:22),    at async ProviderBridgeService.onMessageListener (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62176:31) 

ProviderBridgeService.routeContentScriptRPCRequest
error processing request,{"reason":"invalid BigNumber value","code":"INVALID_ARGUMENT","argument":"value","value":null}
    at ProviderBridgeService.routeContentScriptRPCRequest (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62315:24),    at async ProviderBridgeService.onMessageListener (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:62176:31)
brandoncurtis commented 2 years ago

these transactions that fail to broadcast are still, apparently, increasing the nonce that's being used locally:

ChainService.populateEVMTransactionNonce
Got chain nonce,8,existing nonce,18,using,19
    at ChainService.populateEVMTransactionNonce (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:59109:22),    at async SigningService.signTransaction (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:71260:40),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:73745:47,    at async Promise.all (index 0),    at async Emittery.emit (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:6698:11),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:72486:9,    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:63016:20 

retrying the transaction:

ChainService.populateEVMTransactionNonce
Got chain nonce,8,existing nonce,19,using,20
    at ChainService.populateEVMTransactionNonce (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:59109:22),    at async SigningService.signTransaction (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:71260:40),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:73745:47,    at async Promise.all (index 0),    at async Emittery.emit (chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:6698:11),    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:72486:9,    at async chrome-extension://eajafomhmkipbjmfmhebemolkcicgfmd/background.js:63016:20 
mhluongo commented 2 years ago

Thanks for this ser, we're digging in

Shadowfiend commented 2 years ago

Ok so we need a nonce release in the catch at https://github.com/tallycash/extension/blob/fddd29d7687bcbf726ae82472ee59c09588ec76b/background/services/chain/index.ts#L1001 to mitigate the nonce issue (not, notably, the fee issue that is triggering it). The subtlety there is going to be whether all caught errors should release the nonce, or only a subset. My best guess right now is that releasing the nonce for all of them would not be crazy.

mhluongo commented 2 years ago

This is also raising priority for custom nonces IMO #2057 → right now the only recourse @brandoncurtis has is to reinstall the wallet or wait for an update, which isn't great.