Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Proof size for chains without PoV causes runtime panic #12655

@nazar-pc

Description

@nazar-pc

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

#12383 in particular claims that chains without PoV should not care about proof size, but it doesn't seem to be the case.

The runtime I'm working on after Substrate upgrade was panicking with following:

Thread 'tokio-runtime-worker' panicked at 'Sensible defaults are tested to be valid; qed: ValidationErrors { has_errors: true, errors: ["[DispatchClass::Normal] Weight { ref_time: 1500000000000, proof_size: 0 } (total) has to be greater than Weight { ref_time: 5346284000, proof_size: 0 } (base block) & Weight { ref_time: 86298000, proof_size: 0 } (base extrinsic)", "[DispatchClass::Normal] Some(Weight { ref_time: 1299913702000, proof_size: 0 }) (max_extrinsic) must not be 0. Check base cost and average initialization cost.", "[DispatchClass::Normal] Weight { ref_time: 2000000000000, proof_size: 0 } (max block) must fit at least one extrinsic Weight { ref_time: 5432582000, proof_size: 0 } (base weight)", "[DispatchClass::Operational] Weight { ref_time: 2000000000000, proof_size: 0 } (total) has to be greater than Weight { ref_time: 5346284000, proof_size: 0 } (base block) & Weight { ref_time: 86298000, proof_size: 0 } (base extrinsic)", "[DispatchClass::Operational] Some(Weight { ref_time: 1799913702000, proof_size: 0 }) (max_extrinsic) must not be 0. Check base cost and average initialization cost.", "[DispatchClass::Operational] Weight { ref_time: 500000000000, proof_size: 0 } (reserved) has to be greater than Weight { ref_time: 86298000, proof_size: 0 } (base extrinsic) if set", "[DispatchClass::Operational] Weight { ref_time: 2000000000000, proof_size: 0 } (max block) must fit at least one extrinsic Weight { ref_time: 5432582000, proof_size: 0 } (base weight)", "[DispatchClass::Mandatory] Weight { ref_time: 2000000000000, proof_size: 0 } (max block) must fit at least one extrinsic Weight { ref_time: 5432582000, proof_size: 0 } (base weight)"] }', /home/nazar-pc/.cargo/git/checkouts/substrate-7bc20b373ca3e834/4fa79c1/frame/system/src/limits.rs:335

I have changed this:

BlockWeights::with_sensible_defaults(WEIGHT_PER_SECOND.saturating_mul(2), NORMAL_DISPATCH_RATIO)

To this:

BlockWeights::with_sensible_defaults(WEIGHT_PER_SECOND.saturating_mul(2).set_proof_size(1), NORMAL_DISPATCH_RATIO)

Now I'm getting another panic:

2022-11-09 03:43:28 [PrimaryChain] Proposing failed: Import failed: Error at calling runtime api: Execution failed: Runtime panicked: Sensible defaults are tested to be valid; qed: ValidationErrors { has_errors: true, errors: ["[DispatchClass::Operational] Weight { ref_time: 500000000000, proof_size: 0 } (reserved) has to be greater than Weight { ref_time: 86298000, proof_size: 0 } (base extrinsic) if set"] }    

There must be something wrong with Substrate if chains without PoV are required to be aware of such things.

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions