Skip to content

hathorlib blueprint move 2#1606

Merged
r4mmer merged 20 commits intomasterfrom
feat/hathorlib-blueprint-move-2
Mar 5, 2026
Merged

hathorlib blueprint move 2#1606
r4mmer merged 20 commits intomasterfrom
feat/hathorlib-blueprint-move-2

Conversation

@r4mmer
Copy link
Member

@r4mmer r4mmer commented Feb 26, 2026

Motivation

To be able to implement the blueprint simulator on hathorlib there is a significant amount of code that needs to be moved from hathor/ to hathorlib/.
Since moving this amount of code can cause instabilities we are breaking down these changes into more manageable and reviewable PRs.

This is the second PR in this sequence.

Acceptance Criteria

  • Move nanocontracts exception hierarchy to hathorlib
  • Move core types, decorators, and address utilities to hathorlib

Extra context


Important note about HathorError: NCFail MUST inherit from HathorError because NCFailsubclasses (e.g.,OCBInvalidScript, OCBPubKeyNotAllowed, NCInvalidSignature, NCInvalidPubKey) are raised during OnChainBlueprint verification (on_chain_blueprint_verifier.py) and propagate directly to vertex_handler.py:214where they are caught byexcept HathorError. If NCFaildid not inherit fromHathorError`, these exceptions would escape the catch block and cause unhandled errors.

Therefore, both NCFail and HathorError must be moved to hathorlib.


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

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

🐰 Bencher Report

Branchfeat/hathorlib-blueprint-move-2
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.66 m
(-3.20%)Baseline: 1.71 m
1.54 m
(92.98%)
2.05 m
(80.66%)
🐰 View full continuous benchmarking report in Bencher

@r4mmer r4mmer moved this from Todo to In Progress (WIP) in Hathor Network Feb 26, 2026
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.46%. Comparing base (ac98edd) to head (5fd4618).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
hathor/transaction/scripts/opcode.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1606      +/-   ##
==========================================
- Coverage   85.58%   85.46%   -0.12%     
==========================================
  Files         449      449              
  Lines       33946    33537     -409     
  Branches     5309     5262      -47     
==========================================
- Hits        29051    28661     -390     
+ Misses       3872     3853      -19     
  Partials     1023     1023              
Flag Coverage Δ
test-lib 85.46% <91.30%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@r4mmer r4mmer moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Mar 2, 2026
@github-project-automation github-project-automation bot moved this from In Progress (Done) to In Review (WIP) in Hathor Network Mar 3, 2026
@r4mmer r4mmer requested review from glevco and msbrogli March 4, 2026 16:26
msbrogli
msbrogli previously approved these changes Mar 4, 2026
r4mmer added 3 commits March 5, 2026 11:35
… into feat/hathorlib-blueprint-move-2

* origin/feat/hathorlib-blueprint-move-2:
  refactor(vertex-parser): Move serialization and deserialization to vertex parser module
@r4mmer r4mmer requested a review from msbrogli March 5, 2026 16:20
@glevco glevco moved this from In Review (WIP) to In Review (Done) in Hathor Network Mar 5, 2026
@r4mmer r4mmer merged commit 49fcf9e into master Mar 5, 2026
83 of 87 checks passed
@r4mmer r4mmer deleted the feat/hathorlib-blueprint-move-2 branch March 5, 2026 23:12
@github-project-automation github-project-automation bot moved this from In Review (Done) to Waiting to be deployed in Hathor Network Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting to be deployed

Development

Successfully merging this pull request may close these issues.

3 participants