diff --git a/Cargo.lock b/Cargo.lock index 8096e8dc2..99ddc245f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1508,7 +1508,7 @@ dependencies = [ [[package]] name = "crab-runtime" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "cumulus-pallet-aura-ext", @@ -2504,7 +2504,7 @@ dependencies = [ [[package]] name = "darwinia" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "async-trait", @@ -2589,7 +2589,7 @@ dependencies = [ [[package]] name = "darwinia-account-migration" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "darwinia-deposit", @@ -2612,7 +2612,7 @@ dependencies = [ [[package]] name = "darwinia-asset-limit" -version = "6.8.1" +version = "6.9.0" dependencies = [ "frame-support", "frame-system", @@ -2623,7 +2623,7 @@ dependencies = [ [[package]] name = "darwinia-common-runtime" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "cumulus-primitives-core", @@ -2654,7 +2654,7 @@ dependencies = [ [[package]] name = "darwinia-deposit" -version = "6.8.1" +version = "6.9.0" dependencies = [ "darwinia-ethtx-forwarder", "dc-types", @@ -2676,7 +2676,7 @@ dependencies = [ [[package]] name = "darwinia-ethtx-forwarder" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "ethabi", @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "darwinia-precompile-assets" -version = "6.8.1" +version = "6.9.0" dependencies = [ "fp-evm", "frame-support", @@ -2726,7 +2726,7 @@ dependencies = [ [[package]] name = "darwinia-precompile-state-storage" -version = "6.8.1" +version = "6.9.0" dependencies = [ "fp-evm", "frame-support", @@ -2745,7 +2745,7 @@ dependencies = [ [[package]] name = "darwinia-runtime" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "cumulus-pallet-aura-ext", @@ -2844,7 +2844,7 @@ dependencies = [ [[package]] name = "darwinia-staking" -version = "6.8.1" +version = "6.9.0" dependencies = [ "darwinia-ethtx-forwarder", "dc-inflation", @@ -2911,7 +2911,7 @@ dependencies = [ [[package]] name = "dc-inflation" -version = "6.8.1" +version = "6.9.0" dependencies = [ "dc-types", "sp-arithmetic", @@ -2920,7 +2920,7 @@ dependencies = [ [[package]] name = "dc-primitives" -version = "6.8.1" +version = "6.9.0" dependencies = [ "dc-types", "fp-account", @@ -2930,7 +2930,7 @@ dependencies = [ [[package]] name = "dc-types" -version = "6.8.1" +version = "6.9.0" [[package]] name = "der" @@ -5756,7 +5756,7 @@ checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" [[package]] name = "koi-runtime" -version = "6.8.1" +version = "6.9.0" dependencies = [ "array-bytes 7.1.0", "cumulus-pallet-aura-ext", diff --git a/Cargo.toml b/Cargo.toml index 9521b6cb6..65ec00aac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ edition = "2021" homepage = "https://darwinia.network" license = "GPL-3.0" repository = "https://github.com/darwinia-network/darwinia" -version = "6.8.1" +version = "6.9.0" [workspace.dependencies] # crates.io diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index cf972084a..25f81b12d 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -138,8 +138,7 @@ where { let d = env::current_exe().unwrap().parent().unwrap().to_path_buf(); let p = d.join(name); - - if !p.is_file() { + let download = || { println!("Downloading `{name}` to `{}`", d.display()); thread::spawn(move || { @@ -156,6 +155,21 @@ where }) .join() .unwrap(); + }; + + if !p.is_file() { + download(); + } else if let Ok(metadata) = p.metadata() { + // Fetch the latest spec every 14 days. + if let Ok(date) = metadata.modified() { + if let Ok(elapsed) = date.elapsed() { + if elapsed.as_secs() > 60 * 60 * 24 * 14 { + if fs::remove_file(p.clone()).is_ok() { + download(); + } + } + } + } } println!("Loading genesis from `{}`", p.display()); diff --git a/pallet/account-migration/src/mock.rs b/pallet/account-migration/src/mock.rs index db9473750..6054239c4 100644 --- a/pallet/account-migration/src/mock.rs +++ b/pallet/account-migration/src/mock.rs @@ -28,7 +28,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Darwinia2"), impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"), authoring_version: 0, - spec_version: 6_8_1_0, + spec_version: 6_9_0_0, impl_version: 0, apis: sp_version::create_apis_vec!([]), transaction_version: 0, diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index de4e65409..95b19d806 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -84,7 +84,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Crab2"), impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"), authoring_version: 0, - spec_version: 6_8_1_0, + spec_version: 6_9_0_0, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0, diff --git a/runtime/darwinia/src/lib.rs b/runtime/darwinia/src/lib.rs index f432f27e5..54dd9da82 100644 --- a/runtime/darwinia/src/lib.rs +++ b/runtime/darwinia/src/lib.rs @@ -84,7 +84,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Darwinia2"), impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"), authoring_version: 0, - spec_version: 6_8_1_0, + spec_version: 6_9_0_0, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0, diff --git a/runtime/koi/src/lib.rs b/runtime/koi/src/lib.rs index 55df6f03b..9da7f1d0f 100644 --- a/runtime/koi/src/lib.rs +++ b/runtime/koi/src/lib.rs @@ -84,7 +84,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Darwinia Koi"), impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"), authoring_version: 0, - spec_version: 6_8_1_1, + spec_version: 6_9_0_0, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 0,