-
Notifications
You must be signed in to change notification settings - Fork 21
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(consensus): send proposal content #1810
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @dan-starkware and the rest of your teammates on Graphite |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1810 +/- ##
===========================================
- Coverage 40.10% 26.59% -13.51%
===========================================
Files 26 116 +90
Lines 1895 13610 +11715
Branches 1895 13610 +11715
===========================================
+ Hits 760 3620 +2860
- Misses 1100 9641 +8541
- Partials 35 349 +314 ☔ View full report in Codecov by Sentry. |
898a552
to
98f96a6
Compare
7a3a602
to
1b85d33
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 r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @asmaastarkware, @dan-starkware, and @guy-starkware)
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs
line 308 at r1 (raw file):
transaction_hashes.push(tx.tx_hash()); transactions.push(tx.tx()); });
I prefer just using a for loop here. This is because iterators are usually lazy/don't have side effects, not doing anything unless there is a return value. This causes me to feel that for_each
is surprising.
Documentation seems to agree "...It’s generally more idiomatic to use a for
loop..."
https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.for_each
Code quote:
txs.into_iter().for_each(|tx| {
transaction_hashes.push(tx.tx_hash());
transactions.push(tx.tx());
});
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 85 at r1 (raw file):
mock_register_broadcast_topic().expect("Failed to create mock network"); let BroadcastTopicChannels { broadcasted_messages_receiver: _, broadcast_topic_client } = subscriber_channels;
Suggestion:
let BroadcastTopicChannels { broadcast_topic_client, .. } = subscriber_channels;
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context_test.rs
line 88 at r1 (raw file):
let BroadcastNetworkMock { broadcasted_messages_sender: _mock_broadcasted_messages_sender, .. } = mock_network;
Why destructure if we never use this?
I would have thought you'd do this to get the receiver out so that we can inspect the actual proposal content send out by the context.
Code quote:
let BroadcastNetworkMock {
broadcasted_messages_sender: _mock_broadcasted_messages_sender, ..
} = mock_network;
crates/starknet_api/src/executable_transaction.rs
line 62 at r1 (raw file):
Transaction::Invoke(tx_data) => crate::transaction::Transaction::Invoke(tx_data.tx), } }
Should this be the Into
trait? Or better yet "implement From
instead" in the non-executable TX's location?
Code quote:
pub fn tx(self) -> crate::transaction::Transaction {
match self {
Transaction::Declare(tx_data) => crate::transaction::Transaction::Declare(tx_data.tx),
Transaction::DeployAccount(tx_data) => {
crate::transaction::Transaction::DeployAccount(tx_data.tx)
}
Transaction::Invoke(tx_data) => crate::transaction::Transaction::Invoke(tx_data.tx),
}
}
98f96a6
to
0204225
Compare
1b85d33
to
82e76c9
Compare
Benchmark movements: |
0204225
to
df29533
Compare
024bf62
to
f2dcf95
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.
This will be very useful for what I'm working on!
Reviewable status: 0 of 5 files reviewed, 4 unresolved discussions (waiting on @asmaastarkware, @dan-starkware, and @matan-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 5 of 5 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @asmaastarkware)
f456a82
to
eacba1c
Compare
884a117
to
adc6453
Compare
adc6453
to
7f3a5f1
Compare
eacba1c
to
322d984
Compare
7f3a5f1
to
70ca816
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 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 4 of 5 files reviewed, all discussions resolved (waiting on @asmaastarkware)
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 r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @asmaastarkware)
No description provided.