contracts: Improve contract address derivation (#12883)

* Add prefix to address derivation

* Extend benchmark

* Fix node test

* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts

* Adapt to new benchmark

* Update dispatchable benchmarks

* ".git/.scripts/bench-bot.sh" pallet dev pallet_contracts

* Use benchmark results

* Apply suggestions from code review

Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>

* Don't use T::AdressGenerator directly

* Rename constructor_args to input_data

Co-authored-by: command-bot <>
Co-authored-by: Sasha Gryaznov <hi@agryaznov.com>
This commit is contained in:
Alexander Theißen
2022-12-22 15:52:48 +01:00
committed by GitHub
parent af15848be0
commit 4083b5358a
18 changed files with 1559 additions and 1479 deletions
@@ -26,7 +26,6 @@ use crate::{
AccountIdOf, CodeVec, Config, Error, Schedule,
};
use codec::{Encode, MaxEncodedLen};
use sp_core::crypto::UncheckedFrom;
use sp_runtime::{traits::Hash, DispatchError};
use sp_std::prelude::*;
use wasm_instrument::{
@@ -396,7 +395,6 @@ fn instrument<E, T>(
where
E: Environment<()>,
T: Config,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
// Do not enable any features here. Any additional feature needs to be carefully
// checked for potential security issues. For example, enabling multi value could lead
@@ -500,7 +498,6 @@ pub fn prepare<E, T>(
where
E: Environment<()>,
T: Config,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
let (code, (initial, maximum)) =
instrument::<E, T>(original_code.as_ref(), schedule, determinism, try_instantiate)?;
@@ -547,7 +544,6 @@ pub fn reinstrument<E, T>(
where
E: Environment<()>,
T: Config,
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
{
instrument::<E, T>(original_code, schedule, determinism, TryInstantiate::Skip)
.map_err(|(err, msg)| {