Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests-evm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
repository: paritytech/revive-differential-tests
ref: 66feb36b4ef2c79415ca8ea765d8235d48dfa8f8
ref: 78ac7ee38113bb44b14cf495cf9c653dcf5f0edb
path: revive-differential-tests
submodules: recursive
- name: Installing Retester
Expand Down
14 changes: 14 additions & 0 deletions prdoc/pr_10535.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: Set a proper proof size block limit
doc:
- audience: Runtime Dev
description: |-
The current block limit of the revive dev node defined its `proof_size` as `u64::MAX`.

This is a reasonable setting for a standalone chain as the PoV as a limiting resource is only relevant for parachains.

However, this gives some confusing gas mapping calculations: they are correct and consistent but the resulting `proof_size` weights are unexpectedly high.

This PR sets the `proof_size` of the block limit to the same value as the Polkadot Asset Hub.
crates:
- name: revive-dev-runtime
bump: patch
1 change: 1 addition & 0 deletions substrate/frame/revive/dev-node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ polkadot-sdk = { workspace = true, features = [
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"parachains-common",
"polkadot-primitives",
"polkadot-runtime-common",
"runtime",
"with-tracing",
Expand Down
7 changes: 5 additions & 2 deletions substrate/frame/revive/dev-node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
/// by Operational extrinsics.
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 2 seconds of compute with a 6 second average block time, with maximum proof size.
const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX);
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
polkadot_primitives::MAX_POV_SIZE as u64,
);

parameter_types! {
pub const Version: RuntimeVersion = VERSION;
Expand Down Expand Up @@ -298,6 +300,7 @@ parameter_types! {
#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
impl frame_system::Config for Runtime {
type Block = Block;
type BlockWeights = RuntimeBlockWeights;
type Version = Version;
type AccountId = AccountId;
type Hash = Hash;
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/revive/src/call_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ where
key: &[u8],
) -> Result<Self, &'static str> {
/// Number of layers in a Radix16 unbalanced trie.
const UNBALANCED_TRIE_LAYERS: u32 = 20;
const UNBALANCED_TRIE_LAYERS: u32 = 10;

if (key.len() as u32) < UNBALANCED_TRIE_LAYERS.div_ceil(2) {
return Err("Key size too small to create the specified trie");
Expand Down
Loading
Loading