Add option to validate transactions in the background
Closes #4316 and #4607.
This change adds a new option EXPERIMENTAL_BACKGROUND_TX_VALIDATION that causes stellar-core to validate any transactions received over-the-wire in the background. It also wraps all ledger state needed to validate transactions into a new ExtendedLedgerSnapshot object.
thanks for putting this together! I'm excited about moving more of transaction processing to the background. It also seems like making tx queue thread-safe is not as dangerous/scary as we thought, which is great. My two main suggestions are to consolidate all read-only ledger state into a single object to avoid footguns, and re-work recvTransaction flow a little bit to remove main thread completely (this way we'll have a synchronous flow independent of main thread, from when the message is popped off the wire all the way to tx queue insertion)
I reworked this PR to do only validation in the background, as that's what our perf testing showed had the largest impact. It's now ready for review.