Skip to content

Improve TxSubmission#5324

Draft
karknu wants to merge 23 commits intomainfrom
karknu/mw/fix-tx-submission
Draft

Improve TxSubmission#5324
karknu wants to merge 23 commits intomainfrom
karknu/mw/fix-tx-submission

Conversation

@karknu
Copy link
Contributor

@karknu karknu commented Feb 24, 2026

Description

  • Improve TxLogic benchmark by using the default policy and realistic TXs sizes.
  • Add a 200ms (configurable) delay between requests for the same TX. Likely we will get it within that time which saves us the trouble of requesting it from multiple peers.
  • When making decisions ignore peers which already have pending decisions. They may be blocked for a long time (e.g the mempool is full). It is better to put work on other peers.

Checklist

Quality

  • Commit sequence makes sense and have useful messages, see ref.
  • New tests are added and existing tests are updated.
  • Self-reviewed the PR.

Maintenance

  • Linked an issue or added the PR to the current sprint of ouroboros-network project.
  • Added labels.
  • Updated changelog files.
  • The documentation has been properly updated, see ref.

@github-project-automation github-project-automation bot moved this to In Progress in Ouroboros Network Feb 24, 2026
@karknu karknu marked this pull request as ready for review February 24, 2026 13:28
@karknu karknu requested a review from a team as a code owner February 24, 2026 13:28
This fixes a bug where the same tx is enqueued multiple times for
submission into the mempool by the same peer.
Previous generator would filter out all duplicate tx's and hence
all downstream/outbound clients would have distinct mempools.

The new mempool implementation does not allow duplicates, so this
approach also allows detecting when duplicates are attempted to be
added to the mempool

Tracing improvements.
@karknu karknu marked this pull request as draft February 25, 2026 13:22
Improve TxLogic benchmark by using the default policy and realistic TXs
sizes.
@karknu karknu force-pushed the karknu/mw/fix-tx-submission branch from 2c75366 to 97df304 Compare February 25, 2026 13:41
Reduce resource consumption by waiting at least 200ms before
issueing the next request for the same tx.
@karknu karknu force-pushed the karknu/mw/fix-tx-submission branch from 97df304 to bf03196 Compare February 25, 2026 15:08
Avoid scheduling more jobs on peers that already have outstanding
decisions.
@karknu karknu changed the title Improve TxLogic benchmark Improve TxSubmission Feb 25, 2026
@crocodile-dentist crocodile-dentist force-pushed the mw/fix-tx-submission branch 5 times, most recently from e414f7f to f5bb003 Compare March 2, 2026 15:22
Base automatically changed from mw/fix-tx-submission to main March 5, 2026 08:20
karknu added 4 commits March 5, 2026 14:38
Fix a bug where we would call makeDecisions with an old timestamp.
Use a generation counter to track changes to SharedStateVar and only
call the expensive makeDecisions if a timer has expired or the shared
state has changed.
Send lists of TXs to the mempool when possible. This mimics the
behaviour of the V1 tx submission.
If state change wait at most 25ms for additional changes in order to
coalece TX events together.
karknu added 8 commits March 13, 2026 00:29
Move tx counter tracing to drainRejectionThread where it will be run at
most once per second.
Cut down on the number of wakeups by only depending on the debouncer.
Merge countRejectedTxs and updateBufferedTx calls into the same atomic
operation so that submitTxsToMempool only bumps the generation number
once.
Avoid building temporary Maps and Sets in pickTxsToDownload and
filterActivePeers.
Avoid tmp allocations in acknowledgeTxIds by folding acknowledged txids once
for mempool queueing and refcount updates.
Avoid tmp allocations in receivedTxIdsImpl by updating available/buffered
tx maps in one pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants