-
Notifications
You must be signed in to change notification settings - Fork 5
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
multi: refactor mailbox item handling, more logs #40
base: master
Are you sure you want to change the base?
Conversation
Remove some noisy, and add more correlation IDs
@@ -139,7 +139,7 @@ impl std::fmt::Display for PeerStateId { | |||
} | |||
} | |||
|
|||
#[derive(Debug, Serialize, Deserialize)] | |||
#[derive(Debug, Serialize, Deserialize, strum::Display)] |
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.
Not sure if a Display impl is a good idea here, debug should be enough.
If you just want to show the discriminant, use https://docs.rs/strum/latest/strum/derive.EnumDiscriminants.html and https://docs.rs/strum/latest/strum/trait.IntoDiscriminant.html
@@ -157,7 +157,9 @@ pub enum Response { | |||
TransactionRejected(Txid), | |||
} | |||
|
|||
#[derive(BorshSerialize, Clone, Debug, Deserialize, Serialize)] | |||
#[derive( | |||
BorshSerialize, Clone, Debug, Deserialize, Serialize, strum::Display, |
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.
Not sure if a Display impl is a good idea here, debug should be enough.
If you just want to show the discriminant, use https://docs.rs/strum/latest/strum/derive.EnumDiscriminants.html and https://docs.rs/strum/latest/strum/trait.IntoDiscriminant.html
HashMap<mainchain_task::Request, HashSet<(SocketAddr, PeerStateId)>>, | ||
|
||
/// PhantomData to use the MainchainTransport type parameter | ||
_phantom: std::marker::PhantomData<MainchainTransport>, |
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.
Is this type parameter needed at all here? Looks like the parameter should be on MailboxState::handle_mailbox_item
} | ||
|
||
#[derive(Debug, strum::Display)] | ||
enum MailboxItem { |
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.
Please move this above MailboxState
, since it is used in the impl for MailboxState
The idea with the mailbox item handling refactor is to make it possible to add tracing IDs to better figure out what's happening.
There's currently a linter failure here, which I'm not sure how to handle. @Ash-L2L are you able to help?