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

chore(sequencer_infra): add component client trait for remote client #2085

Closed
wants to merge 1 commit into from

Conversation

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.82%. Comparing base (e3165c4) to head (05aa17c).
Report is 445 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2085       +/-   ##
===========================================
+ Coverage   40.10%   55.82%   +15.71%     
===========================================
  Files          26        8       -18     
  Lines        1895      292     -1603     
  Branches     1895      292     -1603     
===========================================
- Hits          760      163      -597     
+ Misses       1100      115      -985     
+ Partials       35       14       -21     

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

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware changed the title chore(sequencer_infra): add component client trait for local client chore(sequencer_infra): add component client trait for remote client Nov 16, 2024
@Itay-Tsabary-Starkware Itay-Tsabary-Starkware force-pushed the spr/main/5b800b4d branch 2 times, most recently from fba6bac to 8d059be Compare November 17, 2024 12:49
Copy link
Collaborator

@nadin-Starkware nadin-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware)


crates/starknet_sequencer_infra/src/component_client/remote_component_client.rs line 72 at r1 (raw file):

///     client.send(request);
/// }
/// ```

Please update the doc.

Code quote:

/// # Example
/// ```rust
/// // Example usage of the RemoteComponentClient
///
/// use serde::{Deserialize, Serialize};
///
/// use crate::starknet_sequencer_infra::component_client::RemoteComponentClient;
/// use crate::starknet_sequencer_infra::component_definitions::RemoteClientConfig;
///
/// // Define your request and response types
/// #[derive(Serialize, Deserialize, Debug, Clone)]
/// struct MyRequest {
///     pub content: String,
/// }
///
/// #[derive(Serialize, Deserialize, Debug)]
/// struct MyResponse {
///     content: String,
/// }
///
/// #[tokio::main]
/// async fn main() {
///     // Create a channel for sending requests and receiving responses
///     // Instantiate the client.
///     let ip_address = std::net::IpAddr::V6(std::net::Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1));
///     let port: u16 = 8080;
///     let socket = std::net::SocketAddr::new(ip_address, port);
///     let config = RemoteClientConfig {
///         socket,
///         retries: 3,
///         idle_connections: usize::MAX,
///         idle_timeout: 90,
///     };
///     let client = RemoteComponentClient::<MyRequest, MyResponse>::new(config);
///
///     // Instantiate a request.
///     let request = MyRequest { content: "Hello, world!".to_string() };
///
///     // Send the request; typically, the client should await for a response.
///     client.send(request);
/// }
/// ```

crates/starknet_sequencer_infra/src/component_client/remote_component_client.rs line 143 at r1 (raw file):

where
    Request: Send + Sync + Serialize + DeserializeOwned + Clone + Debug,
    Response: Send + Sync + Serialize + DeserializeOwned + Clone + Debug,

Please remove this, its not needed for the response.

Code quote:

+ Clone

Base automatically changed from spr/main/a48a5aec to main November 17, 2024 13:21
Copy link
Contributor Author

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @nadin-Starkware)


crates/starknet_sequencer_infra/src/component_client/remote_component_client.rs line 72 at r1 (raw file):

Previously, nadin-Starkware (Nadin Jbara) wrote…

Please update the doc.

What's there to update?


crates/starknet_sequencer_infra/src/component_client/remote_component_client.rs line 143 at r1 (raw file):

Previously, nadin-Starkware (Nadin Jbara) wrote…

Please remove this, its not needed for the response.

Done.

Copy link
Collaborator

@nadin-Starkware nadin-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware)


crates/starknet_sequencer_infra/src/component_client/remote_component_client.rs line 72 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

What's there to update?

Adding the ComponentClient, which you already did :)

Copy link
Contributor Author

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Itay-Tsabary-Starkware)

@Itay-Tsabary-Starkware
Copy link
Contributor Author

✓ Commit merged in pull request #2119

@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants