From 1c2162a19200f60a4e8aa370eb756ac67f06bfae Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Wed, 27 Mar 2024 14:54:07 +0100 Subject: [PATCH 1/2] Fixed call length to BoundedBytes --- precompiles/dispatch-lockdrop/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/precompiles/dispatch-lockdrop/src/lib.rs b/precompiles/dispatch-lockdrop/src/lib.rs index 5a81a9f6d8..a83a02281a 100644 --- a/precompiles/dispatch-lockdrop/src/lib.rs +++ b/precompiles/dispatch-lockdrop/src/lib.rs @@ -33,7 +33,7 @@ use frame_system::Config; use pallet_evm::GasWeightMapping; use pallet_evm_precompile_dispatch::DispatchValidateT; use parity_scale_codec::DecodeLimit; -use precompile_utils::prelude::{revert, BoundedBytes, RuntimeHelper, UnboundedBytes}; +use precompile_utils::prelude::{revert, BoundedBytes, RuntimeHelper}; use precompile_utils::EvmResult; use sp_core::{crypto::AccountId32, H160, H256}; use sp_io::hashing::keccak_256; @@ -57,6 +57,8 @@ pub struct DispatchLockdrop, ); +type CallLengthLimit = ConstU32<{ 2u32.pow(12) }>; + #[precompile_utils::precompile] impl DispatchLockdrop @@ -73,7 +75,7 @@ where #[precompile::public("dispatch_lockdrop_call(bytes,bytes)")] fn dispatch_lockdrop_call( handle: &mut impl PrecompileHandle, - call: UnboundedBytes, + call: BoundedBytes, pubkey: BoundedBytes, ) -> EvmResult { log::trace!( From 6e354eba07628f1033af96c2bf638fc9030916dd Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Wed, 27 Mar 2024 15:15:26 +0100 Subject: [PATCH 2/2] PR comment --- precompiles/dispatch-lockdrop/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precompiles/dispatch-lockdrop/src/lib.rs b/precompiles/dispatch-lockdrop/src/lib.rs index a83a02281a..29b736253c 100644 --- a/precompiles/dispatch-lockdrop/src/lib.rs +++ b/precompiles/dispatch-lockdrop/src/lib.rs @@ -57,7 +57,7 @@ pub struct DispatchLockdrop, ); -type CallLengthLimit = ConstU32<{ 2u32.pow(12) }>; +type CallLengthLimit = ConstU32<4096>; #[precompile_utils::precompile] impl