Skip to content

asset-rate pallet: box asset kind parameter#1545

Merged
muharem merged 8 commits into
masterfrom
muharem-asset-rate-box-parameter
Sep 15, 2023
Merged

asset-rate pallet: box asset kind parameter#1545
muharem merged 8 commits into
masterfrom
muharem-asset-rate-box-parameter

Conversation

@muharem

@muharem muharem commented Sep 13, 2023

Copy link
Copy Markdown
Contributor

The AssetKind type parameter of a dispatchable, defined by the user, might be large — like xcm::MultiLocation. To prevent inflating the size of the Call type, we Box it.

This changes required for #1333

@muharem muharem added T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. labels Sep 13, 2023
@muharem muharem marked this pull request as ready for review September 14, 2023 09:39
@muharem muharem requested review from a team and removed request for a team September 14, 2023 09:39

@ggwpez ggwpez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are some un-needed clones, but looking good in general.

Comment thread substrate/frame/asset-rate/src/lib.rs Outdated
Comment thread substrate/frame/asset-rate/src/lib.rs Outdated
@muharem muharem requested a review from ggwpez September 14, 2023 10:41
@paritytech-ci paritytech-ci requested review from a team September 14, 2023 10:49
@muharem

muharem commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

@ggwpez can you look again please.
I also updated traits ConversionFromAssetBalance and ConversionToAssetBalance accept AssetId as ref to avoid extra clone. I will update the PR title if looks good to you.

@muharem

muharem commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

probably better to have separate PR for the traits

@ggwpez

ggwpez commented Sep 14, 2023

Copy link
Copy Markdown
Member

@ggwpez can you look again please. I also updated traits ConversionFromAssetBalance and ConversionToAssetBalance accept AssetId as ref to avoid extra clone. I will update the PR title if looks good to you.

Historically the converters use instances and not references, eg like in the Convert trait.
I think it makes sense to keep that, since the functions are called to_asset_balance, which indicated consumption of the argument (as compared to as_asset_balance).

@muharem

muharem commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

@ggwpez reverted

@muharem

muharem commented Sep 14, 2023

Copy link
Copy Markdown
Contributor Author

@ggwpez can you reapprove if looks good, I did reset the previous approve from you.

@muharem muharem merged commit 841a33e into master Sep 15, 2023
@muharem muharem deleted the muharem-asset-rate-box-parameter branch September 15, 2023 09:52
@muharem muharem added the T4-runtime_API This PR/Issue is related to runtime APIs. label Sep 18, 2023
@Polkadot-Forum

Copy link
Copy Markdown

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v1-2-0/4451/1

bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
The `AssetKind` type parameter of a dispatchable, defined by the user,
might be large — like `xcm::MultiLocation`. To prevent inflating the
size of the `Call` type, we `Box` it.

This changes required for
paritytech#1333

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* generated_message_details() -> Simplifications

- avoid using a HashMap for `messages_to_refine`. It seems that a vec is
  enough
- minimize the number of conversions between `OutboundMessageDetails` and
  `MessageDetails`
- use references where possible in order to minimize the number of
  intermediary Vecs
- simplify `make_message_details_map()` logic, reduce its scope and rename
  it to `validate_out_msgs_details()`

Signed-off-by: Serban Iorga <serban@parity.io>

* Define typed_state_call()

Signed-off-by: Serban Iorga <serban@parity.io>

* Call To*InboundLaneApi::message_details() with single messages

Signed-off-by: Serban Iorga <serban@parity.io>

* Call To*InboundLaneApi::message_details() with batched messages

Signed-off-by: Serban Iorga <serban@parity.io>

* validate_out_msgs_details() -> change check

* Define split_msgs_to_refine()

Signed-off-by: Serban Iorga <serban@parity.io>

Signed-off-by: Serban Iorga <serban@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. T4-runtime_API This PR/Issue is related to runtime APIs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants