erigon-pulse/txpool
Manav Darji 07fa94278f
txpool: honour nonce while sorting txs (#737)
In context of https://github.com/ledgerwatch/erigon/issues/5694, this PR
fixes the tx ordering logic in the txpool. Also, a relevant change in
erigon is made here: https://github.com/ledgerwatch/erigon/pull/6051.

When the mining module used to query the best transactions, the response
of transactions weren't sorted according to nonce (for same sender
address). This caused the execution to fail (except 1). The txpool
orders the transactions using this underlying `better()` and `worse()`
functions. The `better()` function didn't have a nonce check for the
pending pool, while the `worse()` function had. This PR adds a check
which would compare and put a transaction with lower nonce ahead.

Moreover, on further investigation, these checks were applied for all
types of transactions. It only makes sense compare the nonce for
transactions which has same sender account. Hence, this PR also adds an
additional check along with.
2022-11-16 10:57:17 +03:00
..
testdata ErigonLib: move types to own package (#413) 2022-04-11 10:02:44 +07:00
txpooluitl WithTablessCfg -> WithTableCfg (#601) 2022-08-24 11:02:47 +02:00
fetch_test.go Update interfaces (#733) 2022-11-11 16:36:22 +01:00
fetch.go Fieldalign (#695) 2022-10-21 15:31:23 +07:00
mocks_test.go Update interfaces (#733) 2022-11-11 16:36:22 +01:00
pool_fuzz_test.go Update interfaces (#733) 2022-11-11 16:36:22 +01:00
pool_test.go Update interfaces (#733) 2022-11-11 16:36:22 +01:00
pool.go txpool: honour nonce while sorting txs (#737) 2022-11-16 10:57:17 +03:00
send.go Fieldalign (#695) 2022-10-21 15:31:23 +07:00
test_util.go Fieldalign (#695) 2022-10-21 15:31:23 +07:00
txpool_grpc_server.go [txpool] Best function to accept onTopOf argument and indicate whenever it is too early to gather tx for a block (#685) 2022-10-14 23:11:37 +01:00