Skip to content

Commit

Permalink
Merge branch 'master' into kiz-frame-umbrella-in-pallets
Browse files Browse the repository at this point in the history
  • Loading branch information
re-gius authored Oct 29, 2024
2 parents 61db970 + 54c19f5 commit f5ba680
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 6 deletions.
10 changes: 10 additions & 0 deletions prdoc/pr_6263.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: '[pallet-revive] Update typeInfo'
doc:
- audience: Runtime Dev
description: |-
Update typeinfo impl to make it transparent for subxt

see https://github.com/paritytech/subxt/pull/1845
crates:
- name: pallet-revive
bump: minor
12 changes: 12 additions & 0 deletions prdoc/pr_6264.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: 'pallet-revive: Trade code size for call stack depth'
doc:
- audience: Runtime Dev
description: This will reduce the call stack depth in order to raise the allowed
code size. Should allow around 100KB of instructions. This is necessary to stay
within the memory envelope. More code size is more appropriate for testing right
now. We will re-evaluate parameters once we have 64bit support.
crates:
- name: pallet-revive-fixtures
bump: major
- name: pallet-revive
bump: major
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extern crate common;

use uapi::{HostFn, HostFnImpl as api, ReturnFlags};

static mut BUFFER: [u8; 1025 * 1024] = [0; 1025 * 1024];
static mut BUFFER: [u8; 2 * 1025 * 1024] = [0; 2 * 1025 * 1024];

#[no_mangle]
#[polkavm_derive::polkavm_export]
Expand Down
18 changes: 15 additions & 3 deletions substrate/frame/revive/src/evm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use frame_support::{
traits::{ExtrinsicCall, InherentBuilder, SignedTransactionBuilder},
};
use pallet_transaction_payment::OnChargeTransaction;
use scale_info::TypeInfo;
use scale_info::{StaticTypeInfo, TypeInfo};
use sp_arithmetic::Percent;
use sp_core::{Get, U256};
use sp_runtime::{
Expand All @@ -52,12 +52,24 @@ pub const GAS_PRICE: u32 = 1u32;

/// Wraps [`generic::UncheckedExtrinsic`] to support checking unsigned
/// [`crate::Call::eth_transact`] extrinsic.
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)]
#[scale_info(skip_type_params(E))]
#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)]
pub struct UncheckedExtrinsic<Address, Signature, E: EthExtra>(
pub generic::UncheckedExtrinsic<Address, CallOf<E::Config>, Signature, E::Extension>,
);

impl<Address, Signature, E: EthExtra> TypeInfo for UncheckedExtrinsic<Address, Signature, E>
where
Address: StaticTypeInfo,
Signature: StaticTypeInfo,
E::Extension: StaticTypeInfo,
{
type Identity =
generic::UncheckedExtrinsic<Address, CallOf<E::Config>, Signature, E::Extension>;
fn type_info() -> scale_info::Type {
generic::UncheckedExtrinsic::<Address, CallOf<E::Config>, Signature, E::Extension>::type_info()
}
}

impl<Address, Signature, E: EthExtra>
From<generic::UncheckedExtrinsic<Address, CallOf<E::Config>, Signature, E::Extension>>
for UncheckedExtrinsic<Address, Signature, E>
Expand Down
4 changes: 2 additions & 2 deletions substrate/frame/revive/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
///
/// A 0 means that no callings of other contracts are possible. In other words only the origin
/// called "root contract" is allowed to execute then.
pub const CALL_STACK_DEPTH: u32 = 10;
pub const CALL_STACK_DEPTH: u32 = 5;

/// The maximum number of topics a call to [`crate::SyscallDoc::deposit_event`] can emit.
///
Expand Down Expand Up @@ -97,7 +97,7 @@ pub mod code {
/// for more code or more data. However, since code will decompress
/// into a bigger representation on compilation it will only increase
/// the allowed code size by [`BYTE_PER_INSTRUCTION`].
pub const STATIC_MEMORY_BYTES: u32 = 1024 * 1024;
pub const STATIC_MEMORY_BYTES: u32 = 2 * 1024 * 1024;

/// How much memory each instruction will take in-memory after compilation.
///
Expand Down

0 comments on commit f5ba680

Please sign in to comment.