-
Notifications
You must be signed in to change notification settings - Fork 711
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
Testnet 22 #3789
Merged
Merged
Testnet 22 #3789
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: sydhds <sd@massa.net>
* Initial code to add denunciations in block header * Early removal use of DenunciationPool in DenunciationFactory * Revert "Early removal use of DenunciationPool in DenunciationFactory" This reverts commit 4d4447f. * Restore assert_invariants * Restore assert_invariants (round 2) --------- Co-authored-by: sydhds <sydhds@gmail.com>
* Initial code to add denunciations in block header * Early removal use of DenunciationPool in DenunciationFactory * Revert "Early removal use of DenunciationPool in DenunciationFactory" This reverts commit 4d4447f. * Restore assert_invariants * Restore assert_invariants (round 2) * Remove DenunciationFactory and move eveything in DenunciationPool * Add denunciation pool unit tests * Merge caches in DenunciationPool * Now send endorsements directly to denunciation pool * Minor fix * Do not feed de pool from endorsement pool anymore * Add more documentation in DenunciationPool * Fix crossbeam channel dependency (only for tests) --------- Co-authored-by: sydhds <sydhds@gmail.com>
* add max_coins to executesc * debug test * remove outdated comment * Fix test compilation * Added max_coins to API * Fix test compilation --------- Co-authored-by: AurelienFT <32803821+AurelienFT@users.noreply.github.com> Co-authored-by: AurelienFT <aurelien.foucault@epitech.eu>
* Add initial code in order to process denunciation * Initial code to slash into deferred credits * Add SlashError variant in ExecutionError * Add 2 unit tests, processing denunciations and checking the results * Remove some debug statements * Fix slash in deferred credits * Return the amount slashed and not the remaining amount to slash --------- Co-authored-by: sydhds <sydhds@gmail.com>
3846: Improve estimate instant r=damip a=damip Change following Security analysis. This avoids potential overflows of Instant on certain platforms. * [x] document all added functions * [x] try in sandbox /simulation/labnet * [x] unit tests on the added/changed features * [x] make tests compile * [x] make tests pass * [x] add logs allowing easy debugging in case the changes caused problems * [x] if the API has changed, update the API specification <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at e1323db</samp> ### Summary 🔧🧮🚫 <!-- 1. 🔧 Refactor: This emoji indicates that the code was restructured or improved without changing its functionality or behavior. Refactoring is often done to make the code more readable, maintainable, or efficient. 2. 🧮 Math: This emoji indicates that the code involves some mathematical operations or logic, such as arithmetic, algebra, geometry, or statistics. Math is often used to perform calculations, manipulate data, or implement algorithms. 3. 🚫 Error: This emoji indicates that the code handles or prevents some kind of error, exception, or failure. Error handling is often done to ensure the code is robust, reliable, and safe. --> Refactored `estimate_instant` method in `massa-time` to use saturating arithmetic. This simplifies the code and prevents underflow errors. > _`estimate_instant`_ > _Saturates, not checks, the time_ > _Autumn leaves no errors_ ### Walkthrough * Refactor `estimate_instant` to use saturating arithmetic instead of checked arithmetic ([link](https://github.com/massalabs/massa/pull/3846/files?diff=unified&w=0#diff-6d76059ef152a7cda280d90a5b0475e17aaa816d7d182b36f6d106fa7e8be470L263-R269)). This simplifies the code and avoids potential underflow errors when subtracting two `MassaTime` values. Co-authored-by: damip <damipator@gmail.com>
* Check for already processed denunciations in execution worker * Do more checks before processing a denunciation * Rework checks for processed denunciations * More renaming 'de' => 'denunciation' * Processed denunciation -> executed denunciation (round 1) * Processed denunciation -> executed denunciation (round 2) * Cargo fmt pass --------- Co-authored-by: sydhds <sydhds@gmail.com>
Co-authored-by: sydhds <sydhds@gmail.com>
* Add denunciations in block header * Fix unit tests after rebase * Rework DenunciationIndex ordering * Rework usage of Denunciation::is_expired(..) * More use of Denunciation::is_expired * Fixes for Denunciation expiration * Cargo clippy fix --------- Co-authored-by: sydhds <sydhds@gmail.com>
Add two extra saved cycles to PoS for denunciations checks
Co-authored-by: sydhds <sydhds@gmail.com>
* Migrate in ip-versioning solutions when creating listener * Migrate establisher code to more relevant files
Introduce support for SC written in other language than AS. Legacy format is still supported. related to massalabs/massa-sc-runtime#235 Co-authored-by: Damir Vodenicarevic <damipator@gmail.com>
* Don't send listeners if non routable and use canonical * Add comment hacky on tester.
Co-authored-by: sydhds <sydhds@gmail.com>
Eitu33
previously approved these changes
May 4, 2023
bors merge |
bors bot
added a commit
that referenced
this pull request
May 4, 2023
3789: Testnet 22 r=AurelienFT a=AurelienFT <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at deb5818</samp> ### Summary 🧹🔑🔄 <!-- 1. 🧹 - This emoji represents the removal of unused or unnecessary dependencies and code, which can be seen as a form of cleaning or tidying up the project. 2. 🔑 - This emoji represents the addition of the node signature feature, which involves using a keypair to sign and verify private API messages, enhancing the security and authenticity of the communication. 3. 🔄 - This emoji represents the update and adaptation of the API and network components to the new architecture and protocol interface, which can be seen as a form of changing or updating the code to match the new design. --> This pull request implements the network refactoring and the node signature feature for the `massa-api` component. It also adds a `max_coins` field to the `OperationInput` struct and a `last_de_step` field to the bootstrap time message. It removes unused dependencies and simplifies the error handling and the bootstrap server logic. It affects the following files: `massa-api-exports/src/config.rs`, `massa-api-exports/src/error.rs`, `massa-api-exports/src/operation.rs`, `massa-api/Cargo.toml`, `massa-api/src/lib.rs`, `massa-api/src/private.rs`, `massa-api/src/public.rs`, `massa-bootstrap/src/messages.rs`, `massa-bootstrap/src/server_binder.rs`, `massa-bootstrap/src/server/white_black_list.rs`, `massa-bootstrap/src/establisher.rs`, `Cargo.toml`, and `massa-api-exports/Cargo.toml`. > _We're breaking free from the old network chains_ > _We're simplifying the code and the errors_ > _We're signing our messages with our own keys_ > _We're synchronizing our steps with our peers_ ### Walkthrough * Remove dependencies on `massa-network-worker` and `massa-network-exports` crates, which are no longer used after the network refactoring ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L21-L22), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-2959d6fef477da4a71811ca94245288a9c1e687d27eb49df9e4e518299e74418L23), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-be015cdf8704641ee1b0d76a224fa824f8cc65247b118c10a7078e45a8533b35L11), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-be015cdf8704641ee1b0d76a224fa824f8cc65247b118c10a7078e45a8533b35L30-L31), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-be015cdf8704641ee1b0d76a224fa824f8cc65247b118c10a7078e45a8533b35L68), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-1af91190966c29d2c4636cd9f9d4f909f82b8b7c52aec79d094a805294697085L26), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL37-R39), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL67-R74), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL84-R82), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L31-R32), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L36-R36), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L57-R58)) * Add dependency on `massa-signature` crate to use the `KeyPair` type for the API keypair configuration and the `PublicKey` and `PUBLIC_KEY_SIZE_BYTES` types for the node ban and unban features and the node status feature ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c6bbc12efc4e84178e7e0dccfd43b57cc8cb3425f0b003a85f9e3cdb197f188cR3), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3R21), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L31-R32), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L36-R36), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L57-R58)) * Add dependency on `massa-models` crate to use the `Amount` type for the max coins configuration ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-d29f8d12abf345eb45db7b9dfda4d03e121bca9e404626af4f21450ee8c1e819L71-R74)) * Add dependency on `massa-hash` crate to use the `Hash` type for the node signature feature ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-1af91190966c29d2c4636cd9f9d4f909f82b8b7c52aec79d094a805294697085L35-L33), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3R21), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L57-R58)) * Add dependency on `massa-protocol-exports` crate to provide the interface to the protocol component ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL37-R39), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L31-R32), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L36-R36)) * Add a new field `keypair` to the `APIConfig` struct, which holds the keypair used by the node to sign messages for the private API ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c6bbc12efc4e84178e7e0dccfd43b57cc8cb3425f0b003a85f9e3cdb197f188cR70-R71)) * Add a new field `max_coins` to the `OperationInput` struct, which holds the maximum amount of coins that can be transferred in a single operation ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-d29f8d12abf345eb45db7b9dfda4d03e121bca9e404626af4f21450ee8c1e819R81)) * Add a new field `last_de_step` to the `BootstrapServerMessage::BootstrapTime` variant, which represents the last received executed denunciations associated slot ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R631-R632), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R729), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R746), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R892), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R917-R919), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R935), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-41607f7ffed8d02fd90cdd3df790dec7da29fb51656780c87efca2242a0f5728R946)) * Replace the implementation of the `node_sign_message` function of the `Private` struct, which uses the keypair from the API settings to sign the message hash and returns the public key and signature as a `PubkeySig` struct ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L89-R105)) * Replace the implementation of the `node_ban_by_id`, `node_unban_by_id`, `node_ban_by_ip`, and `node_unban_by_ip` functions of the `Private` struct, which use the protocol controller to ban or unban peers by their peer ids ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L138-R209)) * Replace the implementation of the `node_peers_whitelist`, `node_add_to_peers_whitelist`, and `node_remove_from_peers_whitelist` functions of the `Private` struct, which return an error indicating that they are not available for now ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L222-R297)) * Replace the `async` imports of `AsyncReadExt` and `AsyncWriteExt` from `tokio::io` with the `sync` imports of `Read` and `Write` from `std::io` in the `server_binder` module ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL19-R26)) * Replace the `duplex` field of the `BootstrapServerBinder` struct from a generic type `D` that implements `Duplex` to a concrete type `TcpStream` and remove the `Limiter` wrapper ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL37-R35), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL44-R42), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL52-R53), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL68-R67)) * Replace the `async` methods of the `BootstrapServerBinder` struct with `sync` methods that take optional `Duration` parameters and use blocking IO instead of async IO ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL79-R83), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL88-R91), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL105-R125), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL120-R136), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL149-R177), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL185-R211), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL202-R239), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL216-R257)) * Remove the `server_outer_rt_hnd` parameter from the `BootstrapServerBinder::close_and_send_error` method ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL120-R136)) * Remove the `Box` wrapper from the `Result` types returned by the `SharedWhiteBlackList` and `WhiteBlackListInner` methods ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL27-R27), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL44-R41), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL70-R67), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL82-R80), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL94-R92), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL110-R103), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-6eb54fbc36294a88123d5489e54673ade6e4afe8b45c1aac39df00b1ada8704cL120-R113)) * Remove the `&` reference from the `msg_bytes` argument in the `extend`, `compute_from`, and `deserialize` methods in the `BootstrapServerBinder::next_timeout` method ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL240-R276), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL253-R285)) * Remove the unused imports of `Duplex` from `establisher` and `Limiter`, `Resource` and `StandardClock` from `async_speed_limit` in the `server_binder` module ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL4), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-c466f10d83d65872818177400869847c2fb10f2d07937e0b79be0659d80f8ecbL10-L11)) * Remove the `network_settings`, `network_command_sender`, and `protocol_command_sender` fields from the `Public` struct and the `network_command_sender` field from the `Private` struct and replace them with the `protocol_controller` and `protocol_config` fields ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL67-R74), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-b221394fc05ee73e5759394fd6b5e2e3b64665df85e1921cb779ea3a960b5ffcL84-R82), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L47-R47), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L55-R55), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L84-R87)) * Remove the `network_settings`, `network_command_sender`, and `protocol_command_sender` parameters from the `new` function of the `Public` struct and the `network_command_sender` parameter from the `new` function of the `Private` struct and replace them with the `protocol_controller` and `protocol_config` parameters ( [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L47-R47), [link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-05bc7781e17033a0835212792e1acfd48ff78d9d6e07aff848519c5e3ba016b1L73-R74)) * Remove the unused import of `itertools` from the `massa-api/src/private.rs` file ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-cd4f41c909f44d643e1f76870f7f75ff91d50d28240998b23795e3f314e4a3a3L6)) * Remove the file `massa-bootstrap/src/establisher.rs`, which was no longer used after the network refactoring ([link](https://github.com/massalabs/massa/pull/3789/files?diff=unified&w=0#diff-4ba6a8d2fcf0282e4616dd00a1667f7cb0be0dbd2cc76beb32a66dacf1442916)) Co-authored-by: Sydhds <sylvain.delhomme@gmail.com> Co-authored-by: Moncef AOUDIA <22281426+aoudiamoncef@users.noreply.github.com> Co-authored-by: AurelienFT <32803821+AurelienFT@users.noreply.github.com> Co-authored-by: AurelienFT <aurelien.foucault@epitech.eu> Co-authored-by: Modship <yeskinokay@gmail.com> Co-authored-by: Ben <benphawke@gmail.com> Co-authored-by: JF <jfm@laposte.net> Co-authored-by: Modship <lu@massa.net> Co-authored-by: Damir Vodenicarevic <damipator@gmail.com> Co-authored-by: damip <damipator@gmail.com> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Thomas Plisson <thomas.plisson@epitech.eu> Co-authored-by: Eitu33 <89928840+Eitu33@users.noreply.github.com>
Canceled. |
Eitu33
approved these changes
May 4, 2023
bors merge |
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. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Generated by Copilot at deb5818
Summary
🧹🔑🔄
This pull request implements the network refactoring and the node signature feature for the
massa-api
component. It also adds amax_coins
field to theOperationInput
struct and alast_de_step
field to the bootstrap time message. It removes unused dependencies and simplifies the error handling and the bootstrap server logic. It affects the following files:massa-api-exports/src/config.rs
,massa-api-exports/src/error.rs
,massa-api-exports/src/operation.rs
,massa-api/Cargo.toml
,massa-api/src/lib.rs
,massa-api/src/private.rs
,massa-api/src/public.rs
,massa-bootstrap/src/messages.rs
,massa-bootstrap/src/server_binder.rs
,massa-bootstrap/src/server/white_black_list.rs
,massa-bootstrap/src/establisher.rs
,Cargo.toml
, andmassa-api-exports/Cargo.toml
.Walkthrough
massa-network-worker
andmassa-network-exports
crates, which are no longer used after the network refactoring (link, link, link, link, link, link, link, link, link, link, link, link)massa-signature
crate to use theKeyPair
type for the API keypair configuration and thePublicKey
andPUBLIC_KEY_SIZE_BYTES
types for the node ban and unban features and the node status feature (link, link, link, link, link)massa-models
crate to use theAmount
type for the max coins configuration (link)massa-hash
crate to use theHash
type for the node signature feature (link, link, link)massa-protocol-exports
crate to provide the interface to the protocol component (link, link, link)keypair
to theAPIConfig
struct, which holds the keypair used by the node to sign messages for the private API (link)max_coins
to theOperationInput
struct, which holds the maximum amount of coins that can be transferred in a single operation (link)last_de_step
to theBootstrapServerMessage::BootstrapTime
variant, which represents the last received executed denunciations associated slot (link, link, link, link, link, link, link)node_sign_message
function of thePrivate
struct, which uses the keypair from the API settings to sign the message hash and returns the public key and signature as aPubkeySig
struct (link)node_ban_by_id
,node_unban_by_id
,node_ban_by_ip
, andnode_unban_by_ip
functions of thePrivate
struct, which use the protocol controller to ban or unban peers by their peer ids (link)node_peers_whitelist
,node_add_to_peers_whitelist
, andnode_remove_from_peers_whitelist
functions of thePrivate
struct, which return an error indicating that they are not available for now (link)async
imports ofAsyncReadExt
andAsyncWriteExt
fromtokio::io
with thesync
imports ofRead
andWrite
fromstd::io
in theserver_binder
module (link)duplex
field of theBootstrapServerBinder
struct from a generic typeD
that implementsDuplex
to a concrete typeTcpStream
and remove theLimiter
wrapper (link, link, link, link)async
methods of theBootstrapServerBinder
struct withsync
methods that take optionalDuration
parameters and use blocking IO instead of async IO (link, link, link, link, link, link, link, link)server_outer_rt_hnd
parameter from theBootstrapServerBinder::close_and_send_error
method (link)Box
wrapper from theResult
types returned by theSharedWhiteBlackList
andWhiteBlackListInner
methods (link, link, link, link, link, link, link)&
reference from themsg_bytes
argument in theextend
,compute_from
, anddeserialize
methods in theBootstrapServerBinder::next_timeout
method (link, link)Duplex
fromestablisher
andLimiter
,Resource
andStandardClock
fromasync_speed_limit
in theserver_binder
module (link, link)network_settings
,network_command_sender
, andprotocol_command_sender
fields from thePublic
struct and thenetwork_command_sender
field from thePrivate
struct and replace them with theprotocol_controller
andprotocol_config
fields (link, link, link, link, link)network_settings
,network_command_sender
, andprotocol_command_sender
parameters from thenew
function of thePublic
struct and thenetwork_command_sender
parameter from thenew
function of thePrivate
struct and replace them with theprotocol_controller
andprotocol_config
parameters ( link, link)itertools
from themassa-api/src/private.rs
file (link)massa-bootstrap/src/establisher.rs
, which was no longer used after the network refactoring (link)