-
Notifications
You must be signed in to change notification settings - Fork 11
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: implementing ComponentRunner for the gateway #355
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #355 +/- ##
==========================================
+ Coverage 80.80% 80.85% +0.04%
==========================================
Files 35 35
Lines 1620 1619 -1
Branches 1620 1619 -1
==========================================
Hits 1309 1309
+ Misses 245 244 -1
Partials 66 66 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware and @dafnamatsry)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dafnamatsry and @lev-starkware)
crates/gateway/src/gateway.rs
line 74 at r1 (raw file):
.route("/is_alive", get(is_alive)) .route("/add_tx", post(add_tx)) .with_state(self.app_state.clone())
I am unsure if a clone
is the intended behavior.
Maybe we should fix app_state so that it would implement Copy
(or whatever the issue is). (Make all the members hide behind Arc
).
This is not a big deal for now, but maybe it will be in the future.
Code quote:
self.app_state.clone()
crates/gateway/src/gateway.rs
line 148 at r1 (raw file):
#[async_trait] impl ComponentRunner for Gateway { async fn start(&mut self) -> Result<(), ComponentStartError> {
A question about Rust
/ design (probably out of scope for this PR).
Does the fact that start
gets a reference to mut self
means a single ComponentRunner
may run many instances of the component?
Code quote:
impl ComponentRunner for Gateway {
async fn start(&mut self) -> Result<(), ComponentStartError> {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dafnamatsry and @lev-starkware)
crates/gateway/src/gateway.rs
line 74 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
I am unsure if a
clone
is the intended behavior.Maybe we should fix app_state so that it would implement
Copy
(or whatever the issue is). (Make all the members hide behindArc
).This is not a big deal for now, but maybe it will be in the future.
If you think it is an issue, add a to-do (for someone on my team, say myself) to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
crates/gateway/src/gateway.rs
line 74 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
If you think it is an issue, add a to-do (for someone on my team, say myself) to fix it.
from F2f. Please add a todo on my name.
crates/gateway/src/gateway.rs
line 148 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
A question about
Rust
/ design (probably out of scope for this PR).Does the fact that
start
gets a reference tomut self
means a singleComponentRunner
may run many instances of the component?
From F2F:
The important thing here is the mut
, not the ref
(&
).
It is only logical that a runner would like to mutate itself.
There was a problem hiding this 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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lev-starkware)
crates/gateway/src/gateway.rs
line 74 at r1 (raw file):
.route("/is_alive", get(is_alive)) .route("/add_tx", post(add_tx)) .with_state(self.app_state.clone())
I think dereferencing should work here.
Suggestion:
*self.app_state
fefc808
to
ba4a577
Compare
b943062
to
49daaf3
Compare
There was a problem hiding this 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, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware and @lev-starkware)
There was a problem hiding this 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, 1 unresolved discussion (waiting on @dafnamatsry and @Itay-Tsabary-Starkware)
crates/gateway/src/gateway.rs
line 74 at r1 (raw file):
Previously, dafnamatsry wrote…
I think dereferencing should work here.
I tried it not compiling.
commit-id:f9f21462
49daaf3
to
37d7bc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @dafnamatsry from a discussion.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @dafnamatsry)
There was a problem hiding this 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: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @dafnamatsry)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)
There was a problem hiding this 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: complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)
✓ Commit merged in pull request #339 |
Stack:
This change is