Even though my parity node (private network) is not mining, it seems to have a pending block as well as a txpool.
After sending some transactions, the web3.eth.getBlock("pending")
call returns information about the pending block including the pending transactions:
{ author: '0x819773969b2622a0a362fd137b088f90f88bd812',
difficulty: '131072',
extraData: '0x506172697479',
gasLimit: 134086668,
gasUsed: 3264884,
hash: '0x084fd0478d7d7cea29ecb1a3734a3810933eddf26b1f18138711c93d83066759',
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
miner: '0x819773969b2622a0a362fd137b088f90f88bd812',
number: 1,
parentHash: '0xf5ef33749ed2fdfae1e6d1ce353d01d3d24cd58c37fd82f0afa78d71f206ffa0',
receiptsRoot: '0x70e8edb579ffacaf92e02c9186fff660f9dfcf02e415d6d12f0d6523bcb67dfb',
sealFields: [],
sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
size: 14575,
stateRoot: '0xfd4a9996a00551085ba9c94c362ccbd7ae082683c428afac14de04b426a0015b',
timestamp: 1520939275,
totalDifficulty: '132096',
transactions:
[ '0xa6a6eb4ba46b798ca89c58770acaa6be030c5ea96bdf1e26f5a6e692625beb99',
'0x77d18ff8c6304ec1f4e7e28605498eb2018e2d3089dd7e59b2124077f3b7956c',
'0xddf1cfca112e3e4c653a8a14267f569015db6a1db9f0ba2144fec8f8cfdaebcc',
'0x7cedab2409a862b922c19c260f137e94e625a84a08d17414ebc835ecca7c19a9',
'0x7d2bb13e6c08c99f3e8cf07fce84842a46a979e547eb009e02b2ba659bcec296',
'0x2be0a050cf877d1feb92924d4af313155bd65146fd24cb45cf08323370484c38',
'0x02d55f8200a2176dea514a2481a7ddfa3e1fdf9e7514008a6030e4f0dc7dfe82',
'0x88d40a05425cd2f5f56ab84ba1aca715b99fc3234fc11b5dfe48688f5de78139',
'0xbd6f6e70aaf16916d34b56f3a96af1b344a44fc738a1da0eb0d55c94ffafcadd',
'0xf966a75580009d506096396676fc5ea8f8da660fc265d7b83f954a6ee46fd061',
'0x40509d3abaabc04367de8428f14d0763b798061180b04bb5a1833746d564e377',
'0x41b50420117a8751b8d397a1f043e3767b29928fc0ecdc0d795fd0aa821df749',
'0x172631800f2f4125e42feceb1db45d7ef0b0d0f205d09f089b2d877d310a99d8',
'0x20629025b98574d7eb0744b252753cff4e65ff9070bb5d03c8540108e72027c4',
'0xf7367abaa8c356e9057d36d8ce03e437546afb271b677f6aafdccb464867a5d8',
'0xd5e6c9c04bd5b787612d90b9668d0be804e7ddc142186885f019654063fd37f8',
The web3.eth.getTransactionCount(<address>, "pending")
call returns a transaction count of:
94
When making a curl
request to make use of the parity-specific API endpoint parity_nextNonce
which returns account transaction count based on the pending block as well as the txpool, it also returns the same number of transactions:
{"jsonrpc":"2.0","result":"0x5e","id":1}
I don't seem to have grasped the difference between the pending block and the txpool.
Initially I was under the impression that the txpool is where all the pending transactions are stored on a node (in memory) and that the pending block is only present when a node is mining (i.e. the block that's being solved for), but clearly that's not the case.
Could someone explain the difference between these two concepts in the context of pending transactions, the account nonce and pending transaction broadcasting?
Similar questions have been asked with no concrete answers:
getBlock('pending').transactions vs txpool.status.pending?
eth.pendingTransactions vs eth.getBlock('pending').transactions