-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[consensus] rename some network methods and failpoints to make them more consistent #2130
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ impl NetworkSender { | |
from: Author, | ||
timeout: Duration, | ||
) -> anyhow::Result<BlockRetrievalResponse> { | ||
fail_point!("consensus::send_block_retrieval", |_| { | ||
fail_point!("consensus::request_block", |_| { | ||
Err(anyhow::anyhow!("Injected error in request_block")) | ||
}); | ||
|
||
|
@@ -169,31 +169,31 @@ impl NetworkSender { | |
} | ||
|
||
pub async fn broadcast_proposal(&mut self, proposal_msg: ProposalMsg) { | ||
fail_point!("consensus::send_proposal", |_| ()); | ||
fail_point!("consensus::broadcast_proposal", |_| ()); | ||
let msg = ConsensusMsg::ProposalMsg(Box::new(proposal_msg)); | ||
self.broadcast(msg).await | ||
} | ||
|
||
pub async fn broadcast_sync_info(&mut self, sync_info_msg: SyncInfo) { | ||
fail_point!("consensus::send_sync_info", |_| ()); | ||
fail_point!("consensus::broadcast_sync_info", |_| ()); | ||
let msg = ConsensusMsg::SyncInfo(Box::new(sync_info_msg)); | ||
self.broadcast(msg).await | ||
} | ||
|
||
pub async fn broadcast_timeout_vote(&mut self, timeout_vote_msg: VoteMsg) { | ||
fail_point!("consensus::send_vote", |_| ()); | ||
fail_point!("consensus::broadcast_timeout_vote", |_| ()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything else is just aesthetics. This is the only significant change (it conflicts with L210) |
||
let msg = ConsensusMsg::VoteMsg(Box::new(timeout_vote_msg)); | ||
self.broadcast(msg).await | ||
} | ||
|
||
pub async fn broadcast_epoch_change(&mut self, epoch_chnage_proof: EpochChangeProof) { | ||
fail_point!("consensus::send_epoch_change", |_| ()); | ||
fail_point!("consensus::broadcast_epoch_change", |_| ()); | ||
let msg = ConsensusMsg::EpochChangeProof(Box::new(epoch_chnage_proof)); | ||
self.broadcast(msg).await | ||
} | ||
|
||
pub async fn broadcast_commit_vote(&mut self, commit_vote: CommitVote) { | ||
fail_point!("consensus::send_commit_vote", |_| ()); | ||
fail_point!("consensus::broadcast_commit_vote", |_| ()); | ||
let msg = ConsensusMsg::CommitVoteMsg(Box::new(commit_vote)); | ||
self.broadcast(msg).await | ||
} | ||
|
@@ -218,14 +218,14 @@ impl NetworkSender { | |
self.send(msg, recipients).await | ||
} | ||
|
||
pub async fn notify_epoch_change(&mut self, proof: EpochChangeProof) { | ||
pub async fn send_epoch_change(&mut self, proof: EpochChangeProof) { | ||
fail_point!("consensus::send_epoch_change", |_| ()); | ||
let msg = ConsensusMsg::EpochChangeProof(Box::new(proof)); | ||
self.send(msg, vec![self.author]).await | ||
} | ||
|
||
/// Sends the ledger info to self buffer manager | ||
pub async fn notify_commit_proof(&self, ledger_info: LedgerInfoWithSignatures) { | ||
pub async fn send_commit_proof(&self, ledger_info: LedgerInfoWithSignatures) { | ||
fail_point!("consensus::send_commit_proof", |_| ()); | ||
|
||
// this requires re-verification of the ledger info we can probably optimize it later | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I was trying to differentiate it from send but maybe did a bad job. notify == notify self so this doesn't go through network