Replies: 1 comment 1 reply
-
Unfortunately this is a major issue for us as well and eats a lot of rpc calls. It would be ideal if the developers change the interface of this call all together and force the user to poll for the receipt, so they are aware of the cost it could bear. If you're on v4, can easily avoid the polling call by using the underlying core functions following the example bellow: Assuming import { ethRpcMethods } from 'web3-rpc-methods'
const signedTransactionFormattedHex = web3.utils.format(
{ format: 'bytes' },
signedTx,
ETH_DATA_FORMAT,
)
// The standard web3.eth.sendSignedTransaction does so much useless work
// and has a bug with unhandled promise rejections: https://github.com/web3/web3.js/issues/6900
const resultTxHash = await ethRpcMethods.sendRawTransaction(
web3.requestManager,
signedTransactionFormattedHex,
) I'm yet to find a way to do this in web3v1 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We are currently using sendSignedTransaction and exit the call when the transactionHash promi event is emitted. We monitor transactions and events for the resulting sendRawTransaction through a different process and therefore it is not important for us to wait on the transactionReceipt that is returned from sendSignedTransaction. We have noticed that even though we stop listening after the transactionHash promi event has been emitted that the sendSignedTransaction function continues to poll for transaction receipts and this in turn uses (for us) alot of unneccessary rpc calls to our provider. We have attempted to configure this and have managed to slow the number of calls, but would like to know if there are any plans of adding an option to this function to NOT poll for transaction receipts??
Many thanks for you help!
Beta Was this translation helpful? Give feedback.
All reactions