Skip to content

Commit

Permalink
remove useless migrations, use same version where possible, remove ye…
Browse files Browse the repository at this point in the history
…ars from copyrights (#435)
  • Loading branch information
Leouarz authored Feb 22, 2024
1 parent 7e7f76c commit bb673a1
Show file tree
Hide file tree
Showing 40 changed files with 39 additions and 544 deletions.
2 changes: 1 addition & 1 deletion HEADER-APACHE2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "
kate = { git = "https://github.com/availproject/avail-core", branch = "main" }
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main" }
binary-merkle-tree = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-v1.6.0-patch" }
serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] }
serde = { version = "1.0.195", default-features = false, features = ["derive", "alloc"] }


# Dependency `subxt` uses it's own 'version' of sp-core so we need to patch it :)
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ clap = { version = "4.4.17", features = ["derive"], optional = true }
clap-num = { version = "1.1.1", optional = true }
jsonrpsee = { version = "0.16.2", features = ["server"] }
futures = "0.3.21"
serde = { version = "1.0.126", features = ["derive"] }
serde = { version = "1.0.195", features = ["derive"] }
serde_json = { version = "1.0", features = ["arbitrary_precision"] }
lru = "0.7.2"
log = "0.4.17"
Expand Down
2 changes: 1 addition & 1 deletion node/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion pallets/dactr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ log = { version = "0.4.20", default-features = false }
static_assertions = "1.1.0"

# Substrate
serde = { version = "1.0.126", optional = true, features = ["derive"] }
serde = { version = "1.0.195", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3", default-features = false, features = [
"derive",
] }
Expand Down
2 changes: 1 addition & 1 deletion pallets/dactr/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion pallets/mandate/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion pallets/mocked_runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ scale-info = { version = "2.5.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3", features = ["derive"] }
parity-util-mem = { version = "0.12.0", features = ["primitive-types"] }
derive_more = "0.99.17"
serde = { version = "1.0.121", features = ["derive"] }
serde = { version = "1.0.195", features = ["derive"] }

frame-support = { workspace = true, default-features = false }
sp-runtime = { workspace = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion pallets/system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ethabi = { version = "18.0.0", default-features = false }
# Substrate
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive", "serde"] }
serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"], optional = true }
serde = { version = "1.0.195", default-features = false, features = ["derive", "alloc"], optional = true }
frame-support = { workspace = true, default-features = false }
sp-core = { workspace = true, default-features = false, features = ["serde"] }
sp-io = { workspace = true, default-features = false }
Expand Down
8 changes: 1 addition & 7 deletions pallets/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ pub mod weights;
pub mod extrinsic_len;
pub use extrinsic_len::{ExtrinsicLen, PaddedExtrinsicLen};

pub mod migrations;

// Backward compatible re-export.
pub use extensions::{
check_genesis::CheckGenesis,
Expand Down Expand Up @@ -453,10 +451,6 @@ pub mod pallet {
.expect("The weights are invalid.");
});
}

fn on_runtime_upgrade() -> Weight {
migrations::migrate::<T>()
}
}

#[pallet::call]
Expand Down Expand Up @@ -776,7 +770,7 @@ pub mod pallet {
sp_io::storage::set(well_known_keys::EXTRINSIC_INDEX, &0u32.encode());
<DynamicBlockLength<T>>::put(&self.block_length);

StorageVersion::new(1).put::<Pallet<T>>();
StorageVersion::new(3).put::<Pallet<T>>();
}
}
}
Expand Down
168 changes: 0 additions & 168 deletions pallets/system/src/migrations/mod.rs

This file was deleted.

36 changes: 0 additions & 36 deletions pallets/system/src/migrations/v1.rs

This file was deleted.

15 changes: 0 additions & 15 deletions pallets/system/src/migrations/v2.rs

This file was deleted.

2 changes: 1 addition & 1 deletion pallets/system/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions pallets/transaction-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
"derive",
] }
log = { version = "0.4.17", default-features = false }
log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.163", optional = true }
serde = { version = "1.0.195", optional = true }
frame-support = { workspace = true, default-features = false }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
sp-core = { workspace = true, default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion pallets/transaction-payment/asset-tx-payment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ frame-benchmarking = { version = "4.0.0-dev", workspace = true, default-features
# Other dependencies
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.163", optional = true }
serde = { version = "1.0.195", optional = true }

[dev-dependencies]
serde_json = "1.0.85"
Expand Down
2 changes: 1 addition & 1 deletion pallets/vector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ark-std = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", features = ["derive"], default-features = false }
ark-ff = { version = "0.3.0", default-features = false }
ark-snark = "0.4.0"
serde = { version = "1.0.149", default-features = false, features = ["derive", "alloc"] }
serde = { version = "1.0.195", default-features = false, features = ["derive", "alloc"] }
serde_json = { version = "1.0.89", default-features = false, features = ["alloc"] }
sha2 = { version = "0.10.8", default-features = false }
log = "0.4.20"
Expand Down
4 changes: 4 additions & 0 deletions pallets/vector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,22 @@ pub mod pallet {
pub type RotateVerificationKey<T: Config> =
StorageValue<_, Option<BoundedVec<u8, ConstU32<10_000>>>, ValueQuery>;

/// Genesis validator root, used to check initialization
#[pallet::storage]
#[pallet::getter(fn genesis_validator_root)]
pub type GenesisValidatorRoot<T: Config> = StorageValue<_, H256, ValueQuery>;

/// Genesis timestamp, used to check initialization
#[pallet::storage]
#[pallet::getter(fn genesis_timestamp)]
pub type GenesisTimestamp<T: Config> = StorageValue<_, u64, ValueQuery>;

/// Seconds per slot, used to check initialization
#[pallet::storage]
#[pallet::getter(fn seconds_per_slot)]
pub type SecondsPerSlot<T: Config> = StorageValue<_, u64, ValueQuery>;

/// Source chain id, used to check initialization
#[pallet::storage]
#[pallet::getter(fn source_chain_id)]
pub type SourceChainId<T: Config> = StorageValue<_, u64, ValueQuery>;
Expand Down
2 changes: 1 addition & 1 deletion pallets/vector/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of Substrate.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

2 comments on commit bb673a1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: bb673a1 Previous: 33f7951 Ratio
commitment_builder/32 4292272031 ns/iter (± 129236737) 4325417137 ns/iter (± 81695432) 0.99
commitment_builder/64 4338180665 ns/iter (± 157383004) 4343451680 ns/iter (± 92231152) 1.00
commitment_builder/128 4706116375 ns/iter (± 115506427) 4647446215 ns/iter (± 137494514) 1.01
commitment_builder/256 2336293602 ns/iter (± 49405102) 2367397557 ns/iter (± 42776582) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: bb673a1 Previous: 909af7f Ratio
commitment_builder_32 Instructions 43504079964 ops (± 0) 43503093041 ops (± 0) 1.00
commitment_builder_32 L1 Accesses 53516192183 ops (± 0) 53514815042 ops (± 0) 1.00
commitment_builder_32 L2 Accesses 803275 ops (± 0) 700403 ops (± 0) 1.15
commitment_builder_32 RAM Accesses 78300 ops (± 0) 89904 ops (± 0) 0.87
commitment_builder_32 Estimated Cycles 53522949058 ops (± 0) 53521463697 ops (± 0) 1.00
commitment_builder_64 Instructions 41972511817 ops (± 0) 41972869826 ops (± 0) 1.00
commitment_builder_64 L1 Accesses 51407590325 ops (± 0) 51407870438 ops (± 0) 1.00
commitment_builder_64 L2 Accesses 876713 ops (± 0) 893120 ops (± 0) 0.98
commitment_builder_64 RAM Accesses 192989 ops (± 0) 191298 ops (± 0) 1.01
commitment_builder_64 Estimated Cycles 51418728505 ops (± 0) 51419031468 ops (± 0) 1.00
commitment_builder_128 Instructions 54204541905 ops (± 0) 54204175550 ops (± 0) 1.00
commitment_builder_128 L1 Accesses 68302410350 ops (± 0) 68301951624 ops (± 0) 1.00
commitment_builder_128 L2 Accesses 1323525 ops (± 0) 1258510 ops (± 0) 1.05
commitment_builder_128 RAM Accesses 262307 ops (± 0) 242507 ops (± 0) 1.08
commitment_builder_128 Estimated Cycles 68318208720 ops (± 0) 68316731919 ops (± 0) 1.00
commitment_builder_256 Instructions 31759181818 ops (± 0) 31758548180 ops (± 0) 1.00
commitment_builder_256 L1 Accesses 40834173081 ops (± 0) 40833274463 ops (± 0) 1.00
commitment_builder_256 L2 Accesses 6813983 ops (± 0) 6788005 ops (± 0) 1.00
commitment_builder_256 RAM Accesses 257312 ops (± 0) 239352 ops (± 0) 1.08
commitment_builder_256 Estimated Cycles 40877248916 ops (± 0) 40875591808 ops (± 0) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.