erigon
erigon copied to clipboard
Transaction with wrong chainId is added to tx pool
System information
Erigon version: 2022.99.99-dev-60f6da76
OS & Version: OSX
Commit hash : 59bcbb4f3337b78e25f3a1545d4fe6d6bc03a855
Expected behaviour
Transaction with wrong chainId is not in the tx pool
Actual behaviour
Transaction with wrong chainId is in the tx pool:
{
'blockHash': None,
'blockNumber': None,
'from': '0x67b1d87101671b127f5f8714789c7192f7ad340e',
'gas': '0x5208',
'maxPriorityFeePerGas': '0x12a05f200',
'maxFeePerGas': '0x148a89eee',
'hash': '0xdfe5d63a5347aca96ed51d6cdb874669d9591a7a1e80beff63e847df1b5dec99',
'input': '0x',
'nonce': '0x5',
'to': '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',
'transactionIndex': None,
'value': '0x470de4df820000',
'type': '0x2',
'accessList': [],
'chainId': '0x1570d',
'v': '0x0',
'r': '0x19c004a754ad6991d5065c6024d89c77d48a1a57982ad60320e643f953ca752e',
's': '0x75ea7bb1d351c9af9af5c2f54a432cd9cefa2103f520fc4947827c1b07c223fc'
}
Steps to reproduce the behaviour
- Sign and send transaction with a random chainId:
{
'nonce': 5,
'to': '0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B',
'value': 20000000000000000,
'gas': 21000,
'chainId': 67570,
'maxFeePerGas': 5513977582,
'maxPriorityFeePerGas': 5000000000
}
- Get transaction pool content (for example by web3.geth.txpool.content())
Hi @enriavil1, I've just retested this issue and unfortunately it's still reproducible. However I've noticed that's only relevant to EIP1559 transactions, when we sign and send a tx with gasPrice it's not added to a tx pool. I have no permission to reopen an issue in this repo, could you please do that?
So the EIP-1559 txn is not added into the tx pool at all if the txn has a gas price?
EIP-1559 transactions don't include a gas price. I meant legacy transactions (with a gas price) are not added to the tx pool but EIP-1559 (without a gas price) are added (queued) in the tx pool
What does Erigon say when you send the legacy tx? It should be giving you an error code
It's -32000: 'INTERNAL_ERROR: rlp parse transaction: invalid chainID' for legacy txs.
For EIP-1559 I'm also getting -32000 before checking the tx pool
That should only be happening if you have a different chainId from the chain you are sending your transaction to. Is it the same transaction as the one from the beginning?
What do you mean - the same transaction? I send a transaction once, get error which is expected and after that I check a tx pool.
I meant if you are still sending this one: { 'nonce': 5, 'to': '0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B', 'value': 20000000000000000, 'gas': 21000, 'chainId': 67570, 'maxFeePerGas': 5513977582, 'maxPriorityFeePerGas': 5000000000 } so I can try and recreate it like I did in the previous one
ChainId is randomly generated number so it changes each time when I run a test. But the result is always the same
Okay I get it legacy Tx with wrong chainId are not added into the txpool, but EIP-1559 with wrong chainId are added into txpool.
@enriavil1 are you still working on it?
@enriavil1 are you still working on it?
Yes, but currently have not found the issue. I don't mind giving it away to someone else, as I am also fixing other bugs.
@mandrigin I suspect the error is in erigon-lib
okay, I adding @revittm to do that one
Just retested - not reproducible anymore. Closing the issue
This happened recently to one of my polygon archival nodes, tx with id 250 was in the txpool