Skip to content

feat(block-template): shuffle possible tx-parents to avoid bias#1439

Merged
jansegre merged 1 commit intomasterfrom
feat/shuffle-block-template-parents
Oct 15, 2025
Merged

feat(block-template): shuffle possible tx-parents to avoid bias#1439
jansegre merged 1 commit intomasterfrom
feat/shuffle-block-template-parents

Conversation

@jansegre
Copy link
Member

@jansegre jansegre commented Oct 2, 2025

Motivation

This list always had the same order, in some cases it could be that mining clients using the block-templates APIs would only ever get the first or first two items in the list to make a mining block, which could lead to cases where the last transactions in the list aren't picked. A shuffle at this stage gives all transactions a high change of being picked over just a few blocks.

Acceptance Criteria

  • Shuffle BlockTemplate.parents_any before sending it in APIs

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

@jansegre jansegre requested review from glevco and msbrogli October 2, 2025 14:34
@jansegre jansegre self-assigned this Oct 2, 2025
@github-actions
Copy link

github-actions bot commented Oct 2, 2025

🐰 Bencher Report

Branchfeat/shuffle-block-template-parents
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
2.09 m
🐰 View full continuous benchmarking report in Bencher

@jansegre jansegre force-pushed the feat/shuffle-block-template-parents branch from 489319d to 7362b31 Compare October 2, 2025 14:53
@codecov
Copy link

codecov bot commented Oct 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.02%. Comparing base (6ea3dc1) to head (299b9b8).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1439      +/-   ##
==========================================
+ Coverage   85.97%   86.02%   +0.05%     
==========================================
  Files         434      435       +1     
  Lines       33829    33921      +92     
  Branches     5315     5298      -17     
==========================================
+ Hits        29083    29182      +99     
+ Misses       3697     3693       -4     
+ Partials     1049     1046       -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.

@jansegre jansegre moved this from Todo to In Progress (Done) in Hathor Network Oct 2, 2025
@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network Oct 2, 2025
@jansegre jansegre force-pushed the feat/shuffle-block-template-parents branch from 7362b31 to 299b9b8 Compare October 13, 2025 16:42
@jansegre jansegre force-pushed the feat/shuffle-block-template-parents branch from 299b9b8 to bdcd206 Compare October 15, 2025 15:31
@jansegre jansegre merged commit 6a2dba0 into master Oct 15, 2025
2 of 7 checks passed
@jansegre jansegre deleted the feat/shuffle-block-template-parents branch October 15, 2025 15:42
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Oct 15, 2025
@jansegre jansegre mentioned this pull request Oct 15, 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

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants