Skip to content

Commit

Permalink
Lockdrop Precompile Fix (#1208)
Browse files Browse the repository at this point in the history
* Fixed call length to BoundedBytes

* PR comment
  • Loading branch information
PierreOssun authored Mar 27, 2024
1 parent d074a6d commit 3003bce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions precompiles/dispatch-lockdrop/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -57,6 +57,8 @@ pub struct DispatchLockdrop<Runtime, DispatchValidator, DecodeLimit = ConstU32<8
PhantomData<(Runtime, DispatchValidator, DecodeLimit)>,
);

type CallLengthLimit = ConstU32<4096>;

#[precompile_utils::precompile]
impl<Runtime, DispatchValidator, DecodeLimit>
DispatchLockdrop<Runtime, DispatchValidator, DecodeLimit>
Expand All @@ -73,7 +75,7 @@ where
#[precompile::public("dispatch_lockdrop_call(bytes,bytes)")]
fn dispatch_lockdrop_call(
handle: &mut impl PrecompileHandle,
call: UnboundedBytes,
call: BoundedBytes<CallLengthLimit>,
pubkey: BoundedBytes<ECDSAPublic>,
) -> EvmResult<bool> {
log::trace!(
Expand Down

0 comments on commit 3003bce

Please sign in to comment.