stellar-core icon indicating copy to clipboard operation
stellar-core copied to clipboard

Add option to validate transactions in the background

Open bboston7 opened this issue 1 year ago • 2 comments

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.

bboston7 avatar Jan 09 '25 19:01 bboston7

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)

marta-lokhova avatar Jan 10 '25 02:01 marta-lokhova

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.

bboston7 avatar Apr 08 '25 18:04 bboston7