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

Chain metadata service not updating metadata on reorgs #1890

Merged
merged 1 commit into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use super::{error::ChainMetadataSyncError, LOG_TARGET};
use crate::{
base_node::{
chain_metadata_service::handle::{ChainMetadataEvent, PeerChainMetadata},
comms_interface::{BlockEvent, Broadcast, LocalNodeCommsInterface},
comms_interface::{BlockEvent, LocalNodeCommsInterface},
proto,
},
chain_storage::BlockAddResult,
Expand Down Expand Up @@ -109,9 +109,9 @@ impl ChainMetadataService {

/// Handle BlockEvents
async fn handle_block_event(&mut self, event: &BlockEvent) -> Result<(), ChainMetadataSyncError> {
let _broadcast = Broadcast::from(true);
match event {
BlockEvent::Verified((_, BlockAddResult::Ok, _broadcast)) => {
BlockEvent::Verified((_, BlockAddResult::Ok, _)) |
BlockEvent::Verified((_, BlockAddResult::ChainReorg(_), _)) => {
self.update_liveness_chain_metadata().await?;
},
BlockEvent::Verified(_) | BlockEvent::Invalid(_) => {},
Expand Down
2 changes: 1 addition & 1 deletion comms/src/builder/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ pub const MESSAGING_EVENTS_BUFFER_SIZE: usize = 100;
pub const MESSAGING_REQUEST_BUFFER_SIZE: usize = 50;
/// The default maximum number of times to retry sending a failed message before publishing a SendMessageFailed event.
/// This can be low because dialing a peer is already attempted a number of times.
pub const MESSAGING_MAX_SEND_RETRIES: usize = 2;
pub const MESSAGING_MAX_SEND_RETRIES: usize = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Might need to watch this for wallets, but agree with this in general. Good to see that tests pass, seems to indicate this retry (originally in response to test flakiness) might not be needed at all!