Skip to content

feat(verification): Limit the number of conflicts in mempool#1436

Merged
msbrogli merged 1 commit intomasterfrom
feat/mempool-too-many-conflicts
Oct 2, 2025
Merged

feat(verification): Limit the number of conflicts in mempool#1436
msbrogli merged 1 commit intomasterfrom
feat/mempool-too-many-conflicts

Conversation

@msbrogli
Copy link
Member

@msbrogli msbrogli commented Oct 1, 2025

Acceptance Criteria

  1. Limit the number of conflicts in mempool to 8. So, any other transaction that would increase the number of conflicts is rejected.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@msbrogli msbrogli force-pushed the feat/mempool-too-many-conflicts branch from 80aa164 to 72e0f0c Compare October 1, 2025 19:31
@msbrogli msbrogli self-assigned this Oct 1, 2025
@msbrogli msbrogli moved this from Todo to In Progress (Done) in Hathor Network Oct 1, 2025
@msbrogli msbrogli marked this pull request as ready for review October 1, 2025 19:39
@msbrogli msbrogli requested a review from jansegre as a code owner October 1, 2025 19:39
Comment on lines +354 to +379
count += 1

if count > MAX_CONFLICTS_MEMPOOL:
raise TooManyConflicts
Copy link
Member

Choose a reason for hiding this comment

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

From what I understood from the acceptance criteria was that if the mempool has 8 transactions with conflicts (or maybe 8 conflicts in total if counting the individual conflicts each transaction has), a transaction that would increase that count would not be accepted.

This implementation seems to count whether a single transaction has more than 8 conflicts with transactions in the mempool, and if that's the case transaction would not be accepted into the mempool.

Is that correct? Both of those restrictions make sense, but the latter would allow 100 transactions with conflicts in the mempool, as long as individually each tx has at most 8 conflicts.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice. The ambiguity happened to suggest another restriction that makes sense. I'll add this new restriction in this PR. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! Can you review it again, please?

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

🐰 Bencher Report

Branchfeat/mempool-too-many-conflicts
Testbedubuntu-22.04

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencyminutes (m)
sync-v2 (up to 20000 blocks)📈 view plot
⚠️ NO THRESHOLD
1.98 m
🐰 View full continuous benchmarking report in Bencher

@msbrogli msbrogli force-pushed the feat/mempool-too-many-conflicts branch 2 times, most recently from efbeba6 to 9db613c Compare October 1, 2025 19:45
glevco
glevco previously approved these changes Oct 2, 2025
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Oct 2, 2025
@msbrogli msbrogli force-pushed the feat/mempool-too-many-conflicts branch from 9db613c to b9b9bc9 Compare October 2, 2025 16:27
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.86%. Comparing base (4d5742a) to head (b9b9bc9).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1436      +/-   ##
==========================================
- Coverage   85.88%   85.86%   -0.02%     
==========================================
  Files         431      431              
  Lines       33274    33287      +13     
  Branches     5215     5218       +3     
==========================================
+ Hits        28576    28581       +5     
- Misses       3660     3665       +5     
- Partials     1038     1041       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@msbrogli msbrogli merged commit b9b9bc9 into master Oct 2, 2025
7 of 8 checks passed
@msbrogli msbrogli deleted the feat/mempool-too-many-conflicts branch October 2, 2025 18:14
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Oct 2, 2025
@jansegre jansegre mentioned this pull request Oct 7, 2025
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Oct 15, 2025
@jansegre jansegre mentioned this pull request Oct 16, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants