go-pulse/eth
Péter Szilágyi 542c861b4f
core/txpool, eth/catalyst: fix racy simulator due to txpool background reset (#28837)
This PR fixes an issues in the new simulated backend. The root cause is the fact that the transaction pool has an internal reset operation that runs on a background thread.

When a new transaction is added to the pool via the RPC, the transaction is added to a non-executable queue and will be moved to its final location on a background thread. If the machine is overloaded (or simply due to timing issues), it can happen that the simulated backend will try to produce the next block, whilst the pool has not yet marked the newly added transaction executable. This will cause the block to not contain the transaction. This is an issue because we want determinism from the simulator: add a tx, mine a block. It should be in there.

The PR fixes it by adding a Sync function to the txpool, which waits for the current reset operation (if any) to finish, and then runs an entire round of reset on top. The new round is needed because resets are only triggered by new head events, so newly added transactions will not trigger the outer resets that we can wait on. The transaction pool would eventually internally do a reset even on transaction addition, but there's no easy way to wait on that and there's no meaningful reason to bubble that across everything. A clean outer reset will at worse be a small noop goroutine.
2024-01-23 20:59:38 +01:00
..
catalyst core/txpool, eth/catalyst: fix racy simulator due to txpool background reset (#28837) 2024-01-23 20:59:38 +01:00
downloader core, core/rawdb, eth/sync: no tx indexing during snap sync (#28703) 2024-01-22 21:05:18 +01:00
ethconfig cmd, les, tests: remove light client code (#28586) 2023-11-23 16:28:26 +02:00
fetcher eth/fetcher, eth/gasestimator: fix typos in comments (#28675) 2023-12-13 23:32:17 +01:00
filters eth/filters: reset filter.begin in BenchmarkFilters (#28830) 2024-01-18 13:08:13 +01:00
gasestimator all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
gasprice all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
protocols all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
tracers all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go core, core/rawdb, eth/sync: no tx indexing during snap sync (#28703) 2024-01-22 21:05:18 +01:00
api_debug_test.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
api_debug.go cmd/evm, core/state: fix post-exec dump of state (statetests, blockchaintests) (#28504) 2023-11-28 13:54:17 +01:00
api_miner.go core/txpool: make transaction validation reusable across packages (pools) (#27429) 2023-06-06 12:53:29 +03:00
api.go les, eth: fix typo in comment (#27369) 2023-05-30 14:55:03 +02:00
backend.go core, core/rawdb, eth/sync: no tx indexing during snap sync (#28703) 2024-01-22 21:05:18 +01:00
bloombits.go eth: move eth.Config to a common package (#22205) 2021-02-05 13:51:15 +01:00
handler_eth_test.go core, eth, miner: start propagating and consuming blob txs (#28243) 2023-10-04 12:36:36 +03:00
handler_eth.go eth: enforce announcement metadatas and drop peers violating the protocol (#28261) 2023-10-10 11:35:51 +03:00
handler_snap.go eth: check snap satelliteness, delegate drop to eth (#22235) 2021-02-02 10:44:36 +02:00
handler_test.go core, eth, miner: start propagating and consuming blob txs (#28243) 2023-10-04 12:36:36 +03:00
handler.go cmd/utils, eth: disallow invalid snap sync / snapshot flag combos (#28657) 2023-12-08 15:16:04 +02:00
peer.go eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
peerset.go eth: fix potential hang in waitSnapExtension (#28744) 2024-01-15 15:32:03 +01:00
state_accessor.go core, eth, trie: expose more detailed dirty ram tracking for diff layers (#27971) 2023-08-23 14:08:39 +03:00
sync_test.go cmd/devp2p, eth: drop eth/66 (#28239) 2023-10-03 15:03:19 +03:00
sync.go core, core/rawdb, eth/sync: no tx indexing during snap sync (#28703) 2024-01-22 21:05:18 +01:00