-
Notifications
You must be signed in to change notification settings - Fork 20.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pending transactions not applied until after a ChainHeadEvent #2897
Comments
I think this works as intended. If a node is mining it will first collect all the executable transactions, and then start working on the PoW for those (if there are no transactions pending currently, it start working on an empty block's PoW). When already in this hashing phase it does not incorporate new transactions. If it were to add every inbound transaction all the time, it would constantly need to stop the PoW hashing, generate a new block and restart the hashing. This would be quite a performance hit, especially if remote miners are connected which would need to poll or be notified of the update. |
The PoW hashing should continue in parallel to block updates. If the pending block isn't updated until a new block is found (i.e. a It looks like this might also be the reason for the "uncle propagation" problem described here:
That could be explained by |
@cdetrio is right, it makes sense to construct the pending block continuously even while mining. |
As far as I understood it, the request was not to maintain the "next" work,
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
System information
Version: 1.5.0-unstable-4f4e1026
Expected behaviour
A pending transaction should be applied immediately, and included in the first block mined after the transaction is received.
Actual behaviour
Pending transactions are not applied immediately. After a tx is added to the pending pool, an empty block must be mined first. After an empty block is mined, pending transactions are then included in the second block.
log from worker.go with debug prints:
Steps to reproduce the behaviour
./go-ethereum/build/bin/geth --datadir "./local_testchain_data" --unlock "0xe9a4690662e26219d11315fe8389b40263a9abc3" --password "pass.conf" --rpc --rpccorsdomain "*" --networkid 1100 -maxpeers 0 --mine --minerthreads 1
Then send a tx, watch when the tx is included in the pending pool (
eth.pendingTransactions
in the geth console), and that an empty block is mined first, before the pending tx is included in the second block.The text was updated successfully, but these errors were encountered: