Skip to content

refactor(consensus): feature activation mempool rules#1569

Merged
jansegre merged 1 commit intomasterfrom
refactor/consensus-features
Jan 26, 2026
Merged

refactor(consensus): feature activation mempool rules#1569
jansegre merged 1 commit intomasterfrom
refactor/consensus-features

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Jan 22, 2026

Depends on #1568

Motivation

In preparation for new features that will undergo the Feature Activation process, this PR performs a refactor in how the consensus handles mempool rules for feature activations.

Acceptance Criteria

  • Refactor ConsensusAlgorithm so it takes TransactionStorage as a dependency.
  • Refactor ConsensusAlgorithm._compute_vertices_that_became_invalid so instead of retrieving features states individually for each feature, it uses a single _feature_activation_rules() method that takes all features into account. It uses the new unified Features.from_vertex method. The new use of a match guarantees that we won't forget to add feature handling here when new features are created.
  • No changes in behavior.

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

@glevco glevco self-assigned this Jan 22, 2026
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network Jan 22, 2026
@glevco glevco force-pushed the refactor/consensus-features branch from 08093fa to 9d02dde Compare January 22, 2026 16:08
@glevco glevco changed the title refactor: feature activation handling refactor(consensus): feature activation mempool rules Jan 22, 2026
@glevco glevco force-pushed the refactor/features branch 4 times, most recently from 7ad8bda to 8bcd974 Compare January 22, 2026 18:22
@glevco glevco force-pushed the refactor/consensus-features branch from 9d02dde to 076215e Compare January 22, 2026 18:23
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jan 22, 2026
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 78.26087% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.27%. Comparing base (a010288) to head (73d3e56).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
hathor/consensus/consensus.py 78.26% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1569      +/-   ##
==========================================
- Coverage   86.33%   86.27%   -0.06%     
==========================================
  Files         437      437              
  Lines       33645    33662      +17     
  Branches     5258     5269      +11     
==========================================
- Hits        29047    29042       -5     
- Misses       3594     3611      +17     
- Partials     1004     1009       +5     

☔ 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.

@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jan 22, 2026
@glevco glevco force-pushed the refactor/consensus-features branch 4 times, most recently from e4b1772 to 9fe977f Compare January 23, 2026 14:01
msbrogli
msbrogli previously approved these changes Jan 23, 2026
jansegre
jansegre previously approved these changes Jan 23, 2026
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Jan 23, 2026
Base automatically changed from refactor/features to master January 24, 2026 19:39
@glevco glevco dismissed stale reviews from jansegre and msbrogli January 24, 2026 19:39

The base branch was changed.

@glevco glevco force-pushed the refactor/consensus-features branch from 9fe977f to 73d3e56 Compare January 24, 2026 20:20
@github-actions
Copy link

🐰 Bencher Report

Branchrefactor/consensus-features
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.69 m
(-1.76%)Baseline: 1.72 m
1.55 m
(91.61%)
2.06 m
(81.86%)
🐰 View full continuous benchmarking report in Bencher

@github-project-automation github-project-automation bot moved this from In Review (Done) to In Review (WIP) in Hathor Network Jan 26, 2026
@jansegre jansegre merged commit be480c9 into master Jan 26, 2026
19 of 22 checks passed
@jansegre jansegre deleted the refactor/consensus-features branch January 26, 2026 14:54
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Jan 26, 2026
@glevco glevco restored the refactor/consensus-features branch January 26, 2026 14:56
@glevco glevco deleted the refactor/consensus-features branch January 26, 2026 14:57
This was referenced Jan 27, 2026
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Feb 4, 2026
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