-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Re-define pending
state in RPC
#5014
Comments
I'm tempted to close this as stale unless someone steps up to join this discussion on the @paritytech/core-devs Please assign this issue to someone and decide on a deadline within 7 days, thanks. |
Sorry for not jumping in sooner. Getting the current number of pending transactions is currently a difficult problem for consumers of the RPC. The Adding Since the definition of |
Related: #6942 By running with |
@danfinlay (Going through stale issues here) Does @tomusdrw comment above satisfy your requirements in any way. I agree that anything that is dependent on parity-specific RPCs isn't going to be very nice to use, have you thought about opening an EIP for adding this? I would certainly support it. |
At MetaMask, we've addressed this problem by tracking pending transactions locally. This makes sense for us because we point at a load balanced cluster, can be pointed at different clients, and keep a transaction queue. If we were the only ones holding this open, it could be fine to close it. |
@danfinlay Can you share how you guys tracking pending transactions locally? We're having this nonce problem as well. |
@tempofeng We calculate the next nonce like this: This thread is probably the wrong place to discuss this. If you have a question about how MetaMask works, please open an issue there. |
Currently our
pending
state definition is quite pure: It's the state of a pending block (currently mined block) orlatest
canonical chain block if the node is not creating the pending block (light client/no mining/no--force-sealing
).For that reason we had to implement custom
parity_nextNonce
method to get a next available nonce for particular sender (including transactions in the queue).Perhaps we should create some exceptions for methods like
eth_getTransactionCount(address, 'pending')
by default or under some CLI flag.Problematic stuff: pending receipts, balance, storage_at, code_at, call, estimate_gas.
The text was updated successfully, but these errors were encountered: