-
Notifications
You must be signed in to change notification settings - Fork 208
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
Update sending of Tx Reply & Finalise msgs to send via Store and Forward only if Direct fails #1876
Conversation
This PR updates the Transaction Service to first attempt to send the Transaction Reply and Transaction Finalise message Directly and only if that process fails to send the messages via SAF. Previously, both these message with sent in a Fire and Forget manner where both would be sent simultaneously without feedback. Logging has also been introduced for both these processes.
0a77747
to
3f9338e
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.
LGTM
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.
Nice logic. Just suggested a bit more pinpoint info in the logs at certain events.
.await | ||
{ | ||
None => { | ||
self.send_transaction_reply_store_and_forward(tx_id, source_pubkey.clone(), proto_message.clone()) |
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.
self.send_transaction_reply_store_and_forward(tx_id, source_pubkey.clone(), proto_message.clone()) | |
debug!( | |
target: LOG_TARGET, | |
"Transaction Reply (TxId: {}) Direct Send to {} not possible, attempting Store and Forward", | |
tx_id, | |
source_pubkey, | |
); | |
self.send_transaction_reply_store_and_forward(tx_id, source_pubkey.clone(), proto_message.clone()) |
} else { | ||
error!( | ||
target: LOG_TARGET, | ||
"Transaction Reply message Send Direct for TxID: {} failed", tx_id |
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.
"Transaction Reply message Send Direct for TxID: {} failed", tx_id | |
"Transaction Reply message Send Direct for TxID: {} failed, attempting Store and Forward", tx_id |
error!( | ||
target: LOG_TARGET, | ||
"Direct Send of Transaction Reply message for TX_ID: {} was unsuccessful and no \ | ||
message was sent", |
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.
message was sent", | |
message was sent, attempting Store and Forward", |
true => { | ||
info!( | ||
target: LOG_TARGET, | ||
"Direct Send of Transaction Finalized message for TX_ID: {} was successful", |
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.
"Direct Send of Transaction Finalized message for TX_ID: {} was successful", | |
"Direct Send of Transaction Finalized message for TX_ID: {} was successful ({:?})", |
info!( | ||
target: LOG_TARGET, | ||
"Direct Send of Transaction Finalized message for TX_ID: {} was successful", | ||
self.id |
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.
self.id | |
self.id, | |
send_states[0].tag |
Description
This PR updates the Transaction Service to first attempt to send the Transaction Reply and Transaction Finalise message Directly and only if that process fails to send the messages via SAF. Previously, both these message with sent in a Fire and Forget manner where both would be sent simultaneously without feedback.
Logging has also been introduced for both these processes.
How Has This Been Tested?
Test provided that uses the Mock Outbound Messaging Service to test that if Direct sending succeeds that SAF is not sent but if Direct sending fails then SAF is sent for both message types.
Types of changes
Checklist:
development
branch.cargo-fmt --all
before pushing.