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

Dynamic uncompressed code size limit #7760

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

Conversation

sandreim
Copy link
Contributor

Fixes #7664

The discussion in #7710 should provide the context for why this solution was picked.

@@ -824,6 +827,9 @@ impl RuntimeApiRequest {

/// `SchedulingLookahead`
pub const SCHEDULING_LOOKAHEAD_RUNTIME_REQUIREMENT: u32 = 12;

/// `ValidationCodeBombLimit`
pub const VALIDATION_CODE_BOMB_LIMIT_RUNTIME_REQUIREMENT: u32 = 12;
Copy link
Contributor Author

@sandreim sandreim Feb 28, 2025

Choose a reason for hiding this comment

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

Hmm, this likely needs to be 13, if we don't make it to march stable.

@sandreim
Copy link
Contributor Author

sandreim commented Mar 5, 2025

/cmd prdoc --audience runtime-dev --bump minor

@sandreim
Copy link
Contributor Author

sandreim commented Mar 5, 2025

/cmd prdoc --audience runtime_dev --bump minor

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Command "prdoc --audience runtime-dev --bump minor" has failed ❌! See logs here

@sandreim sandreim marked this pull request as ready for review March 5, 2025 10:28
sandreim added 2 commits March 5, 2025 12:39
Signed-off-by: Andrei Sandu <[email protected]>
Signed-off-by: Andrei Sandu <[email protected]>
@sandreim sandreim added T0-node This PR/Issue is related to the topic “node”. T4-runtime_API This PR/Issue is related to runtime APIs. T8-polkadot This PR/Issue is related to/affects the Polkadot network. labels Mar 5, 2025
sandreim and others added 6 commits March 5, 2025 16:27
Signed-off-by: Andrei Sandu <[email protected]>
Signed-off-by: Andrei Sandu <[email protected]>
Signed-off-by: Andrei Sandu <[email protected]>
Signed-off-by: Andrei Sandu <[email protected]>
Signed-off-by: Andrei Sandu <[email protected]>
@@ -69,6 +69,10 @@ const MERKLE_NODE_MAX_SIZE: usize = 512 + 100;
const MERKLE_PROOF_MAX_DEPTH: usize = 8;

/// The bomb limit for decompressing code blobs.
#[deprecated(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice!

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/13680519135
Failed job name: cargo-clippy


/***** Added in v12 *****/
/// Retrieve the maximum uncompressed code size.
#[api_version(12)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[api_version(12)]
#[api_version(13)]

v12 is deployed on westend. I think you need to bump to 13:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to backport in march stable :D

@@ -353,6 +353,10 @@ pub trait RuntimeApiSubsystemClient {
// === v12 ===
/// Fetch the scheduling lookahead value
async fn scheduling_lookahead(&self, at: Hash) -> Result<u32, ApiError>;

// === v12 ===
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// === v12 ===
// === v13 ===

@@ -308,5 +308,10 @@ sp_api::decl_runtime_apis! {
/// Retrieve the scheduling lookahead
#[api_version(12)]
fn scheduling_lookahead() -> u32;

/***** Added in v12 *****/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/***** Added in v12 *****/
/***** Added in v13 *****/

@@ -824,6 +827,9 @@ impl RuntimeApiRequest {

/// `SchedulingLookahead`
pub const SCHEDULING_LOOKAHEAD_RUNTIME_REQUIREMENT: u32 = 12;

/// `ValidationCodeBombLimit`
pub const VALIDATION_CODE_BOMB_LIMIT_RUNTIME_REQUIREMENT: u32 = 12;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub const VALIDATION_CODE_BOMB_LIMIT_RUNTIME_REQUIREMENT: u32 = 12;
pub const VALIDATION_CODE_BOMB_LIMIT_RUNTIME_REQUIREMENT: u32 = 13;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”. T4-runtime_API This PR/Issue is related to runtime APIs. T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator emits Possible compression bomb encountered for ah-next
3 participants