Skip to content
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

Merged
merged 3 commits into from
May 3, 2022

Conversation

gdanezis
Copy link
Collaborator

@gdanezis gdanezis commented Apr 29, 2022

We extend and test more thoroughly the follower API and safe client:

  • The follower API now allows an Option<TxSequence> as a start in the batch request, and it follows the latest transactions. It also takes a length to denote how many items we expect.
  • The follower logic moves to AuthorityState and now returns a nice Stream of BatchResponses instead of writing directly to the channel. The logic that connects that to a channel stays in AuthorityServer.
  • Additional tests check the facilities to follow the latest updates, and also test the safe client correctly receives the stream as generated by the authority.
  • Now includes the merged gossip from [node] Basic gossip #1676

@gdanezis gdanezis requested a review from lavindir April 29, 2022 11:11
@gdanezis gdanezis force-pushed the safe-client-integration-test branch from cfb56c8 to f017ee7 Compare April 29, 2022 11:26
@gdanezis gdanezis changed the title [node] Safe client integration test [node] Follow latest & Safe client integration test Apr 29, 2022
@gdanezis gdanezis force-pushed the safe-client-integration-test branch from e774e08 to 64e7976 Compare May 3, 2022 11:05
@gdanezis gdanezis requested a review from bmwill May 3, 2022 12:19
Comment on lines 192 to 207
/*

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
}
);
}
*/
Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

converted

George Danezis added 3 commits May 3, 2022 16:55
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>
@gdanezis gdanezis force-pushed the safe-client-integration-test branch from 64e7976 to 9f2b61e Compare May 3, 2022 16:05
@gdanezis gdanezis merged commit 601889c into main May 3, 2022
@gdanezis gdanezis deleted the safe-client-integration-test branch May 3, 2022 16:18
Copy link
Contributor

@lavindir lavindir left a 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 {
Copy link
Contributor

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

longbowlu pushed a commit that referenced this pull request May 12, 2022
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>
punwai pushed a commit that referenced this pull request Jul 27, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants