Skip to content

Conversation

MariusVanDerWijden
Copy link
Member

This PR move the queue out of the main transaction pool.
For now there should be no functional changes.
I see this as a first step to refactor the legacypool and make the queue a fully separate concept from the main pending pool.

@cskiraly
Copy link
Contributor

@MariusVanDerWijden this looks like a clean change, I think we can make this a PR and merge.

@MariusVanDerWijden MariusVanDerWijden marked this pull request as ready for review September 23, 2025 10:26
@rjl493456442 rjl493456442 self-assigned this Sep 23, 2025
cskiraly
cskiraly previously approved these changes Sep 23, 2025
Copy link
Contributor

@cskiraly cskiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cskiraly
Copy link
Contributor

Actually, I think addressByHeartbeat should also better be moved to queue.

cskiraly
cskiraly previously approved these changes Oct 2, 2025
@cskiraly cskiraly added this to the 1.16.5 milestone Oct 2, 2025
@cskiraly
Copy link
Contributor

cskiraly commented Oct 2, 2025

Testing this I've bumped into the following error:

el-4 ERROR [10-02|07:26:31.084] pool attempted to unreserve non-reserved address address=0x4d1CB4eB7969f8806E2CaAc0cbbB71f88C8ec413

Holding back on merging until I clarify if it is related or not.

promoteExecutable already removes the txs from the queue.
We just need to remove them from the lookup.

Signed-off-by: Csaba Kiraly <[email protected]>
@cskiraly
Copy link
Contributor

cskiraly commented Oct 3, 2025

@MariusVanDerWijden the error was due to using pool.removeTx instead of pool.all.Remove. Can you check my changes?

Comment on lines 1516 to 1519

addresses = addresses[:len(addresses)-1]

// Drop all transactions if they are less than the overflow
if size := uint64(list.Len()); size <= drop {
for _, tx := range list.Flatten() {
pool.removeTx(tx.Hash(), true, true)
}
drop -= size
queuedRateLimitMeter.Mark(int64(size))
continue
}
// Otherwise drop only last few transactions
txs := list.Flatten()
for i := len(txs) - 1; i >= 0 && drop > 0; i-- {
pool.removeTx(txs[i].Hash(), true, true)
drop--
queuedRateLimitMeter.Mark(1)
}
for _, hash := range removed {
pool.removeTx(hash, true, false)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removeTx instead of pool.all.Remove, and why is it with unreserve=false ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added patch to use pool.all.Remove, and unreserve as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants