Skip to content

Commit

Permalink
Merge pull request #1129 from Phala-Network/polkadot-v0.9.37
Browse files Browse the repository at this point in the history
Upgrade to Polkadot v0.9.37
  • Loading branch information
jasl authored Jan 29, 2023
2 parents 4d616df + 5118e1c commit a68fab5
Show file tree
Hide file tree
Showing 75 changed files with 2,345 additions and 1,867 deletions.
1,937 changes: 1,308 additions & 629 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ rocket = { version = "0.5.0-rc.2", git = "https://github.com/SergioBenitez/Rocke
# TODO.kevin: Move back to crates.io once it released 1.0
derive_more = { version = "0.99.17", git = "https://github.com/JelteF/derive_more" }

sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-core-hashing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-core-hashing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }

# For pink-extension-runtime, it will introduce Substrate from crates-io which usually different with polkadot-branch
pink-extension = { path = "crates/pink/pink-extension" }
Expand Down
20 changes: 10 additions & 10 deletions crates/phactory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ phala-crypto = { path = "../phala-crypto", features = ["getrandom", "stream"] }
prpc = { path = "../prpc" }
pink = { path = "../pink" }

sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", features = ["disable_target_static_assertions"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", features = ["disable_target_static_assertions"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
parity-scale-codec = { package = "parity-scale-codec", version = "3.1", default-features = false, features = ["derive", "full", "chain-error"] }
scopeguard = { version = "1.1", default-features = false }

Expand All @@ -54,11 +54,11 @@ derive_more = "0.99.0"
hash-db = { version = "0.15.2", default-features = false }
num = { package = "num-traits", version = "0.2", default-features = false }
finality-grandpa = { version = "0.16.1", default-features = false, features = ["derive-codec"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }

fixed = "1.9.0"
fixed-sqrt = "0.2.4"
Expand Down
10 changes: 5 additions & 5 deletions crates/phactory/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ phala-crypto = { path = "../../../crates/phala-crypto" }
phala-mq = { path = "../../../crates/phala-mq" }
chain = { path = "../../../standalone/runtime", default-features = false, package = "phala-node-runtime" }

sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false, features = ["full_crypto"] }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false, features = ["full_crypto"] }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }

# for pruntime_client
async-trait = "0.1.57"
Expand Down
6 changes: 3 additions & 3 deletions crates/phactory/src/contracts/pink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use phala_mq::{ContractClusterId, ContractId, MessageOrigin};
use phala_types::contract::ConvertTo;
use pink::runtime::{BoxedEventCallbacks, ExecSideEffects};
use pink::types::Weight;
use pink::weights::constants::WEIGHT_PER_SECOND;
use pink::weights::constants::WEIGHT_REF_TIME_PER_SECOND;
use runtime::{AccountId, BlockNumber, Hash};
use sidevm::service::{Command as SidevmCommand, CommandSender, SystemMessage};

Expand Down Expand Up @@ -131,7 +131,7 @@ impl Pink {
block_number: context.block_number,
storage,
transfer,
gas_limit: WEIGHT_PER_SECOND * 10,
gas_limit: Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND * 10, u64::MAX),
gas_free: true,
storage_deposit_limit: None,
callbacks: ContractEventCallback::from_log_sender(
Expand Down Expand Up @@ -202,7 +202,7 @@ impl Pink {
block_number: context.block_number,
storage,
transfer,
gas_limit: WEIGHT_PER_SECOND * 10,
gas_limit: Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND * 10, u64::MAX),
gas_free: true,
storage_deposit_limit: None,
callbacks: ContractEventCallback::from_log_sender(
Expand Down
4 changes: 2 additions & 2 deletions crates/phala-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ edition = "2018"
resolver = "2"

[dependencies]
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }

ring = { version = "0.16.20", default-features = false, features = ["alloc"] }
curve25519-dalek = { version = "2.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/phala-mq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hex = { version = "0.4.3", default-features = false, features = ['alloc'] }
derive_more = { version = "0.99", default-features = false, features = ["display"] }
parity-scale-codec = { version = "3.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }

spin = { version = "0.9", default-features = false, features = ["mutex", "use_ticket_mutex"], optional = true }
Expand Down
14 changes: 7 additions & 7 deletions crates/phala-node-rpc-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ repository = "https://github.com/Phala-Network/phala-blockchain"
# third-party dependencies
serde = { version = "1.0.102", features = ["derive"] }
thiserror = "1.0"
jsonrpsee = { version = "0.15.1", features = ["server"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
impl-serde = "0.4.0"
log = { version = "0.4.14", default-features = false }
hex = { version = "0.4.3", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1" }
scale-info = { version = "2.1", default-features = false }

# primitives
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }

# client dependencies
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }

phala-mq = { path = "../../crates/phala-mq" }
phala-pallets = { path = "../../pallets/phala" }
Expand Down
14 changes: 7 additions & 7 deletions crates/phala-node-rpc-ext/src/storage_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ where
{
fn header<Client: HeaderBackend<Block>, Block: BlockT>(
client: &Client,
id: BlockId<Block>,
hash: Block::Hash,
) -> Result<Block::Header, Error> {
client
.header(id)
.map_err(|e| Error::invalid_block(id, e))?
.ok_or_else(|| Error::invalid_block(id, "header not found"))
.header(hash)
.map_err(|e| Error::invalid_block(BlockId::<Block>::Hash(hash), e))?
.ok_or_else(|| Error::invalid_block(BlockId::<Block>::Hash(hash), "header not found"))
}

let n_from: u64 = (*header(client, BlockId::Hash(from))?.number()).into();
let n_to: u64 = (*header(client, BlockId::Hash(to))?.number()).into();
let n_from: u64 = (*header(client, from)?.number()).into();
let n_to: u64 = (*header(client, to)?.number()).into();

if n_from > n_to {
return Err(Error::InvalidBlockRange {
Expand All @@ -97,7 +97,7 @@ where

loop {
let id = BlockId::Hash(this_block);
let header = header(client, id)?;
let header = header(client, this_block)?;
let parent = *header.parent_hash();
headers.push_front((id, header));
if this_block == from {
Expand Down
2 changes: 1 addition & 1 deletion crates/phala-serde-more/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
serde = { version = "1.0.130", default-features = false, features = ["derive", "alloc"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
scale = { package = "parity-scale-codec", version = "3.1", default-features = false }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }

Expand Down
11 changes: 5 additions & 6 deletions crates/phala-trie-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ repository = "https://github.com/Phala-Network/phala-blockchain"
[dependencies]
parity-scale-codec = { version = "3.0", default-features = false }
scale-info = { version = "2.0", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", features = ["full_crypto"] }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", features = ["full_crypto"] }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }

serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
hash-db = "0.15.2"
trie-db = "0.24.0"
im = { version = "15", features = ["serde"] }
parity-util-mem = "0.12.0"

[dev-dependencies]
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.34", features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", features = ["full_crypto"] }
hash256-std-hasher = { version = "0.15", default-features = false }
hex = "0.4"
serde_json = "1.0"
Expand Down
4 changes: 0 additions & 4 deletions crates/phala-trie-storage/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate alloc;

#[cfg(feature = "serde")]
pub mod ser;

Expand All @@ -10,8 +8,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};

use core::iter::FromIterator;

use alloc::vec::Vec;

use parity_scale_codec::Codec;
use sp_core::storage::ChildInfo;
use sp_core::Hasher;
Expand Down
Loading

0 comments on commit a68fab5

Please sign in to comment.