Closed lemunozm closed 3 months ago
Still missings UTs, will do later, but the PR is ready to be reviewed
There are still pending batching tests (UTs and ITs). But maybe we can start merging this to avoid more conflicts with the incoming Cosmin PRs, WDYT?
We can fix some clean-ups in a next PR along with the tests.
cc @wischli @cdamian
There are still pending batching tests (UTs and ITs). But maybe we can start merging this to avoid more conflicts with the incoming Cosmin PRs, WDYT?
We can fix some clean-ups in a next PR along with the tests.
cc @wischli @cdamian
I'm OK with this. If we merge this, I will rebase my multi-router branch, then you can continue with the rest of the stuff here.
@cdamian you will have quite conflicts but wanted to merge this ASAP to avoid even more π
Tell me if I can help you in the rebase ππ», or with some tricky union of some part
Attention: Patch coverage is 57.30337%
with 38 lines
in your changes missing coverage. Please review.
Project coverage is 47.69%. Comparing base (
8245ce2
) to head (7a9868d
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@wischli @cdamian can we merge this to avoid conflicts with the cosmin part? ππ»π
@lemunozm Feel free to press the button. We can merge #1946 afterwards.
Description
This PR overrides the previous https://github.com/centrifuge/centrifuge-chain/pull/1923, in a simplified version
Responsibilities
pallet-liquidity-pools-gateway
knows to batch/unbatch but doesn't know what aBatch
message is. To handle this, theLPMessage
trait allows pack/unpack methods.pallet-liquidity-pools
will never send or receive a batch. The gateway is responsible for the batching process.Details
Batching is handled by two extrinsic:
Gateway::start_batch_message(sender, destination)
: When calling this, any submitted messages from LP, that match thesender
&destination
will be packed. NOTE: We need to index also by destination domain because the destination information is not inside the message. So, we can never bundle two messages with two different destinations.Gateway::end_batch_message(sender, destination)
: When calling this, the batch is finally submitted. If this is not called, no message is sent. If the batch reaches the limit size, it will dispatch an error.Later, the user can call
pallet_utility::batch(calls)
, and any message sent betweenstart_pack
andend_pack
will be bundled in the batch.Changes
Gateway::start_batch_message()
andGateway::end_batch_message()
to allow creating batches.process_msg()
toreceive_message()
.try_range
for header message deserialization and use aBufferReader
.Docs
See the updated diagrams: https://centrifuge.hackmd.io/i_wfI19XTgSkfWeN7IxXiQ?view