-
Notifications
You must be signed in to change notification settings - Fork 52
feat(apollo_mempool): add transaction queue to snapshot #5129
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3b7409c
to
1319438
Compare
c72b0b4
to
57d4e32
Compare
57d4e32
to
4fe1c7a
Compare
1319438
to
56bcd08
Compare
56bcd08
to
69f4e90
Compare
Benchmark movements: |
4fe1c7a
to
e4c2aca
Compare
69f4e90
to
5973c84
Compare
e4c2aca
to
cea46eb
Compare
5973c84
to
1fcb448
Compare
cea46eb
to
8e60985
Compare
1fcb448
to
b00a460
Compare
Benchmark movements: |
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 6 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @lev-starkware)
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 131 at r2 (raw file):
} fn create_mempool_snapshot() -> MempoolSnapshot {
Suggestion:
expected_mempool_snapshot()
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 146 at r2 (raw file):
fn return_mempool_snapshot() -> MempoolClientResult<MempoolSnapshot> { Ok(create_mempool_snapshot()) }
Is this function still needed?
Code quote:
fn return_mempool_snapshot() -> MempoolClientResult<MempoolSnapshot> {
Ok(create_mempool_snapshot())
}
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 154 at r2 (raw file):
fn create_json_from_mempool_snapshot(snapshot: &MempoolSnapshot) -> Value { to_value(snapshot).expect("Failed to serialize MempoolSnapshot") }
Do you think these one line functions are needed?
Code quote:
fn create_json_from_string(json_str: &str) -> Value {
from_str(json_str).expect("Failed to parse JSON string")
}
fn create_json_from_mempool_snapshot(snapshot: &MempoolSnapshot) -> Value {
to_value(snapshot).expect("Failed to serialize MempoolSnapshot")
}
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 163 at r2 (raw file):
assert_eq!(response.status(), StatusCode::OK); let body_bytes = hyper::body::to_bytes(response.into_body()).await.unwrap(); let body_string = String::from_utf8(body_bytes.to_vec()).unwrap();
Use serde_json::from_slice
instead of going through String.
Code quote:
let body_string = String::from_utf8(body_bytes.to_vec()).unwrap();
crates/starknet_mempool/src/mempool.rs
line 597 at r2 (raw file):
Ok(MempoolSnapshot { transactions: self.tx_pool.get_chronological_txs_hashes(), transaction_queue: self.tx_queue.get_queue_snapshot(),
Convention in rust is not to use the get
prefix in getters.
Suggestion:
transactions: self.tx_pool.chronological_txs_hashes(),
transaction_queue: self.tx_queue.queue_snapshot(),
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, 5 unresolved discussions (waiting on @alonh5)
crates/starknet_mempool/src/mempool.rs
line 597 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Convention in rust is not to use the
get
prefix in getters.
Done.
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 146 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Is this function still needed?
Done.
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 154 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Do you think these one line functions are needed?
Done.
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 163 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Use
serde_json::from_slice
instead of going through String.
Done.
crates/starknet_monitoring_endpoint/src/monitoring_endpoint_test.rs
line 131 at r2 (raw file):
} fn create_mempool_snapshot() -> MempoolSnapshot {
Done.
b00a460
to
91eb8c3
Compare
8e60985
to
c699f9b
Compare
91eb8c3
to
6a9b170
Compare
c699f9b
to
b8abc79
Compare
6a9b170
to
8ca9941
Compare
b8abc79
to
165e454
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.
Reviewed 14 of 14 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lev-starkware)
crates/apollo_mempool/src/communication.rs
line 104 at r3 (raw file):
} fn get_mempool_snapshot(&self) -> MempoolResult<MempoolSnapshot> {
Suggestion:
mempool_snapshot
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, 1 unresolved discussion (waiting on @alonh5)
crates/apollo_mempool/src/communication.rs
line 104 at r3 (raw file):
} fn get_mempool_snapshot(&self) -> MempoolResult<MempoolSnapshot> {
Done.
165e454
to
4abeceb
Compare
8ca9941
to
ad4bc5b
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.
Reviewed 4 of 4 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)
ad4bc5b
to
54b6aeb
Compare
Merge activity
|
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 r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)
No description provided.