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(test): impl routing table test #1005

Merged
merged 12 commits into from
Nov 27, 2023

Conversation

RolandSherwin
Copy link
Member

@RolandSherwin RolandSherwin commented Nov 23, 2023

Description

Summary generated by Reviewpad on 23 Nov 23 16:57 UTC

This pull request includes the following changes:

  1. In the file rpc_service.rs:

    • Added a new import statement for k_buckets_response in the safenode_proto module.
    • Added a new method k_buckets for handling the RPC request for KBucketsRequest.
    • Updated the record_addresses method to return a response containing addresses.
  2. In the file msgs_over_gossipsub.rs:

    • Added imports for HashMap and HashSet.
    • Added a new get_kbuckets method that returns a map of ilog2 distance of the Kbucket to the peers in that bucket.
    • Updated the RunningNode struct implementation with the new method get_kbuckets.
    • Added documentation for the new method get_kbuckets.
    • Added a call to self.network.get_kbuckets().await? in the get_kbuckets method.
    • Updated the subscribe_to_topic method signature to take a String parameter instead of a &str.
  3. In the file lib.rs:

    • Added a new method get_kbuckets to the Network struct. This method returns a map of ilog2 distance of the Kbucket to the peers in that bucket.
    • The get_kbuckets method uses a channel to communicate with the swarm and fetches the map of Kbucket distances. If there is an error in receiving the result, it returns an InternalMsgChannelDropped error.
  4. In the file ".github/workflows/merge.yml":

    • Renamed the job "verify_data_location" to "verify_data_location_routing_table".
    • Updated the name and run command of the step "Build data location test" to "Build data location and routing table tests".
    • Added a new step "Verify the Routing table of the nodes" with a corresponding run command.
    • Updated the timeout-minutes value for the step "Verify the Routing table of the nodes" to 5 minutes.
    • Adjusted the timeout-minutes value for the step "Verify the location of the data on the network" to 5 minutes.
  5. In the file "req_resp_types.proto":

    • Added the messages KBucketsRequest, KBucketsResponse, and a nested message Peers within KBucketsResponse.
    • Updated the existing messages in the file to include the new messages at the appropriate position.
  6. In the file "common.rs":

    • Imported get_all_peer_ids, NODE_COUNT, and PAYING_WALLET_INITIAL_BALANCE.
    • Changed the type of NodeIndex from u8 to u32.
    • Removed the get_all_peer_ids function and its implementation.
    • Updated the verify_location function to use the get_all_peer_ids function directly rather than importing it.
    • Removed the comment explaining the purpose of the get_all_peer_ids function.
    • Updated the comment explaining the purpose of the CHUNK_COUNT constant.
    • Removed the CHURN_COUNT constant.
    • Updated the type of NodeIndex from u8 to u32 in the RecordHolders type alias.
    • Updated the return type of the verify_location function to Result<()>.
    • Removed the get_all_peer_ids function definition.
    • Updated the get_all_peer_ids function call to use a direct URL string rather than formatting it.
    • Removed the println! statement in the get_all_peer_ids function.
    • Removed the comment explaining the purpose of the store_chunks function.
    • Removed the unused wallet_dir parameter in the store_chunks function.

Please let me know if you need further assistance with this pull request.

@reviewpad reviewpad bot requested a review from joshuef November 23, 2023 16:57
@reviewpad reviewpad bot added Medium Medium sized PR waiting-for-review labels Nov 23, 2023
@RolandSherwin RolandSherwin force-pushed the routing_table_test branch 3 times, most recently from ad2207f to e059e43 Compare November 23, 2023 17:33
@joshuef joshuef enabled auto-merge November 24, 2023 08:34
@reviewpad reviewpad bot added Large Large sized PR and removed Medium Medium sized PR labels Nov 24, 2023
@RolandSherwin RolandSherwin force-pushed the routing_table_test branch 4 times, most recently from 1c35aa6 to 1a81f67 Compare November 24, 2023 16:39
sn_node/tests/verify_routing_table.rs Outdated Show resolved Hide resolved
sn_networking/src/network_discovery.rs Outdated Show resolved Hide resolved
sn_networking/src/bootstrap.rs Show resolved Hide resolved
sn_networking/src/bootstrap.rs Outdated Show resolved Hide resolved
sn_networking/src/lib.rs Outdated Show resolved Hide resolved
@joshuef joshuef added this pull request to the merge queue Nov 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2023
@RolandSherwin RolandSherwin added this pull request to the merge queue Nov 27, 2023
Merged via the queue into maidsafe:main with commit 4360c79 Nov 27, 2023
28 checks passed
@RolandSherwin RolandSherwin deleted the routing_table_test branch November 27, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Large Large sized PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants