Skip to content

Commit ebbf148

Browse files
committed
Fixes
1 parent 1e66fd9 commit ebbf148

File tree

10 files changed

+33
-18
lines changed

10 files changed

+33
-18
lines changed

pallet/ethtx-forwarder/src/mock.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl fp_evm::FeeCalculator for FixedGasPrice {
6060
}
6161
}
6262
impl pallet_evm::Config for Runtime {
63+
type AccountProvider = pallet_evm::FrameSystemAccountProvider<Self>;
6364
type AddressMapping = pallet_evm::IdentityAddressMapping;
6465
type BlockGasLimit = BlockGasLimit;
6566
type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping<Self>;
@@ -69,6 +70,7 @@ impl pallet_evm::Config for Runtime {
6970
type FeeCalculator = FixedGasPrice;
7071
type FindAuthor = ();
7172
type GasLimitPovSizeRatio = ();
73+
type GasLimitStorageGrowthRatio = ();
7274
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
7375
type OnChargeTransaction = ();
7476
type OnCreate = ();
@@ -90,7 +92,7 @@ impl pallet_ethereum::Config for Runtime {
9092
type ExtraDataLength = ();
9193
type PostLogContent = PostBlockAndTxnHashes;
9294
type RuntimeEvent = RuntimeEvent;
93-
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;
95+
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self::Version>;
9496
}
9597

9698
impl darwinia_ethtx_forwarder::Config for Runtime {

precompile/assets/src/mock.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ frame_support::parameter_types! {
130130
}
131131

132132
impl pallet_evm::Config for Runtime {
133+
type AccountProvider = pallet_evm::FrameSystemAccountProvider<Self>;
133134
type AddressMapping = pallet_evm::IdentityAddressMapping;
134135
type BlockGasLimit = BlockGasLimit;
135136
type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping<Self>;
@@ -139,6 +140,7 @@ impl pallet_evm::Config for Runtime {
139140
type FeeCalculator = ();
140141
type FindAuthor = ();
141142
type GasLimitPovSizeRatio = ();
143+
type GasLimitStorageGrowthRatio = ();
142144
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
143145
type OnChargeTransaction = ();
144146
type OnCreate = ();

precompile/state-storage/src/mock.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ frame_support::parameter_types! {
117117
}
118118

119119
impl pallet_evm::Config for Runtime {
120+
type AccountProvider = pallet_evm::FrameSystemAccountProvider<Self>;
120121
type AddressMapping = pallet_evm::IdentityAddressMapping;
121122
type BlockGasLimit = BlockGasLimit;
122123
type BlockHashMapping = pallet_evm::SubstrateBlockHashMapping<Self>;
@@ -126,6 +127,7 @@ impl pallet_evm::Config for Runtime {
126127
type FeeCalculator = ();
127128
type FindAuthor = ();
128129
type GasLimitPovSizeRatio = ();
130+
type GasLimitStorageGrowthRatio = ();
129131
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
130132
type OnChargeTransaction = ();
131133
type OnCreate = ();

runtime/common/src/pallet_config.rs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,25 @@ use sp_core::U256;
7979
use sp_runtime::traits::AccountIdConversion;
8080
use sp_std::vec;
8181

82-
/// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is
83-
/// used to limit the maximal weight of a single extrinsic.
84-
const AVERAGE_ON_INITIALIZE_RATIO: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(5);
8582
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used by
8683
/// `Operational` extrinsics.
8784
pub const NORMAL_DISPATCH_RATIO: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(75);
88-
const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2_000;
8985
pub const MAXIMUM_BLOCK_WEIGHT: frame_support::weights::Weight =
9086
frame_support::weights::Weight::from_parts(
9187
frame_support::weights::constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
9288
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
9389
);
9490

91+
// We assume that ~5% of the block weight is consumed by `on_initialize` handlers. This is
92+
// used to limit the maximal weight of a single extrinsic.
93+
const AVERAGE_ON_INITIALIZE_RATIO: sp_runtime::Perbill = sp_runtime::Perbill::from_percent(5);
94+
const WEIGHT_MILLISECS_PER_BLOCK: u64 = 2_000;
9595
const BLOCK_GAS_LIMIT: u64 = 20_000_000;
96-
97-
// TODO: remove in stable2409.
98-
#[cfg(not(feature = "runtime-benchmarks"))]
99-
const EXISTENTIAL_DEPOSIT: Balance = 0;
100-
#[cfg(feature = "runtime-benchmarks")]
101-
const EXISTENTIAL_DEPOSIT: Balance = 1;
102-
frame_support::parameter_types! {
103-
pub const ExistentialDeposit: Balance = EXISTENTIAL_DEPOSIT;
104-
}
96+
const MAX_STORAGE_GROWTH: u64 = 400 * 1024;
10597

10698
frame_support::parameter_types! {
10799
pub const MaxBalance: Balance = Balance::MAX;
100+
pub const ExistentialDeposit: Balance = 0;
108101

109102
// Retry a scheduled item every 10 blocks (1 minute) until the preimage exists.
110103
pub const NoPreimagePostponement: Option<u32> = Some(10);
@@ -116,6 +109,8 @@ frame_support::parameter_types! {
116109
pub const ReservedXcmpWeight: frame_support::weights::Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
117110
pub const ReservedDmpWeight: frame_support::weights::Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
118111

112+
pub const GasLimitStorageGrowthRatio: u64 = BLOCK_GAS_LIMIT.saturating_div(MAX_STORAGE_GROWTH);
113+
119114
pub RuntimeBlockLength: frame_system::limits::BlockLength =
120115
frame_system::limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
121116
pub RuntimeBlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights::builder()

runtime/crab/src/pallets/ethereum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ impl pallet_ethereum::Config for Runtime {
2727
type ExtraDataLength = ConstU32<64>;
2828
type PostLogContent = PostBlockAndTxnHashes;
2929
type RuntimeEvent = RuntimeEvent;
30-
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;
30+
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self::Version>;
3131
}

runtime/crab/src/pallets/evm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ impl DispatchValidateT<AccountId, RuntimeCall> for DarwiniaDispatchValidator {
161161
}
162162

163163
impl pallet_evm::Config for Runtime {
164+
type AccountProvider = pallet_evm::FrameSystemAccountProvider<Self>;
164165
type AddressMapping = pallet_evm::IdentityAddressMapping;
165166
type BlockGasLimit = pallet_config::BlockGasLimit;
166167
type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping<Self>;
@@ -170,14 +171,14 @@ impl pallet_evm::Config for Runtime {
170171
type FeeCalculator = TransactionPaymentGasPrice;
171172
type FindAuthor = FindAuthor<pallet_session::FindAccountFromAuthorIndex<Self, Aura>>;
172173
type GasLimitPovSizeRatio = pallet_config::GasLimitPovSizeRatio;
174+
type GasLimitStorageGrowthRatio = GasLimitStorageGrowthRatio;
173175
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
174176
type OnChargeTransaction = pallet_evm::EVMFungibleAdapter<Balances, ()>;
175177
type OnCreate = ();
176178
type PrecompilesType = Precompiles;
177179
type PrecompilesValue = PrecompilesValue;
178180
type Runner = pallet_evm::runner::stack::Runner<Self>;
179181
type RuntimeEvent = RuntimeEvent;
180-
type SuicideQuickClearLimit = ();
181182
type Timestamp = Timestamp;
182183
type WeightInfo = ();
183184
type WeightPerGas = pallet_config::WeightPerGas;

runtime/crab/src/weights/pallet_assets.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
195195
.saturating_add(T::DbWeight::get().reads(4))
196196
.saturating_add(T::DbWeight::get().writes(4))
197197
}
198+
fn transfer_all() -> Weight {
199+
Weight::from_parts(33_000_000, 0)
200+
.saturating_add(Weight::from_parts(0, 6168))
201+
.saturating_add(T::DbWeight::get().reads(4))
202+
.saturating_add(T::DbWeight::get().writes(4))
203+
}
198204
/// Storage: `Assets::Asset` (r:1 w:1)
199205
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`)
200206
/// Storage: `Assets::Account` (r:2 w:2)

runtime/darwinia/src/pallets/ethereum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ impl pallet_ethereum::Config for Runtime {
2727
type ExtraDataLength = ConstU32<64>;
2828
type PostLogContent = PostBlockAndTxnHashes;
2929
type RuntimeEvent = RuntimeEvent;
30-
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;
30+
type StateRoot = pallet_ethereum::IntermediateStateRoot<Self::Version>;
3131
}

runtime/darwinia/src/pallets/evm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl DispatchValidateT<AccountId, RuntimeCall> for DarwiniaDispatchValidator {
163163
}
164164

165165
impl pallet_evm::Config for Runtime {
166+
type AccountProvider = pallet_evm::FrameSystemAccountProvider<Self>;
166167
type AddressMapping = pallet_evm::IdentityAddressMapping;
167168
type BlockGasLimit = pallet_config::BlockGasLimit;
168169
type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping<Self>;
@@ -172,14 +173,14 @@ impl pallet_evm::Config for Runtime {
172173
type FeeCalculator = TransactionPaymentGasPrice;
173174
type FindAuthor = FindAuthor<pallet_session::FindAccountFromAuthorIndex<Self, Aura>>;
174175
type GasLimitPovSizeRatio = pallet_config::GasLimitPovSizeRatio;
176+
type GasLimitStorageGrowthRatio = ();
175177
type GasWeightMapping = pallet_evm::FixedGasWeightMapping<Self>;
176178
type OnChargeTransaction = pallet_evm::EVMFungibleAdapter<Balances, ()>;
177179
type OnCreate = ();
178180
type PrecompilesType = Precompiles;
179181
type PrecompilesValue = PrecompilesValue;
180182
type Runner = pallet_evm::runner::stack::Runner<Self>;
181183
type RuntimeEvent = RuntimeEvent;
182-
type SuicideQuickClearLimit = ();
183184
type Timestamp = Timestamp;
184185
type WeightInfo = ();
185186
type WeightPerGas = pallet_config::WeightPerGas;

runtime/darwinia/src/weights/pallet_assets.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
195195
.saturating_add(T::DbWeight::get().reads(4))
196196
.saturating_add(T::DbWeight::get().writes(4))
197197
}
198+
fn transfer_all() -> Weight {
199+
Weight::from_parts(33_000_000, 0)
200+
.saturating_add(Weight::from_parts(0, 6168))
201+
.saturating_add(T::DbWeight::get().reads(4))
202+
.saturating_add(T::DbWeight::get().writes(4))
203+
}
198204
/// Storage: `Assets::Asset` (r:1 w:1)
199205
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(166), added: 2641, mode: `MaxEncodedLen`)
200206
/// Storage: `Assets::Account` (r:2 w:2)

0 commit comments

Comments
 (0)