Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add best_blockchain in /status payload #704

Merged
merged 5 commits into from
Aug 10, 2023

Conversation

alexruzenhack
Copy link
Contributor

@alexruzenhack alexruzenhack commented Jul 14, 2023

Motivation

Expose the best_blockchain through an interface.

Acceptance Criteria

  • Must return the peer_best_blockchain property in the connected_peer body when /status is requested
  • Must return the best_blockchain property in the dag when /status is requested
  • Make some adjustments in the test and fix some issues from the previews get_best_blockchain PR

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

Closes:

@alexruzenhack alexruzenhack self-assigned this Jul 14, 2023
@alexruzenhack alexruzenhack added the enhancement New feature or request label Jul 14, 2023
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from 0eef461 to d3c3a3a Compare July 14, 2023 02:41
@alexruzenhack alexruzenhack marked this pull request as ready for review July 14, 2023 16:42
@alexruzenhack alexruzenhack marked this pull request as draft July 14, 2023 16:42
@alexruzenhack alexruzenhack changed the base branch from master to feat/add-get-best-blockchain-capability July 14, 2023 16:43
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from d3c3a3a to b5a1084 Compare July 17, 2023 19:04
tests/test_utils/test_list.py Outdated Show resolved Hide resolved
tests/p2p/test_get_best_blockchain.py Outdated Show resolved Hide resolved
@alexruzenhack alexruzenhack force-pushed the feat/add-get-best-blockchain-capability branch 3 times, most recently from 32d03de to ff89803 Compare July 18, 2023 18:53
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from b5a1084 to d75e0ec Compare July 18, 2023 22:09
@alexruzenhack alexruzenhack force-pushed the feat/add-get-best-blockchain-capability branch 2 times, most recently from 887e94c to 53e6b6d Compare July 19, 2023 01:34
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch 2 times, most recently from ce42303 to cbe6045 Compare July 19, 2023 02:15
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #704 (17cdfe4) into master (97f2471) will increase coverage by 0.08%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##           master     #704      +/-   ##
==========================================
+ Coverage   84.52%   84.61%   +0.08%     
==========================================
  Files         253      252       -1     
  Lines       21708    21717       +9     
  Branches     2941     2941              
==========================================
+ Hits        18349    18376      +27     
+ Misses       2718     2705      -13     
+ Partials      641      636       -5     
Files Changed Coverage Δ
hathor/p2p/utils.py 73.87% <66.66%> (-1.40%) ⬇️
hathor/p2p/resources/status.py 100.00% <100.00%> (ø)
hathor/p2p/states/ready.py 93.89% <100.00%> (-0.05%) ⬇️

... and 3 files with indirect coverage changes

@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from cbe6045 to 4924993 Compare July 19, 2023 17:06
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch 2 times, most recently from 8e01316 to 1a9a59a Compare July 19, 2023 17:48
@alexruzenhack alexruzenhack requested a review from msbrogli July 19, 2023 17:57
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from 1a9a59a to dace9f9 Compare July 19, 2023 21:31
@alexruzenhack alexruzenhack force-pushed the feat/add-get-best-blockchain-capability branch from 53e6b6d to 4906761 Compare July 20, 2023 16:14
@alexruzenhack alexruzenhack force-pushed the feat/add-get-best-blockchain-capability branch from d234777 to 4752c03 Compare July 27, 2023 14:17
@msbrogli msbrogli force-pushed the feat/add-get-best-blockchain-capability branch from b41bcca to 949d09c Compare July 27, 2023 21:09
@alexruzenhack alexruzenhack force-pushed the feat/add-get-best-blockchain-capability branch 2 times, most recently from e05fdaf to 78d3fad Compare July 27, 2023 21:22
Base automatically changed from feat/add-get-best-blockchain-capability to master July 28, 2023 12:17
@alexruzenhack alexruzenhack dismissed stale reviews from msbrogli and jansegre July 28, 2023 12:17

The base branch was changed.

@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch 2 times, most recently from 08f5079 to 06644a8 Compare July 28, 2023 13:30
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from 06644a8 to a3318d4 Compare July 28, 2023 13:36
hathor/p2p/utils.py Show resolved Hide resolved
msbrogli
msbrogli previously approved these changes Aug 3, 2023
hathor/p2p/utils.py Show resolved Hide resolved
hathor/p2p/resources/status.py Outdated Show resolved Hide resolved
@alexruzenhack alexruzenhack force-pushed the feat/status-best-blockchain-in-connected-peers branch from 6dcc3a4 to 8ab76c4 Compare August 3, 2023 16:36
@alexruzenhack alexruzenhack requested a review from msbrogli August 3, 2023 16:36
@pedroferreira1 pedroferreira1 self-requested a review August 7, 2023 18:37
@alexruzenhack alexruzenhack enabled auto-merge (squash) August 10, 2023 21:47
@alexruzenhack alexruzenhack merged commit 3b02e6c into master Aug 10, 2023
@alexruzenhack alexruzenhack deleted the feat/status-best-blockchain-in-connected-peers branch August 10, 2023 21:48
This was referenced Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants