Skip to content

refactor(p2p): use PeerId type instead of str#1114

Merged
jansegre merged 1 commit intomasterfrom
refactor/p2p-peer-use-peer-id
Aug 22, 2024
Merged

refactor(p2p): use PeerId type instead of str#1114
jansegre merged 1 commit intomasterfrom
refactor/p2p-peer-use-peer-id

Conversation

@jansegre
Copy link
Member

Motivation

This is the second refactor in this series. It makes it so Peer.id is a PeerId instead of a str, that way it is already checked to be a valid hash.

Acceptance Criteria

  • Change the type of hathor.p2p.peer.Peer.id from str to hathor.p2p.peer_id.PeerId

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 August 19, 2024 18:42
@jansegre jansegre self-assigned this Aug 19, 2024
@jansegre jansegre force-pushed the refactor/p2p-rename-peer-id branch 2 times, most recently from 945e51d to eb6c3d7 Compare August 20, 2024 21:06
@jansegre jansegre force-pushed the refactor/p2p-peer-use-peer-id branch from 9c218c4 to 255b1d4 Compare August 20, 2024 21:23
@codecov
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 98.07692% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.88%. Comparing base (2c817fd) to head (ada19b8).
Report is 2 commits behind head on master.

Files Patch % Lines
hathor/p2p/utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1114      +/-   ##
==========================================
+ Coverage   84.83%   84.88%   +0.05%     
==========================================
  Files         315      316       +1     
  Lines       24071    24079       +8     
  Branches     3647     3645       -2     
==========================================
+ Hits        20421    20440      +19     
+ Misses       2936     2924      -12     
- Partials      714      715       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

glevco
glevco previously approved these changes Aug 22, 2024
msbrogli
msbrogli previously approved these changes Aug 22, 2024
@jansegre jansegre force-pushed the refactor/p2p-rename-peer-id branch from eb6c3d7 to f2c436f Compare August 22, 2024 14:02
Base automatically changed from refactor/p2p-rename-peer-id to master August 22, 2024 14:43
@jansegre jansegre dismissed stale reviews from msbrogli and glevco August 22, 2024 14:43

The base branch was changed.

@jansegre jansegre force-pushed the refactor/p2p-peer-use-peer-id branch from 255b1d4 to ada19b8 Compare August 22, 2024 14:45
@github-actions
Copy link

🐰Bencher

ReportThu, August 22, 2024 at 14:47:51 UTC
Projecthathor-core
Branchrefactor/p2p-peer-use-peer-id
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Lower Boundary
nanoseconds (ns) | (%)
Latency Upper Boundary
nanoseconds (ns) | (%)
sync-v2 (up to 20000 blocks)✅ (view plot)104,022,524,163.80 (+0.99%)92,698,520,376.58 (89.11%)113,298,191,571.37 (91.81%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@jansegre jansegre merged commit 9bce2fa into master Aug 22, 2024
@jansegre jansegre deleted the refactor/p2p-peer-use-peer-id branch August 22, 2024 16:33
@jansegre jansegre mentioned this pull request Oct 4, 2024
2 tasks
@jansegre jansegre mentioned this pull request Dec 11, 2024
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