Skip to content

Commit

Permalink
feat: unique-polkadot-v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Grigoriy Simonov committed Aug 9, 2024
1 parent a8e4a5c commit b71afb2
Show file tree
Hide file tree
Showing 12 changed files with 465 additions and 302 deletions.
608 changes: 382 additions & 226 deletions Cargo.lock

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
hex-literal = "0.4.1"
impl-serde = { version = "0.4.0", default-features = false }
impl-trait-for-tuples = "0.2.1"
jsonrpsee = "0.20.3"
jsonrpsee = "0.22.5"
kvdb-rocksdb = "0.19.0"
libsecp256k1 = { version = "0.7.1", default-features = false }
log = { version = "0.4.20", default-features = false }
Expand All @@ -75,77 +75,76 @@ thiserror = "1.0"
tokio = "1.32.0"

# Substrate Client
sc-basic-authorship = "0.35.0"
sc-block-builder = "0.34.0"
sc-chain-spec = "28.0.0"
sc-cli = { version = "0.37.0", default-features = false }
sc-client-api = "29.0.0"
sc-client-db = { version = "0.36.0", default-features = false }
sc-consensus = "0.34.0"
sc-consensus-aura = "0.35.0"
sc-consensus-grandpa = "0.20.0"
sc-consensus-manual-seal = "0.36.0"
sc-executor = "0.33.0"
sc-keystore = "26.0.0"
sc-network = "0.35.0"
sc-network-common = "0.34.0"
sc-network-sync = "0.34.0"
sc-offchain = "30.0.0"
sc-rpc = "30.0.0"
sc-rpc-api = "0.34.0"
sc-service = { version = "0.36.0", default-features = false }
sc-telemetry = "16.0.0"
sc-transaction-pool = "29.0.0"
sc-transaction-pool-api = "29.0.0"
sc-utils = "15.0.0"
sc-basic-authorship = "0.36.0"
sc-block-builder = "0.35.0"
sc-chain-spec = "29.0.0"
sc-cli = { version = "0.38.0", default-features = false }
sc-client-api = "30.0.0"
sc-client-db = { version = "0.37.0", default-features = false }
sc-consensus = "0.35.0"
sc-consensus-aura = "0.36.0"
sc-consensus-grandpa = "0.21.0"
sc-consensus-manual-seal = "0.37.0"
sc-executor = "0.34.0"
sc-keystore = "27.0.0"
sc-network = "0.36.0"
sc-network-common = "0.35.0"
sc-network-sync = "0.35.0"
sc-offchain = "31.0.0"
sc-rpc = "31.0.0"
sc-rpc-api = "0.35.0"
sc-service = { version = "0.37.0", default-features = false }
sc-telemetry = "17.0.0"
sc-transaction-pool = "30.0.0"
sc-transaction-pool-api = "30.0.0"
sc-utils = "16.0.0"
# Substrate Primitive
sp-api = { version = "27.0.1", default-features = false }
sp-block-builder = { version = "27.0.0", default-features = false }
sp-blockchain = "29.0.0"
sp-consensus = "0.33.0"
sp-consensus-aura = { version = "0.33.0", default-features = false }
sp-consensus-grandpa = { version = "14.0.0", default-features = false }
sp-core = { version = "29.0.0", default-features = false }
sp-core-hashing = { version = "16.0.0", default-features = false }
sp-core-hashing-proc-macro = { version = "16.0.0", default-features = false }
sp-api = { version = "28.0.0", default-features = false }
sp-block-builder = { version = "28.0.0", default-features = false }
sp-blockchain = "30.0.0"
sp-consensus = "0.34.0"
sp-consensus-aura = { version = "0.34.0", default-features = false }
sp-consensus-grandpa = { version = "15.0.0", default-features = false }
sp-core = { version = "30.0.0", default-features = false }
sp-crypto-hashing = { version = "0.1.0", default-features = false }
sp-database = "10.0.0"
sp-externalities = "0.26.0"
sp-inherents = { version = "27.0.0", default-features = false }
sp-io = { version = "31.0.0", default-features = false }
sp-keyring = "32.0.0"
sp-offchain = { version = "27.0.0", default-features = false }
sp-runtime = { version = "32.0.0", default-features = false }
sp-runtime-interface = { version = "25.0.0", default-features = false }
sp-session = { version = "28.0.0", default-features = false }
sp-state-machine = { version = "0.36.0", default-features = false }
sp-externalities = "0.27.0"
sp-inherents = { version = "28.0.0", default-features = false }
sp-io = { version = "32.0.0", default-features = false }
sp-keyring = "33.0.0"
sp-offchain = { version = "28.0.0", default-features = false }
sp-runtime = { version = "33.0.0", default-features = false }
sp-runtime-interface = { version = "26.0.0", default-features = false }
sp-session = { version = "29.0.0", default-features = false }
sp-state-machine = { version = "0.37.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "20.0.0", default-features = false }
sp-timestamp = { version = "27.0.0", default-features = false }
sp-transaction-pool = { version = "27.0.0", default-features = false }
sp-version = { version = "30.0.0", default-features = false }
sp-timestamp = { version = "28.0.0", default-features = false }
sp-transaction-pool = { version = "28.0.0", default-features = false }
sp-version = { version = "31.0.0", default-features = false }
# Substrate FRAME
frame-benchmarking = { version = "29.0.0", default-features = false }
frame-executive = { version = "29.0.0", default-features = false }
frame-support = { version = "29.0.2", default-features = false }
frame-system = { version = "29.0.0", default-features = false }
frame-system-benchmarking = { version = "29.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false }
pallet-aura = { version = "28.0.0", default-features = false }
pallet-balances = { version = "29.0.2", default-features = false }
pallet-grandpa = { version = "29.0.0", default-features = false }
pallet-sudo = { version = "29.0.0", default-features = false }
pallet-timestamp = { version = "28.0.0", default-features = false }
pallet-transaction-payment = { version = "29.0.2", default-features = false }
pallet-transaction-payment-rpc = "31.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false }
pallet-utility = { version = "29.0.0", default-features = false }
frame-benchmarking = { version = "30.0.0", default-features = false }
frame-executive = { version = "30.0.0", default-features = false }
frame-support = { version = "30.0.0", default-features = false }
frame-system = { version = "30.0.0", default-features = false }
frame-system-benchmarking = { version = "30.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "28.0.0", default-features = false }
pallet-aura = { version = "29.0.0", default-features = false }
pallet-balances = { version = "30.0.0", default-features = false }
pallet-grandpa = { version = "30.0.0", default-features = false }
pallet-sudo = { version = "30.0.0", default-features = false }
pallet-timestamp = { version = "29.0.0", default-features = false }
pallet-transaction-payment = { version = "30.0.0", default-features = false }
pallet-transaction-payment-rpc = "32.0.0"
pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-features = false }
pallet-utility = { version = "30.0.0", default-features = false }
# Substrate Utility
frame-benchmarking-cli = "33.0.0"
frame-benchmarking-cli = "34.0.0"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.17.0" }
substrate-build-script-utils = "11.0.0"
substrate-frame-rpc-system = "29.0.0"
substrate-frame-rpc-system = "30.0.0"
#substrate-test-runtime-client = "0.1.0"
substrate-wasm-builder = "18.0.1"
substrate-wasm-builder = "19.0.0"

# Frontier Client
fc-api = { version = "1.0.0-dev", path = "client/api" }
Expand Down Expand Up @@ -257,6 +256,7 @@ substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/
#substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.2.0" }
substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.2.0" }
sp-externalities = { version = "0.24.0" }
sp-crypto-hashing = { version = "16.0.0" }

[profile.release]
# Substrate runtime requires unwinding.
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ serde = { workspace = true }
serde_json = { workspace = true }

# Substrate
sp-core-hashing = { workspace = true, features = ["default"] }
sp-crypto-hashing = { workspace = true, features = ["default"] }

[features]
txpool = []
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use ethereum_types::{H256, U256};
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
use serde_json::{from_value, Value};
// Substrate
use sp_core_hashing::keccak_256;
use sp_crypto_hashing::keccak_256;

use crate::types::{Bytes, Filter, FilteredParams, Header, Log, Rich, RichHeader};

Expand Down
6 changes: 4 additions & 2 deletions client/rpc/src/eth/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,16 @@ where
self.max_stored_filters
)));
}
let last_key = match {
let next_back = {
let mut iter = locked.iter();
iter.next_back()
} {
};
let last_key = match next_back {
Some((k, _)) => *k,
None => U256::zero(),
};


let pending_transaction_hashes = if let FilterType::PendingTransaction = filter_type {
let txs_ready = self
.graph
Expand Down
5 changes: 4 additions & 1 deletion frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,10 @@ pub mod pallet {
frame_system::Pallet::<T>::inc_account_nonce(&account_id);
}

T::Currency::deposit_creating(&account_id, account.balance.unique_saturated_into());
let _ = T::Currency::deposit_creating(
&account_id,
account.balance.unique_saturated_into(),
);

Pallet::<T>::create_account(*address, account.code.clone());

Expand Down
4 changes: 2 additions & 2 deletions precompiles/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ num_enum = { workspace = true }
prettyplease = "0.2.12"
proc-macro2 = "1.0"
quote = "1.0"
sp-core-hashing = { workspace = true }
sp-crypto-hashing = { workspace = true }
syn = { version = "1.0", features = ["extra-traits", "fold", "full", "visit"] }

[dev-dependencies]
Expand All @@ -29,5 +29,5 @@ precompile-utils = { path = "../", features = ["testing"] }

fp-evm = { workspace = true }
frame-support = { workspace = true }
sp-core-hashing = { workspace = true }
sp-crypto-hashing = { workspace = true }
sp-std = { workspace = true }
2 changes: 1 addition & 1 deletion precompiles/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern crate proc_macro;

use proc_macro::TokenStream;
use quote::{quote, quote_spanned};
use sp_core_hashing::keccak_256;
use sp_crypto_hashing::keccak_256;
use syn::{parse_macro_input, spanned::Spanned, Expr, Ident, ItemType, Lit, LitStr};

mod derive_codec;
Expand Down
2 changes: 1 addition & 1 deletion precompiles/macro/src/precompile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::{format_ident, quote, quote_spanned, ToTokens};
use sp_core_hashing::keccak_256;
use sp_crypto_hashing::keccak_256;
use std::collections::BTreeMap;
use syn::{parse_macro_input, spanned::Spanned};

Expand Down
2 changes: 1 addition & 1 deletion precompiles/macro/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// 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 sp_core_hashing::keccak_256;
use sp_crypto_hashing::keccak_256;

#[test]
fn test_keccak256() {
Expand Down
6 changes: 4 additions & 2 deletions template/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,13 @@ pub fn run() -> sc_cli::Result<()> {
use frame_benchmarking_cli::{
BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE,
};
use frontier_template_runtime::{Block, ExistentialDeposit};
use frontier_template_runtime::{ExistentialDeposit, Hashing};

let runner = cli.create_runner(cmd)?;
match cmd {
BenchmarkCmd::Pallet(cmd) => runner.sync_run(|config| cmd.run::<Block, ()>(config)),
BenchmarkCmd::Pallet(cmd) => {
runner.sync_run(|config| cmd.run::<Hashing, ()>(config))
}
BenchmarkCmd::Block(cmd) => runner.sync_run(|mut config| {
let (client, _, _, _, _) = service::new_chain_ops(&mut config, &cli.eth)?;
cmd.run(client)
Expand Down
2 changes: 1 addition & 1 deletion template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ where
telemetry.as_ref().map(|x| x.handle()),
);

thread_local!(static TIMESTAMP: RefCell<u64> = RefCell::new(0));
thread_local!(static TIMESTAMP: RefCell<u64> = const { RefCell::new(0) });

/// Provide a mock duration starting at 0 in millisecond for timestamp inherent.
/// Each call will increment timestamp by slot_duration making Aura think time has passed.
Expand Down

0 comments on commit b71afb2

Please sign in to comment.