erigon
erigon copied to clipboard
Unequal transactions number included into block from transaction pool (reproduced on DEV chain)
System information
Erigon version: erigon version 2022.99.99-dev-2a0fda33
OS & Version: OSX Version 12.3.1
Commit hash : 2a0fda33
Expected behaviour
Transactions always picked up from transactions pool in batches
Actual behaviour
All the list of EIP1559 transactions in transaction pool which are not "fit" into the first block are picked up one by one. Please see description of issue
There are few ways to send many transactions but I use the next way:
a) Taking into account current nonce = web3.eth.get_transaction_count(address) and we need to send X number of transactions: send transaction with (nonce + 1) then (nonce + 2) then (nonce + 1) ........ (nonce + X + 1) (they will stay in transaction pool in that case pending transactions
)
b) Now send transaction with the current account nonce
value
In that case once transaction from (b) step is mined all the rest transactions from transaction pool are picked up
Steps to reproduce the behaviour
- Start the DEV network (DEV_CHAIN.md) (I use single node)
- Send 300 transactions from single account starting with the the
nonce = web3.eth.get_transaction_count(address)+ 1
value till thenonce = web3.eth.get_transaction_count(address)+ 300 + 1
- Send 1 transaction with the current nonce=web3.eth.get_transaction_count(address) Actual result: about 150-170 transactions included in the first block. All the rest transactions are picked up one by one thus producing > 100 blocks having single transaction
Backtrace
logs from erigon dev network for above steps: erigon_300_tx.log
@leonardchinonso we will take this one if you don't mind?
Also you can reproduce easily using automated-testing
repo with the test dedicated to this:
- Clone the repo https://github.com/ledgerwatch/automated-testing
- Create environment as described here: https://github.com/ledgerwatch/automated-testing#how-to-configure-the-environment-for-the-project
- Start your
erigon
DEV node andrpcdaemon
- Now, run the test:
python -m pytest tests/test_block_creation_mvp.py::TestMVPTestCase::test_batch_of_valid_transactions --no-skips
- Keep an eye on
erigon
stdout (there are logs similar to what attached in description
The issue is not reproducible anymore, so should be closed