-
Notifications
You must be signed in to change notification settings - Fork 89
feat(network): add Transaction Protocol #2135
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2135 +/- ##
==========================================
- Coverage 65.72% 65.62% -0.11%
==========================================
Files 135 135
Lines 17834 17875 +41
Branches 17834 17875 +41
==========================================
+ Hits 11722 11730 +8
- Misses 4825 4859 +34
+ Partials 1287 1286 -1 ☔ 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 1 of 1 files at r1, 7 of 7 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @asmaastarkware)
crates/papyrus_network/src/db_executor/mod.rs
line 220 at r2 (raw file):
for (transaction, transaction_output) in transactions.iter().zip(transaction_outputs.iter()) { result.push((transaction.clone(), transaction_output.clone()));
Use into_iter and remove clone
crates/papyrus_network/src/db_executor/test.rs
line 29 at r2 (raw file):
const BUFFER_SIZE: usize = 10; // TODO(shahak): Add test for state_diff_query_positive_flow.
Add test for transactions, or add a TODO to add such test (maybe it's better to add a TODO in order to keep this PR thin)
I think the best way to do this without code duplication is to have a function that receives the storage reader and the expected items and runs the test, and then call it for headers and for transactions
This function can run all the tests, not just the positive flow one
crates/papyrus_node/src/main.rs
line 304 at r2 (raw file):
network_manager.register_sqmr_subscriber(Protocol::SignedBlockHeader); let state_diff_client_channels = network_manager.register_sqmr_subscriber(Protocol::StateDiff); let transaction_client_channels =
Remove this line. @eitanm-starkware will add it when he adds transaction as a sync protocol
0df65bf
to
7e40497
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: all files reviewed, 3 unresolved discussions (waiting on @eitanm-starkware and @ShahakShama)
crates/papyrus_network/src/db_executor/mod.rs
line 220 at r2 (raw file):
Previously, ShahakShama wrote…
Use into_iter and remove clone
Done.
crates/papyrus_network/src/db_executor/test.rs
line 29 at r2 (raw file):
Previously, ShahakShama wrote…
Add test for transactions, or add a TODO to add such test (maybe it's better to add a TODO in order to keep this PR thin)
I think the best way to do this without code duplication is to have a function that receives the storage reader and the expected items and runs the test, and then call it for headers and for transactions
This function can run all the tests, not just the positive flow one
Done.
crates/papyrus_node/src/main.rs
line 304 at r2 (raw file):
Previously, ShahakShama wrote…
Remove this line. @eitanm-starkware will add it when he adds transaction as a sync protocol
Done.
c60153f
to
7813706
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 1 of 7 files at r3, 10 of 10 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @asmaastarkware)
a discussion (no related file):
Blocking until the base PR is merged
7813706
to
06c7a95
Compare
7e40497
to
12396a3
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 10 of 10 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @asmaastarkware)
crates/papyrus_network/src/db_executor/mod.rs
line 109 at r6 (raw file):
} } result = self.state_diff_queries_receiver.next() => {
Why did you change this? keep the same code for all protocols
12396a3
to
4e4eaf0
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 1 of 1 files at r7, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @asmaastarkware)
This change is