You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current batch message worker works on relay-level message batching. This means that different relay contexts will have different batch message workers to group messages into different batches. The batch message worker needs to work on the relay-level, because it would later need to attach UpdateClient messages to the batched messages from the same counterparty chain.
Following the same principle, there should be a chain-level batch message worker, so that all messages sent to the same chain can potentially be batched together into one transaction. Since the majority of chain-level message batching logic is the same as the relay-level batching, we can refactor the current batch message worker code so that it could work at both levels.
Details
We will refactor the batch message worker to work on a chain context, then add constructs such that a relay context can pretend to be a chain context. There is a draft implementation available on how this can be done:
The RelayToChain struct wraps a relay context with a Target and implements the chain context traits for it. The implementation can be done rather easily by forwarding the calls to the underlying target chain context. The main difference in behavior is the implementation of CanSendMessages, which sends the messages via the relay context so that the UpdateClient message can be appended.
Using RelayToChain, we can then pass in the relay context as a chain context to the new batch message worker.
The text was updated successfully, but these errors were encountered:
Summary
The current batch message worker works on relay-level message batching. This means that different relay contexts will have different batch message workers to group messages into different batches. The batch message worker needs to work on the relay-level, because it would later need to attach
UpdateClient
messages to the batched messages from the same counterparty chain.Following the same principle, there should be a chain-level batch message worker, so that all messages sent to the same chain can potentially be batched together into one transaction. Since the majority of chain-level message batching logic is the same as the relay-level batching, we can refactor the current batch message worker code so that it could work at both levels.
Details
We will refactor the batch message worker to work on a chain context, then add constructs such that a relay context can pretend to be a chain context. There is a draft implementation available on how this can be done:
The
RelayToChain
struct wraps a relay context with aTarget
and implements the chain context traits for it. The implementation can be done rather easily by forwarding the calls to the underlying target chain context. The main difference in behavior is the implementation ofCanSendMessages
, which sends the messages via the relay context so that theUpdateClient
message can be appended.Using
RelayToChain
, we can then pass in the relay context as a chain context to the new batch message worker.The text was updated successfully, but these errors were encountered: