Skip to content

Commit

Permalink
deps: update substrate to polkadot-v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koushiro committed Jul 20, 2023
1 parent bd5bd37 commit 2b1b8d0
Show file tree
Hide file tree
Showing 18 changed files with 465 additions and 655 deletions.
1,004 changes: 404 additions & 600 deletions Cargo.lock

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ jsonrpsee = "0.16.2"
kvdb-rocksdb = "0.19.0"
libsecp256k1 = { version = "0.7.1", default-features = false }
log = { version = "0.4.17", default-features = false }
parity-db = "0.4.8"
parity-db = "0.4.9"
parking_lot = "0.12.1"
rlp = { version = "0.5", default-features = false }
scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.3.1", default-features = false, features = ["derive"] }
rlp = { version = "0.5.2", default-features = false }
scale-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = ["derive"] }
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
serde_json = "1.0"
sqlx = { version = "0.7.0-alpha.3", default-features = false, features = ["macros"] }
sqlx = { version = "0.7.1", default-features = false, features = ["macros"] }
thiserror = "1.0"
tokio = "1.28.2"
tokio = "1.29.1"
# Substrate Client
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down Expand Up @@ -94,22 +94,22 @@ sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/su
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { version = "21.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-io = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-keyring = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-keyring = { version = "24.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime-interface = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { version = "24.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime-interface = { version = "17.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-session = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-state-machine = { version = "0.13.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-storage = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-state-machine = { version = "0.28.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { version = "8.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-storage = { version = "13.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-trie = { version = "7.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-version = { version = "5.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-trie = { version = "22.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-version = { version = "22.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
# Substrate FRAME
frame-benchmarking = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-executive = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["server", "macros"] }
libsecp256k1 = { workspace = true }
log = { workspace = true }
lru = "0.8.1"
prometheus = { version = "0.13.1", default-features = false }
rand = "0.8"
rlp = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
schnellru = "0.2.1"
serde = { workspace = true }
tokio = { workspace = true, features = ["sync"] }

Expand Down
12 changes: 6 additions & 6 deletions client/rpc/src/eth/cache/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use lru::LruCache;
use scale_codec::Encode;
use schnellru::{LruMap, Unlimited};

pub struct LRUCacheByteLimited<K, V> {
cache: LruCache<K, V>,
cache: LruMap<K, V, Unlimited>,
max_size: u64,
metrics: Option<LRUCacheByteLimitedMetrics>,
size: u64,
Expand All @@ -44,7 +44,7 @@ impl<K: Eq + core::hash::Hash, V: Encode> LRUCacheByteLimited<K, V> {
};

Self {
cache: LruCache::unbounded(),
cache: LruMap::new(Unlimited),
max_size,
metrics,
size: 0,
Expand All @@ -70,7 +70,7 @@ impl<K: Eq + core::hash::Hash, V: Encode> LRUCacheByteLimited<K, V> {
self.size += v.encoded_size() as u64;

while self.size > self.max_size {
if let Some((_, v)) = self.cache.pop_lru() {
if let Some((_, v)) = self.cache.pop_oldest() {
let v_size = v.encoded_size() as u64;
self.size -= v_size;
} else {
Expand All @@ -79,7 +79,7 @@ impl<K: Eq + core::hash::Hash, V: Encode> LRUCacheByteLimited<K, V> {
}

// Add entry in cache
self.cache.put(k, v);
self.cache.insert(k, v);
// Update metrics
if let Some(metrics) = &self.metrics {
metrics.size.set(self.size);
Expand All @@ -97,7 +97,7 @@ impl LRUCacheByteLimitedMetrics {
pub(crate) fn register(
cache_name: &'static str,
registry: &prometheus_endpoint::Registry,
) -> std::result::Result<Self, prometheus_endpoint::PrometheusError> {
) -> Result<Self, prometheus_endpoint::PrometheusError> {
Ok(Self {
hits: prometheus_endpoint::register(
prometheus::IntCounter::new(
Expand Down
2 changes: 1 addition & 1 deletion frame/base-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -55,7 +56,6 @@ impl frame_system::Config for Test {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand Down
2 changes: 1 addition & 1 deletion frame/dynamic-fee/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -58,7 +59,6 @@ impl frame_system::Config for Test {
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand Down
4 changes: 2 additions & 2 deletions frame/ethereum/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ parameter_types! {
}

impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -73,7 +74,6 @@ impl frame_system::Config for Test {
type AccountId = AccountId32;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand Down Expand Up @@ -102,7 +102,7 @@ impl pallet_balances::Config for Test {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type ReserveIdentifier = ();
type HoldIdentifier = ();
type RuntimeHoldReason = ();
type FreezeIdentifier = ();
type MaxLocks = MaxLocks;
type MaxReserves = ();
Expand Down
2 changes: 1 addition & 1 deletion frame/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sp-runtime = { workspace = true }
sp-std = { workspace = true }
# Frontier
fp-account = { workspace = true }
fp-evm = { workspace = true }
fp-evm = { workspace = true, features = ["serde"] }

[dev-dependencies]
hex = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/precompile/dispatch/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -71,7 +72,6 @@ impl frame_system::Config for Test {
type AccountId = H160;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = generic::Header<u64, BlakeTwo256>;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand Down Expand Up @@ -103,7 +103,7 @@ impl pallet_balances::Config for Test {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type ReserveIdentifier = ();
type HoldIdentifier = ();
type RuntimeHoldReason = ();
type FreezeIdentifier = ();
type MaxLocks = ();
type MaxReserves = ();
Expand Down
4 changes: 2 additions & 2 deletions frame/evm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -69,7 +70,6 @@ impl frame_system::Config for Test {
type AccountId = H160;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = generic::Header<u64, BlakeTwo256>;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand All @@ -94,7 +94,7 @@ impl pallet_balances::Config for Test {
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
type ReserveIdentifier = ();
type HoldIdentifier = ();
type RuntimeHoldReason = ();
type FreezeIdentifier = ();
type MaxLocks = ();
type MaxReserves = ();
Expand Down
2 changes: 1 addition & 1 deletion frame/hotfix-sufficients/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ parameter_types! {
frame_system::limits::BlockWeights::simple_max(Weight::from_parts(1024, 0));
}
impl frame_system::Config for Test {
type RuntimeEvent = RuntimeEvent;
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
Expand All @@ -64,7 +65,6 @@ impl frame_system::Config for Test {
type AccountId = H160;
type Lookup = IdentityLookup<Self::AccountId>;
type Header = Header;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
type DbWeight = ();
type Version = ();
Expand Down
1 change: 1 addition & 0 deletions primitives/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ std = [
]
serde = [
"dep:serde",
"evm/with-serde",
"scale-info/serde",
"sp-core/serde",
"sp-runtime/serde",
Expand Down
12 changes: 10 additions & 2 deletions primitives/self-contained/src/unchecked_extrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ impl<Address, Call, Signature, Extra: SignedExtension>
}
}

impl<Address, Call: SelfContainedCall, Signature, Extra: SignedExtension> Extrinsic
impl<Address, Call, Signature, Extra> Extrinsic
for UncheckedExtrinsic<Address, Call, Signature, Extra>
where
Address: TypeInfo,
Call: SelfContainedCall + TypeInfo,
Signature: TypeInfo,
Extra: SignedExtension,
{
type Call = Call;

Expand Down Expand Up @@ -160,9 +165,12 @@ where
type SignedExtensions = Extra;
}

impl<Address, Call: SelfContainedCall, Signature, Extra> ExtrinsicCall
impl<Address, Call, Signature, Extra> ExtrinsicCall
for UncheckedExtrinsic<Address, Call, Signature, Extra>
where
Address: TypeInfo,
Call: SelfContainedCall + TypeInfo,
Signature: TypeInfo,
Extra: SignedExtension,
{
fn call(&self) -> &Self::Call {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
# Stable
#channel = "1.69.0" # rustc 1.69.0 (84c898d65 2023-04-16)
#channel = "1.70.0" # rustc 1.70.0 (84c898d65 2023-05-13)
# Nightly
channel = "nightly-2023-05-23" # rustc 1.71.0-nightly (8b4b20836 2023-05-22)
components = ["rustfmt", "clippy"]
Expand Down
10 changes: 5 additions & 5 deletions template/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
use sp_state_machine::BasicExternalities;
// Frontier
use frontier_template_runtime::{
AccountId, Balance, EnableManualSeal, GenesisConfig, SS58Prefix, Signature, WASM_BINARY,
AccountId, Balance, EnableManualSeal, RuntimeGenesisConfig, SS58Prefix, Signature, WASM_BINARY,
};

// The URL for the telemetry server.
// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";

/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig>;

/// Specialized `ChainSpec` for development.
pub type DevChainSpec = sc_service::GenericChainSpec<DevGenesisExt>;
Expand All @@ -29,7 +29,7 @@ pub type DevChainSpec = sc_service::GenericChainSpec<DevGenesisExt>;
#[derive(Serialize, Deserialize)]
pub struct DevGenesisExt {
/// Genesis config.
genesis_config: GenesisConfig,
genesis_config: RuntimeGenesisConfig,
/// The flag that if enable manual-seal mode.
enable_manual_seal: Option<bool>,
}
Expand Down Expand Up @@ -179,13 +179,13 @@ fn testnet_genesis(
endowed_accounts: Vec<AccountId>,
initial_authorities: Vec<(AuraId, GrandpaId)>,
chain_id: u64,
) -> GenesisConfig {
) -> RuntimeGenesisConfig {
use frontier_template_runtime::{
AuraConfig, BalancesConfig, EVMChainIdConfig, EVMConfig, GrandpaConfig, SudoConfig,
SystemConfig,
};

GenesisConfig {
RuntimeGenesisConfig {
// System
system: SystemConfig {
// Add Wasm runtime to storage.
Expand Down
9 changes: 2 additions & 7 deletions template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use futures::TryFutureExt;
// Substrate
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_cli::{ChainSpec, SubstrateCli};
use sc_service::DatabaseSource;
// Frontier
use fc_db::kv::frontier_database_dir;
Expand Down Expand Up @@ -68,10 +68,6 @@ impl SubstrateCli for Cli {
)?),
})
}

fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
&frontier_template_runtime::VERSION
}
}

/// Parse and run command line arguments
Expand Down Expand Up @@ -187,8 +183,7 @@ pub fn run() -> sc_cli::Result<()> {

let runner = cli.create_runner(cmd)?;
match cmd {
BenchmarkCmd::Pallet(cmd) => runner
.sync_run(|config| cmd.run::<Block, service::TemplateRuntimeExecutor>(config)),
BenchmarkCmd::Pallet(cmd) => runner.sync_run(|config| cmd.run::<Block, ()>(config)),
BenchmarkCmd::Block(cmd) => runner.sync_run(|mut config| {
let (client, _, _, _, _) = service::new_chain_ops(&mut config, &cli.eth)?;
cmd.run(client)
Expand Down
6 changes: 3 additions & 3 deletions template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }

# Frontier
fp-account = { workspace = true }
fp-evm = { workspace = true }
fp-account = { workspace = true, features = ["serde"] }
fp-evm = { workspace = true, features = ["serde"] }
fp-rpc = { workspace = true }
fp-self-contained = { workspace = true }
fp-self-contained = { workspace = true, features = ["serde"] }
# Frontier FRAME
pallet-base-fee = { workspace = true }
pallet-dynamic-fee = { workspace = true }
Expand Down
Loading

0 comments on commit 2b1b8d0

Please sign in to comment.