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

Fixes in peer and handler and delete cache of sc at start #3915

Merged
merged 35 commits into from
May 8, 2023

Conversation

AurelienFT
Copy link
Contributor

@AurelienFT AurelienFT commented May 5, 2023

πŸ€– Generated by Copilot at 6910564

Summary

πŸ› οΈ,πŸ“,πŸš€,

This pull request introduces new features and improvements for the protocol layer of the Massa project, such as peer categories, connection management, version compatibility, and bootstrap file format. It also updates some constants, dependencies, and configuration files to prepare for testing and deployment. It affects the massa-node, massa-protocol-worker, massa-protocol-exports, and massa-models crates, as well as some GitHub workflow and base config files.

We are the peers of the protocol
We connect and reject by the PeerCategory
We test and handshake with the Version
We are the peers of the protocol

Walkthrough

  • Add a new dependency for assembling x86_64 binaries to the GitHub workflow file (link)
  • Update the protocol version to TEST.22.1 and the genesis end and endorsement timestamps in the constants file (link, link, link)
  • Update the version field in the openrpc file to match the protocol version (link)
  • Add Clone trait to Version and VersionParseError structs and modify the is_compatible method of Version to require a minimum minor version of 1 (link, link, link)
  • Replace max_in_connections and max_out_connections options with try_connection_timer, timeout_connection, and peers_categories options in the config file and the protocol configuration structs (link, link, link, link, link, link, link, link)
  • Update the format of the initial peers file to include listeners and category fields for each peer (link, link)
  • Update the dependency on the peernet crate to a newer revision in the massa-node, massa-protocol-exports, and massa-protocol-worker crates (link, link, link)
  • Add a network field to the Settings struct to store the network-related settings, such as the routable_ip option (link, link)
  • Remove the hd_cache_path directory if the keep_ledger or restart_from_snapshot_at_period arguments are false in the main file (link)
  • Include the version in the handshake and the messages, and check the compatibility with the local version, using the VersionSerializer and VersionDeserializer structs in the peer handler and tester modules (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Implement the peer selection and connection management logic based on peer categories and available slots in the connectivity, peer handler, and tester modules, using the target_out_connections, default_target_out_connections, and peers_categories fields (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Handle the case where the peer does not have a slot for the connection and does not send an announcement, by returning an error or sending a message that the connection is refused, in the connectivity and peer handler modules (link, link, , link, link)
  • Add a tested_addresses field to the PeerDB struct to store the last tested time for each address, and use a cooldown mechanism to avoid testing the same address too often, in the peer handler and tester modules (link, link, link)
  • Add a comment to the get_rand_peers_to_send method of the PeerDB struct to suggest adding the local peer to the vector (link)
  • Update the file header comment in the changes.rs file to use the Rust doc comment syntax (link)
  • Clone the endpoint in the send_list_peers function of the PeerManagementHandler struct to avoid blocking the main thread, and add error handling for the serialization and sending operations (link)

@AurelienFT AurelienFT requested a review from damip May 5, 2023 22:58
@AurelienFT AurelienFT changed the title Errors in fallback function doesn't panic Fixes in peer and handler and delete cache of sc at start May 6, 2023
massa-node/src/main.rs Outdated Show resolved Hide resolved
@AurelienFT AurelienFT requested a review from damip May 6, 2023 23:44
@AurelienFT AurelienFT mentioned this pull request May 7, 2023
@AurelienFT
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented May 8, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 08c3593 into main May 8, 2023
@AurelienFT AurelienFT deleted the debug_peer_handler branch May 29, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants