Skip to content

feat(p2p): add commands to query the nano state of a peer#1411

Merged
jansegre merged 1 commit intomasterfrom
feat/p2p/nano-state-commands
Sep 18, 2025
Merged

feat(p2p): add commands to query the nano state of a peer#1411
jansegre merged 1 commit intomasterfrom
feat/p2p/nano-state-commands

Conversation

@jansegre
Copy link
Member

@jansegre jansegre commented Sep 12, 2025

Motivation

Currently there's no way to check whether 2 peers have the same nano-state.

Acceptance Criteria

  • Add 2 sets of commands:
    • GET_BLOCK_NC_ROOT_ID/BLOCK_NC_ROOT_ID to query the root node-id of a given block-hash
    • GET_NC_DB_NODE/NC_DB_NODE to query the node-data of a given node-id, a maximal response has about 34478 bytes which fits into the protocol max line length limit of ~65KB

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 self-assigned this Sep 12, 2025
@jansegre jansegre moved this from Todo to In Progress (WIP) in Hathor Network Sep 12, 2025
@github-actions
Copy link

github-actions bot commented Sep 12, 2025

🐰 Bencher Report

Branchfeat/p2p/nano-state-commands
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.99 m
(+17.73%)Baseline: 1.69 m
1.52 m
(76.45%)
2.03 m
(98.10%)
🐰 View full continuous benchmarking report in Bencher

@jansegre jansegre force-pushed the feat/p2p/nano-state-commands branch from de05263 to 59d802f Compare September 12, 2025 17:20
@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 55.67010% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.84%. Comparing base (8f23d02) to head (f48640d).

Files with missing lines Patch % Lines
hathor/p2p/states/ready.py 51.13% 35 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1411      +/-   ##
==========================================
- Coverage   86.03%   85.84%   -0.20%     
==========================================
  Files         432      432              
  Lines       32822    32917      +95     
  Branches     5114     5125      +11     
==========================================
+ Hits        28239    28257      +18     
- Misses       3575     3634      +59     
- Partials     1008     1026      +18     

☔ 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 mentioned this pull request Sep 17, 2025
2 tasks
@jansegre jansegre force-pushed the feat/p2p/nano-state-commands branch from 59d802f to f0563b6 Compare September 17, 2025 18:10
@jansegre jansegre moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Sep 17, 2025
@jansegre jansegre marked this pull request as ready for review September 17, 2025 18:19
@jansegre jansegre requested a review from msbrogli as a code owner September 17, 2025 18:19
msbrogli
msbrogli previously approved these changes Sep 17, 2025
@jansegre jansegre force-pushed the feat/p2p/nano-state-commands branch from f0563b6 to f48640d Compare September 17, 2025 20:29
@jansegre jansegre requested review from glevco and msbrogli September 17, 2025 20:31
@jansegre jansegre moved this from In Progress (Done) to In Review (WIP) in Hathor Network Sep 17, 2025
@jansegre jansegre force-pushed the feat/p2p/nano-state-commands branch from f48640d to 17f0e9a Compare September 18, 2025 16:24
msbrogli
msbrogli previously approved these changes Sep 18, 2025
msbrogli
msbrogli previously approved these changes Sep 18, 2025
@jansegre jansegre force-pushed the feat/p2p/nano-state-commands branch from 0d34dc3 to a191628 Compare September 18, 2025 20:06
@jansegre jansegre merged commit 8d0136d into master Sep 18, 2025
5 of 7 checks passed
@jansegre jansegre deleted the feat/p2p/nano-state-commands branch September 18, 2025 20:07
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Sep 18, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Sep 18, 2025
@jansegre jansegre mentioned this pull request Sep 24, 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.

2 participants