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
Polling mechanism of eth_getTransactionReceipt(txHash)
But
It is not great for a Dapp/Wallet to use a proprietary API, whereas the open standard RPC interface is more reliable.
L1 and L2s have significantly different throughputs; ideally, a different polling mechanism should be put in place for each network, but that is not a great developer experience to maintain this configuration. In addition, some RPC endpoints, like public endpoints, do not well support fast polling due to a low rate limit.
Instead, the open specification should propose a push mechanism for a mature user and developer experience for transaction inclusion notification
Websocket specification
Parameters:
transactionReceipts
object
2.a. addresses: list of addresses to filter transaction receipts by to or from
2.b. includeRemoved (optional): boolean specifier to include transactions that have been removed from the cannonical chain (or re-orged).
result
2.a. blockHash: 32 bytes. Hash of the block including this transaction
2.b. blockNumber: Block number including this transaction.
2.c. transactionIndex: Hexadecimal of the transaction's index position in the block.
2.d. transactionHash: 32 bytes. The hash of the transaction.
2.e. from: The address of the sender.
2.f. to: 20 bytes. The address of the receiver. null when the transaction is a contract creation transaction.
2.g. cumulativeGasUsed: The total amount of gas used when this transaction was executed in the block.
2.h. gasUsed: The amount of gas used by this specific transaction alone.
2.i. contractAddress: 20 bytes. The contract address created if the transaction was a contract creation, otherwise null.
2.j. logs: (Array) An array of log objects generated by this transaction.
2.k. logsBloom: 256 bytes. Bloom filter for light clients to quickly retrieve related logs.
2.l. status: Either 1 (success) or 0 (failure)
2.m. effectiveGasPrice: The actual value per gas deducted from the sender's account. Before EIP-1559, equal to the gas price.
2.n. type: the transaction type.
object
1.a. addresses: list of addresses to filter transaction receipts by to or from
1.b. includeRemoved (optional): boolean specifier to include transactions that have been removed from the cannonical chain (or re-orged).
Motivation
As a Dapp/Wallet, the way to be notified of a block inclusion of a transaction are as follows:
But
Instead, the open specification should propose a push mechanism for a mature user and developer experience for transaction inclusion notification
Websocket specification
Parameters:
transactionReceipts
object
2.a.
addresses
: list of addresses to filter transaction receipts byto
orfrom
2.b.
includeRemoved
(optional): boolean specifier to include transactions that have been removed from the cannonical chain (or re-orged).eth_subscribe response:
subscription id
Notification Response:
subscription id
result
2.a.
blockHash
: 32 bytes. Hash of the block including this transaction2.b.
blockNumber
: Block number including this transaction.2.c.
transactionIndex
: Hexadecimal of the transaction's index position in the block.2.d.
transactionHash
: 32 bytes. The hash of the transaction.2.e.
from
: The address of the sender.2.f.
to
: 20 bytes. The address of the receiver. null when the transaction is a contract creation transaction.2.g.
cumulativeGasUsed
: The total amount of gas used when this transaction was executed in the block.2.h.
gasUsed
: The amount of gas used by this specific transaction alone.2.i.
contractAddress
: 20 bytes. The contract address created if the transaction was a contract creation, otherwise null.2.j.
logs
: (Array) An array of log objects generated by this transaction.2.k.
logsBloom
: 256 bytes. Bloom filter for light clients to quickly retrieve related logs.2.l.
status
: Either 1 (success) or 0 (failure)2.m.
effectiveGasPrice
: The actual value per gas deducted from the sender's account. Before EIP-1559, equal to the gas price.2.n.
type
: the transaction type.HTTP filter subscription specification
Parameters:
object
1.a.
addresses
: list of addresses to filter transaction receipts byto
orfrom
1.b.
includeRemoved
(optional): boolean specifier to include transactions that have been removed from the cannonical chain (or re-orged).eth_subscribe response:
subscription id
eth_getFilterChanges response:
The text was updated successfully, but these errors were encountered: