Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,828 changes: 1,326 additions & 1,502 deletions Cargo.lock

Large diffs are not rendered by default.

151 changes: 76 additions & 75 deletions Cargo.toml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub use ethereum::{
};
use ethereum_types::{Bloom, BloomInput, H160, H256, H64, U256};
use evm::ExitReason;
use scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
// Substrate
use frame_support::{
Expand Down Expand Up @@ -72,7 +72,7 @@ use fp_storage::{EthereumStorageSchema, PALLET_ETHEREUM_SCHEMA};
use pallet_evm::{BlockHashMapping, FeeCalculator, GasWeightMapping, Runner};

#[derive(Clone, Eq, PartialEq, RuntimeDebug)]
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
#[derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo)]
pub enum RawOrigin {
EthereumTransaction(H160),
}
Expand Down
18 changes: 12 additions & 6 deletions frame/ethereum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,12 @@ pub fn new_test_ext(accounts_len: usize) -> (Vec<AccountInfo>, sp_io::TestExtern
.map(|i| (pairs[i].account_id.clone(), 10_000_000))
.collect();

pallet_balances::GenesisConfig::<Test> { balances }
.assimilate_storage(&mut ext)
.unwrap();
pallet_balances::GenesisConfig::<Test> {
balances,
dev_accounts: None,
}
.assimilate_storage(&mut ext)
.unwrap();

(pairs, ext.into())
}
Expand All @@ -226,9 +229,12 @@ pub fn new_test_ext_with_initial_balance(
.map(|i| (pairs[i].account_id.clone(), initial_balance))
.collect();

pallet_balances::GenesisConfig::<Test> { balances }
.assimilate_storage(&mut ext)
.unwrap();
pallet_balances::GenesisConfig::<Test> {
balances,
dev_accounts: None,
}
.assimilate_storage(&mut ext)
.unwrap();

(pairs, ext.into())
}
Expand Down
1 change: 1 addition & 0 deletions frame/evm/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
<Test as Config>::AddressMapping::into_account_id(author),
12345,
)],
dev_accounts: None,
}
.assimilate_storage(&mut t)
.expect("Pallet balances storage can be assimilated");
Expand Down
4 changes: 2 additions & 2 deletions precompiles/src/testing/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
use pallet_evm::AddressMapping;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_core::{keccak_256, Decode, Encode, MaxEncodedLen, H160, H256};
use sp_core::{keccak_256, Decode, DecodeWithMemTracking, Encode, MaxEncodedLen, H160, H256};

#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
#[derive(Serialize, Deserialize, derive_more::Display)]
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
#[derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo)]
pub struct MockAccount(pub H160);

impl MockAccount {
Expand Down
13 changes: 10 additions & 3 deletions primitives/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern crate alloc;
use alloc::string::{String, ToString};
use core::fmt;

use scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
// Substrate
use sp_core::{crypto::AccountId32, ecdsa, RuntimeDebug, H160, H256};
Expand All @@ -38,7 +38,7 @@ use xcm::latest::{Junction, Location};
/// Conforms to H160 address and ECDSA key standards.
/// Alternative to H256->H160 mapping.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Default, Hash)]
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
#[derive(Encode, Decode, DecodeWithMemTracking, MaxEncodedLen, TypeInfo)]
pub struct AccountId20(pub [u8; 20]);

#[cfg(feature = "serde")]
Expand Down Expand Up @@ -186,7 +186,14 @@ impl From<AccountId20> for Location {
}

#[derive(Clone, Eq, PartialEq)]
#[derive(RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)]
#[derive(
RuntimeDebug,
Encode,
Decode,
DecodeWithMemTracking,
MaxEncodedLen,
TypeInfo
)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct EthereumSignature(ecdsa::Signature);

