erigontech / erigontech/erigon

TxPool: move validateBlobTx out of `global mutex` critical section

Open
#23,163 1 comment 0 reactions 0 assignees View on GitHub
performance
Dominant language
Go
Stars
3.6k
Forks
1.5k
Avg merge
1d 16h
Merged PRs (30d)
455

Description

```
func (p *TxPool) validateBlobTxn
```
func seems doesn't use any `p` non-atomic fields. Unclear why it needs to be inside `p.mu.Lock()` section.

I guess: such heavy `validation of tx-object itself` - must be right after `rlp deserialization` - before insertion to `pool`.

And only `dynamic validation checks - which depend on current state of accs or pool - need to stay under p.mu.Lock()`. For example next need to stay `under p.my.Lock()`:
```
if !isLocal && (p.all.blobCount(txn.SenderID)+uint64(blobCount)) > p.cfg.BlobSlots {
```

I didn't bench it - so, i don't know "how much current validation affectiong txpool" - I just saw it in profiler

Contributor guide

Open the contributing guide

Research direction

Start at TxPool.validateBlobTxn and trace its callers around p.mu.Lock(). Compare the validation that uses only the transaction object with dynamic checks such as p.all.blobCount(txn.SenderID), then inspect the surrounding TxPool flow. Done means object validation no longer runs in the global mutex section while state-dependent checks remain protected, with txpool behavior unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.