Why doesn't JsonRpcSigner.sendTransaction
call populateTransaction
when Signer.sendTransaction
does?
#3151
-
In order to avoid deep linking issues with WalletConnect on iOS, I'm trying to remove as much async logic as possible from click handlers that send a transaction. In theory it seems like I should be able to call
If there's a good reason for this difference, it would be nice to have access to the same transaction population logic used within |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I should add that one notable difference in behaviour is that |
Beta Was this translation helpful? Give feedback.
-
The reason is that a node performs much of its own internal logic when sending a transaction; e.g. Geth has access to cached internal values for its own account state trie values such as its nonce, and the fee data (gasPrice in legacy transaction and the max*FeePerGas for EIP-1559) is available synchronously within the node’s sendTransaction and has its own configuration for the fee. Nodes such as MetaMask will usually ignore fee data and including a nonce can cause a node to hiccup, as it’s UI may wish to reassign the nonce based on a rejection and if multiple transactions are submitted, it will serialize the minces (while populating it would cause them to become replacement transactions). It would be nice if it could use populateTransaction, but node clients do so much extra above and beyond that the application either doesn’t have control over, is ignored or can cause complications… Does that make sense? |
Beta Was this translation helpful? Give feedback.
The reason is that a node performs much of its own internal logic when sending a transaction; e.g. Geth has access to cached internal values for its own account state trie values such as its nonce, and the fee data (gasPrice in legacy transaction and the max*FeePerGas for EIP-1559) is available synchronously within the node’s sendTransaction and has its own configuration for the fee.
Nodes such as MetaMask will usually ignore fee data and including a nonce can cause a node to hiccup, as it’s UI may wish to reassign the nonce based on a rejection and if multiple transactions are submitted, it will serialize the minces (while populating it would cause them to become replacement transactions).