nethermind icon indicating copy to clipboard operation
nethermind copied to clipboard

TxPool: fix overly aggressive tx locking

Open MarekM25 opened this issue 7 months ago • 1 comments

https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Blockchain/Spec/ChainHeadSpecProvider.cs#L44

This could have been implemented better. We are locking transactions in the TxPool for releaseSpec, which changes only once per year. We should also investigate whether this introduces any race-condition issues.

cc: @benaadams

MarekM25 avatar Apr 27 '26 07:04 MarekM25

Picking this up. Replaced the lock + paired field updates with an immutable (Number, Spec) record published via Volatile.Read/Volatile.Write. Last-writer-wins is safe because GetSpec(header) is deterministic per (number, header). PR follows.

obchain avatar May 15 '26 12:05 obchain