Skip to content
Prev Previous commit
Next Next commit
Update primitives/messages/src/source_chain.rs
Co-authored-by: Tomasz Drwięga <[email protected]>
  • Loading branch information
svyatonik and tomusdrw authored Jun 21, 2021
commit d231c82004620f68a2e846a670dffb83e52c61bd
2 changes: 1 addition & 1 deletion primitives/messages/src/source_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub trait MessageDeliveryAndDispatchPayment<AccountId, Balance> {
#[impl_trait_for_tuples::impl_for_tuples(30)]
pub trait OnMessagesDelivered {
/// Called when we receive confirmation that our messages have been delivered to the
/// target chain. The confirmation aso has single bit dispatch result for every
/// target chain. The confirmation also has single bit dispatch result for every
/// confirmed message (see `DeliveredMessages` for details).
fn on_messages_delivered(_lane: &LaneId, _messages: &DeliveredMessages) {}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This'll need to do something with weights - I'm not yet sure how to deal with this. Change benchmarks to worst-case result and then refund? But what is worst case when there are e.g. multiple apps using different lanes for their purposes. And because of refund policy we'll need to decrease max number of messages in the confirmation tx. Probably just reserve single read and single write for the every registered callback? I'm not yet sure - will leave it for future PRs as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think the general sentiment about these kind of handlers is that they should be as simple as possible. Having one read + one write seems reasonable. In future we can prepare some tooling to kind of "subscribe" to interesting messages and for instance have them processed in on_initialize of the pallet or some manual trigger (extrinsic).

Might be good to add this assumption to the docs though, so that implementers are aware of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
Expand Down