Skip to content

refactor(storage): make indexes non-nullable#1543

Merged
glevco merged 1 commit intomasterfrom
refactor/require-indexes
Jan 20, 2026
Merged

refactor(storage): make indexes non-nullable#1543
glevco merged 1 commit intomasterfrom
refactor/require-indexes

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Jan 8, 2026

Depends on #1542

Motivation

Previous PR #1542 removed the cache storage, which was the only reason IndexesManager was nullable in the transaction storage. This PR addresses this, simplifying code, as it doesn't have to be nullable anymore. The MempoolTipsIndex is also required, but code unnecessarily treated it as optional.

Acceptance Criteria

  • Make IndexesManager non-nullable in the TransactionStorage.
    • Remove all the indexes is not None and not_none(indexes) assertions.
  • Make MempoolTipsIndex non-nullable in the IndexesManager.
    • Remove all the mempool_tips is not None and not_none(mempool_tips) assertions.
  • Remove some methods that are not necessary anymore: enable_mempool_index, force_clear_all, reset_indexes, and the _saving_genesis attribute.

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 8, 2026
@glevco glevco requested a review from jansegre as a code owner January 8, 2026 01:54
@glevco glevco requested a review from msbrogli as a code owner January 8, 2026 01:54
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network Jan 8, 2026
@glevco glevco force-pushed the refactor/cache-storage branch from 71225c6 to 4c3786c Compare January 8, 2026 03:01
@glevco glevco force-pushed the refactor/require-indexes branch from 2ec8c25 to f81696f Compare January 8, 2026 03:35
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jan 8, 2026
@glevco glevco moved this from In Progress (Done) to In Progress (WIP) in Hathor Network Jan 8, 2026
@glevco glevco force-pushed the refactor/require-indexes branch 2 times, most recently from bd714f8 to e74ba1a Compare January 8, 2026 14:27
@glevco glevco force-pushed the refactor/cache-storage branch 3 times, most recently from 8c2ab1b to ae67813 Compare January 8, 2026 14:44
@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.29%. Comparing base (42aa09a) to head (88f1696).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1543      +/-   ##
==========================================
+ Coverage   86.27%   86.29%   +0.02%     
==========================================
  Files         437      437              
  Lines       33708    33605     -103     
  Branches     5260     5247      -13     
==========================================
- Hits        29080    29001      -79     
+ Misses       3611     3599      -12     
+ Partials     1017     1005      -12     

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

@glevco glevco force-pushed the refactor/cache-storage branch 2 times, most recently from 507778d to d0984a1 Compare January 8, 2026 14:56
@glevco glevco force-pushed the refactor/require-indexes branch from e74ba1a to 2a11726 Compare January 8, 2026 15:03
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Jan 8, 2026
@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Jan 8, 2026
@glevco glevco force-pushed the refactor/cache-storage branch from d0984a1 to 3d67ff1 Compare January 8, 2026 19:06
@glevco glevco force-pushed the refactor/require-indexes branch from 2a11726 to f30598f Compare January 8, 2026 19:07
@glevco glevco force-pushed the refactor/cache-storage branch from 3d67ff1 to 8636b4a Compare January 8, 2026 20:30
@glevco glevco force-pushed the refactor/require-indexes branch 3 times, most recently from a2380e0 to 31e9bb0 Compare January 8, 2026 21:01
@glevco glevco force-pushed the refactor/require-indexes branch from 31e9bb0 to 65d948d Compare January 12, 2026 15:13
@glevco glevco force-pushed the refactor/cache-storage branch 6 times, most recently from ea0b002 to 0a281d2 Compare January 16, 2026 19:01
@glevco glevco force-pushed the refactor/require-indexes branch from 84423ec to b0f6fa0 Compare January 19, 2026 20:40
@glevco glevco force-pushed the refactor/cache-storage branch from 5d82f32 to 4c46ed8 Compare January 19, 2026 21:38
@glevco glevco force-pushed the refactor/require-indexes branch from b0f6fa0 to ba3cc55 Compare January 19, 2026 21:38
@glevco glevco force-pushed the refactor/cache-storage branch 4 times, most recently from 468afc4 to 80c5302 Compare January 20, 2026 18:50
Base automatically changed from refactor/cache-storage to master January 20, 2026 19:39
@glevco glevco dismissed stale reviews from jansegre and msbrogli January 20, 2026 19:39

The base branch was changed.

@glevco glevco moved this from In Review (Done) to Parking Lot in Hathor Network Jan 20, 2026
@glevco glevco moved this from Parking Lot to In Review (Done) in Hathor Network Jan 20, 2026
@glevco glevco force-pushed the refactor/require-indexes branch from ba3cc55 to 88f1696 Compare January 20, 2026 19:40
@github-actions
Copy link

🐰 Bencher Report

Branchrefactor/require-indexes
Testbedubuntu-22.04

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Lower Boundary
(Limit %)
sync-v2 (up to 20000 blocks)Latency
minutes (m)
📈 plot
🚷 threshold
🚨 alert (🔔)
1.36 m
(-20.86%)Baseline: 1.72 m
1.55 m
(113.72%)

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
🚨 view alert (🔔)
1.36 m
(-20.86%)Baseline: 1.72 m
1.55 m
(113.72%)

2.06 m
(65.95%)
🐰 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 20, 2026
@glevco glevco merged commit 33f0697 into master Jan 20, 2026
11 of 12 checks passed
@glevco glevco deleted the refactor/require-indexes branch January 20, 2026 20:58
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Jan 20, 2026
@jansegre jansegre mentioned this pull request Jan 20, 2026
2 tasks
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Jan 21, 2026
@jansegre jansegre mentioned this pull request Jan 21, 2026
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