You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most transactions made with web3.js will need a recent blockhash. This means every time a developer makes a transaction they have to add some boilerplate code.
Rather than require users to specify a recent blockhash or durable nonce every time they create a new transaction, the user should be able to omit a recent blockhash and, in this case, a recent blockhash should be found added to the transaction when submitted.
🤔 I'm concerned that this will affect perceived transaction times as sends will include the time taken to get a recent blockhash.
However the reduction in unnecessary boilerplate may be considered worth this, and we can ensure that docs reflect that users should get a recent blockhash in advance of sending their transaction for optimum speeds.
This is a tricky one for a similar reason to changing the name of sendTransaction. All our RPC methods are precisely consistent with the JSON RPC in behaviour as well as name, all they do it pass their params in a JSON RPC request. And again this is both implementation detail and kinda unavoidable (for the low level rpc-core library) because of the proxy implementation. It's not currently possible for us to make an rpc-core function do something other than send a JSON RPC request with its params.
I wonder if the best approach here might be a higher-level library that sits above both rpc-core and transactions, and contains helpers for creating transactions (your #1693 issue) and for sending them, including something like this that adds a default blockhash before serializing and calling sendTransaction?
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.
Motivation
Most transactions made with web3.js will need a recent blockhash. This means every time a developer makes a transaction they have to add some boilerplate code.
Rather than require users to specify a recent blockhash or durable nonce every time they create a new transaction, the user should be able to omit a recent blockhash and, in this case, a recent blockhash should be found added to the transaction when submitted.
🤔 I'm concerned that this will affect perceived transaction times as sends will include the time taken to get a recent blockhash.
However the reduction in unnecessary boilerplate may be considered worth this, and we can ensure that docs reflect that users should get a recent blockhash in advance of sending their transaction for optimum speeds.
Very keen to find out what others think here.
Example use case
Before
After
Details
Essentially this switches explicitly getting lifetimes from being mandatory boilerplate to a performance optimisation.
The text was updated successfully, but these errors were encountered: