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] Set a memory limit when decoding an UncheckedExtrinsic #7759

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

serban300
Copy link
Contributor

Related to #7360

@serban300 serban300 added the T17-primitives Changes to primitives that are not covered by any other label. label Feb 28, 2025
@serban300 serban300 self-assigned this Feb 28, 2025
@serban300 serban300 force-pushed the decode-with-mem-tracking branch from 5d6c84f to 5911b82 Compare February 28, 2025 15:07
@serban300 serban300 changed the title Set a memory limit when decoding an UncheckedExtrinsic or a Block Set a memory limit when decoding an UncheckedExtrinsic Feb 28, 2025
@@ -59,6 +61,9 @@ pub const LEGACY_EXTRINSIC_FORMAT_VERSION: ExtrinsicVersion = 4;
/// [UncheckedExtrinsic] implementation.
const EXTENSION_VERSION: ExtensionVersion = 0;

/// Maximum heap size for an extrinsic (in bytes).
const MAX_EXTRINSIC_HEAP_SIZE: usize = 10 * 1024 * 1024; // 10 MiB
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const MAX_EXTRINSIC_HEAP_SIZE: usize = 10 * 1024 * 1024; // 10 MiB
pub const MAX_EXTRINSIC_HEAP_SIZE: usize = 10 * 1024 * 1024; // 10 MiB

For integration testing.

Copy link
Contributor Author

@serban300 serban300 Mar 3, 2025

Choose a reason for hiding this comment

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

Done and also added a unit test. PTAL !

@serban300 serban300 marked this pull request as draft March 5, 2025 08:36
@serban300 serban300 changed the title Set a memory limit when decoding an UncheckedExtrinsic [Draft] Set a memory limit when decoding an UncheckedExtrinsic Mar 5, 2025
@serban300
Copy link
Contributor Author

Converting to draft since I'm still working on some changes related to UncheckedExtrinsic and I might publish everything in a single PR

@serban300 serban300 changed the title [Draft] Set a memory limit when decoding an UncheckedExtrinsic [Draft][WIP] Set a memory limit when decoding an UncheckedExtrinsic Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T17-primitives Changes to primitives that are not covered by any other label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants