-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[node] Follow latest & Safe client integration test #1670
Conversation
cfb56c8
to
f017ee7
Compare
e774e08
to
64e7976
Compare
sui_core/src/safe_client.rs
Outdated
/* | ||
|
||
TODO: check that the batch is within bounds given that the | ||
bounds may now not be known by the requester. | ||
|
||
if let Some(start) = &request.start { | ||
fp_ensure!( | ||
signed_batch.batch.initial_sequence_number >= *start | ||
&& signed_batch.batch.next_sequence_number | ||
<= (*start + request.length + signed_batch.batch.size), | ||
SuiError::ByzantineAuthoritySuspicion { | ||
authority: self.address | ||
} | ||
); | ||
} | ||
*/ |
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.
Mind using line comments //
for comment things out over block comments? Block comments make it difficult to know if code is live or dead when grepping
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.
Good point
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.
converted
author George Danezis <george@danez.is> 1651169454 +0100 committer George Danezis <george@danez.is> 1651571250 +0100 Modify follower protocol to allow follow of latest Moved follower streaming to authority fmt Changed io to sui errors Added integration test for safe client Clean up [node] Basic gossip (#1676) * Simple gossip logic * Added gossip test + fix follower edge case at 0 * Add logging Co-authored-by: George Danezis <george@danez.is>
64e7976
to
9f2b61e
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.
sorry for late review!
None | ||
} else { | ||
loop { | ||
match local_state.subscriber.recv().await { |
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.
So now we listen to the subscriber instead of directly to the network, this is a good decoupling
Modify follower protocol to allow follow of latest Moved follower streaming to authority Changed io to sui errors Added integration test for safe client [node] Basic gossip (#1676) * Simple gossip logic * Added gossip test + fix follower edge case at 0 * Add logging Co-authored-by: George Danezis <george@danez.is>
Modify follower protocol to allow follow of latest Moved follower streaming to authority Changed io to sui errors Added integration test for safe client [node] Basic gossip (#1676) * Simple gossip logic * Added gossip test + fix follower edge case at 0 * Add logging Co-authored-by: George Danezis <george@danez.is>
We extend and test more thoroughly the follower API and safe client:
Option<TxSequence>
as astart
in the batch request, and it follows the latest transactions. It also takes alength
to denote how many items we expect.AuthorityState
and now returns a nice Stream ofBatchResponses
instead of writing directly to the channel. The logic that connects that to a channel stays inAuthorityServer
.