Expand Down
13 changes: 11 additions & 2 deletions primitives/self-contained/src/unchecked_extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use frame_support::{
dispatch::{DispatchInfo, GetDispatchInfo},
traits::{ExtrinsicCall, InherentBuilder, SignedTransactionBuilder},
};
use scale_codec::{Decode, Encode};
use scale_codec::{Decode, DecodeWithMemTracking, Encode};
use scale_info::TypeInfo;
use sp_runtime::{
generic::{self, Preamble},
Expand All @@ -35,7 +35,16 @@ use crate::{CheckedExtrinsic, CheckedSignature, SelfContainedCall};

/// A extrinsic right from the external world. This is unchecked and so
/// can contain a signature.
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
#[derive(
PartialEq,
Eq,
Clone,
Encode,
Decode,
DecodeWithMemTracking,
RuntimeDebug,
TypeInfo
)]
pub struct UncheckedExtrinsic<Address, Call, Signature, Extension>(
pub generic::UncheckedExtrinsic<Address, Call, Signature, Extension>,
);
Expand Down
2 changes: 1 addition & 1 deletion template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ fp-rpc = { workspace = true, features = ["default"] }
frontier-template-runtime = { workspace = true, features = ["std"] }

# Cumulus primitives
cumulus-pallet-weight-reclaim = { workspace = true }
cumulus-primitives-proof-size-hostfunction = { workspace = true }
cumulus-primitives-storage-weight-reclaim = { workspace = true }

[build-dependencies]
substrate-build-script-utils = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion template/node/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn create_benchmark_extrinsic(
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
frame_system::CheckWeight::<runtime::Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::<runtime::Runtime>::new(),
cumulus_pallet_weight_reclaim::StorageWeightReclaim::<runtime::Runtime, ()>::new(()),
Comment thread
RomarQ marked this conversation as resolved.
);

let raw_payload = runtime::SignedPayload::from_raw(
Expand Down
4 changes: 1 addition & 3 deletions template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ where
Some(WarpSyncConfig::WithProvider(warp_sync))
};

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
let (network, system_rpc_tx, tx_handler_controller, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
net_config,
Expand Down Expand Up @@ -540,7 +540,6 @@ where
commands_stream,
)?;

network_starter.start_network();
log::info!("Manual Seal Ready");
return Ok(task_manager);
}
Expand Down Expand Up @@ -639,7 +638,6 @@ where
.spawn_blocking("grandpa-voter", None, grandpa_voter);
}

network_starter.start_network();
Ok(task_manager)
}

Expand Down
4 changes: 2 additions & 2 deletions template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pallet-evm-precompile-sha3fips = { workspace = true }
pallet-evm-precompile-simple = { workspace = true }

# Cumulus primitives
cumulus-primitives-storage-weight-reclaim = { workspace = true }
cumulus-pallet-weight-reclaim = { workspace = true }

[build-dependencies]
substrate-wasm-builder = { workspace = true, optional = true }
Expand Down Expand Up @@ -114,7 +114,7 @@ std = [
"pallet-evm-precompile-sha3fips/std",
"pallet-evm-precompile-simple/std",
# Cumulus primitives
"cumulus-primitives-storage-weight-reclaim/std",
"cumulus-pallet-weight-reclaim/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand Down
10 changes: 7 additions & 3 deletions template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub type SignedExtra = (
frame_system::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
pallet_transaction_payment::ChargeTransactionPayment<Runtime>,
cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim<Runtime>,
cumulus_pallet_weight_reclaim::StorageWeightReclaim<Runtime, ()>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down Expand Up @@ -262,6 +262,10 @@ impl pallet_grandpa::Config for Runtime {
type EquivocationReportSystem = ();
}

impl cumulus_pallet_weight_reclaim::Config for Runtime {
type WeightInfo = ();
}

parameter_types! {
pub storage EnableManualSeal: bool = false;
}
Expand Down Expand Up @@ -1020,7 +1024,7 @@ impl_runtime_apis! {
Vec<frame_benchmarking::BenchmarkList>,
Vec<frame_support::traits::StorageInfo>,
) {
use frame_benchmarking::{baseline, Benchmarking, BenchmarkList};
use frame_benchmarking::{baseline, BenchmarkList};
use frame_support::traits::StorageInfoTrait;

use baseline::Pallet as BaselineBench;
Expand All @@ -1036,7 +1040,7 @@ impl_runtime_apis! {
fn dispatch_benchmark(
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {
use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch};
use frame_benchmarking::{baseline, BenchmarkBatch};
use frame_support::traits::TrackedStorageKey;

use baseline::Pallet as BaselineBench;
Expand Down
Loading