Skip to content

Conversation

@ARR4N
Copy link
Collaborator

@ARR4N ARR4N commented Nov 17, 2025

Introduces an integration point between txpool.TxPool, saexec.Executor and gossip.Set, with a simple transaction-prioritisation mechanism. Any specific rules for when to reject a tx from the mempool will likely require some libevm mods so can follow later.

The consensus worst-case validation will still need to track "in-flight" txs as the LegacyPool will only remove them once included. An enqueueing subscription mechanism is added for this purpose.

ARR4N and others added 30 commits September 26, 2025 13:00
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Arran Schlosberg <[email protected]>
Co-authored-by: Stephen Buttolph <[email protected]>
Signed-off-by: Arran Schlosberg <[email protected]>
@ARR4N ARR4N marked this pull request as ready for review November 19, 2025 12:07
@ARR4N ARR4N self-assigned this Nov 19, 2025
@ARR4N ARR4N added the acp-194 label Nov 19, 2025
ARR4N and others added 3 commits November 19, 2025 17:33
Base automatically changed from arr4n/saexec to main November 19, 2025 20:10
Copy link
Contributor

@StephenButtolph StephenButtolph left a comment

Choose a reason for hiding this comment

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

will continue reviewing tomorrow

// to release resources.
func NewSet(logger logging.Logger, pool *txpool.TxPool, bloom *gossip.BloomFilter, targetBloomElements int) (*Set, func() error) {
txs := make(chan core.NewTxsEvent)
sub := pool.SubscribeTransactions(txs, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like this only receives txs upon mempool reorgs. I would have thought that the bloom filter should update as soon as we add the tx to the pool to avoid unnecessary gossip

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've demonstrated in TestTxPoolPopulatesBloomFilter() that it will send new txs as well and that the filter receives them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, my original comment wasn't questioning whether or not the txs would get added to the bloom filter eventually. My comment was questioning whether or not it is smart to wait until a mempool reorg happens to populate the bloom filter.

In all of our current mempool implementations, we include the transactions into the bloom filter prior to returning from Add.

Comment on lines +52 to +54
func (bc *blockchain) StateAt(root common.Hash) (*state.StateDB, error) {
return state.New(root, bc.exec.StateCache(), nil)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So, with this PR the mempool's validity checking is based on the settled state right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Intent is currently undefined. Sorry, I should have been clearer in what I meant in the PR description (i.e. I'm kicking that can down the road entirely):

Any specific rules for when to reject a tx from the mempool will likely require some libevm mods so can follow later.

The p2p architecture and gossip was all so new to me that I found this PR relatively difficult, so wanted to focus on learning it and getting the wiring correct. I'll concentrate on things like validity when we have the VM to orchestrate all the moving parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants