Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft][WIP] UncheckedExtrinsic: lazily decode and limit the call #7902

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

serban300
Copy link
Contributor

@serban300 serban300 commented Mar 13, 2025

Closes #7360
Closes #4255

This PR:

  • sets a memory limit when decoding the RuntimeCall inside an UncheckedExtrinsic
  • changes some core logic in order to lazily decode the RuntimeCall inside an UncheckedExtrinsic

This is a significant rework of #4296. The main problem with #4296 was that it was always decoding a call at least twice. This PR comes with a different approach, that avoids the need to decode twice.

@serban300 serban300 added the T17-primitives Changes to primitives that are not covered by any other label. label Mar 13, 2025
@serban300 serban300 self-assigned this Mar 13, 2025
@serban300 serban300 marked this pull request as ready for review March 13, 2025 09:29
@serban300 serban300 requested a review from a team as a code owner March 13, 2025 09:29
@serban300 serban300 force-pushed the unchecked-extrinsic branch 5 times, most recently from 368c27a to 4e1cafb Compare March 13, 2025 13:36
@serban300 serban300 changed the title [Draft][WIP] UncheckedExtrinsic: lazy decoding + set a memory limit when decoding the call [Draft][WIP] UncheckedExtrinsic: lazily decode and limit the call Mar 13, 2025
@serban300 serban300 force-pushed the unchecked-extrinsic branch 2 times, most recently from 520f415 to 099a094 Compare March 13, 2025 16:42
@@ -1462,13 +1465,15 @@ impl_runtime_apis! {
uxt: <Block as BlockT>::Extrinsic,
len: u32,
) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
TransactionPayment::query_info(uxt, len)
let mut uxt = uxt;
Copy link
Member

Choose a reason for hiding this comment

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

Ser: #7924

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice ! Thanks ! Will use this feature after it's merged.

@serban300 serban300 force-pushed the unchecked-extrinsic branch from 099a094 to dbee656 Compare March 14, 2025 07:50
@serban300 serban300 added the I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. label Mar 14, 2025
@serban300 serban300 force-pushed the unchecked-extrinsic branch from dbee656 to 506a5bf Compare March 14, 2025 08:39
@serban300 serban300 force-pushed the unchecked-extrinsic branch from 506a5bf to 51b5cb4 Compare March 14, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I9-optimisation An enhancement to provide better overall performance in terms of time-to-completion for a task. T17-primitives Changes to primitives that are not covered by any other label.
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Use DecodeWithMemTracking and DecodeWithMemLimit in polkadot-sdk UncheckedExtrinsic decoding improvements
2 participants