centrifuge / centrifuge-chain

Centrifuge Chain: the layer-1 blockchain for real-world assets, built on Substrate.
https://centrifuge.io
GNU Lesser General Public License v3.0
182 stars 78 forks source link

LPv2: Batch message logic (r2) #1949

Closed lemunozm closed 1 month ago

lemunozm commented 1 month ago

Description

This PR overrides the previous https://github.com/centrifuge/centrifuge-chain/pull/1923, in a simplified version

Responsibilities

Details

Batching is handled by two extrinsic:

Later, the user can call pallet_utility::batch(calls), and any message sent between start_pack and end_pack will be bundled in the batch.

Changes

Docs

See the updated diagrams: https://centrifuge.hackmd.io/i_wfI19XTgSkfWeN7IxXiQ?view

lemunozm commented 1 month ago

Still missings UTs, will do later, but the PR is ready to be reviewed

lemunozm commented 1 month ago

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

cdamian commented 1 month ago

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.

lemunozm commented 1 month ago

@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

codecov[bot] commented 1 month ago

Codecov Report

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).

Files Patch % Lines
pallets/liquidity-pools-gateway/src/lib.rs 64.61% 23 Missing :warning:
pallets/liquidity-pools/src/message.rs 0.00% 12 Missing :warning:
libs/utils/src/lib.rs 90.00% 1 Missing :warning:
...pools-gateway/axelar-gateway-precompile/src/lib.rs 0.00% 1 Missing :warning:
pallets/liquidity-pools/src/lib.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1949 +/- ## ========================================== - Coverage 47.72% 47.69% -0.04% ========================================== Files 184 183 -1 Lines 12969 12953 -16 ========================================== - Hits 6190 6178 -12 + Misses 6779 6775 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lemunozm commented 1 month ago

@wischli @cdamian can we merge this to avoid conflicts with the cosmin part? πŸ™πŸ»πŸ˜ƒ

wischli commented 1 month ago

@lemunozm Feel free to press the button. We can merge #1946 afterwards.