Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Polkadot v0.9.37 #249

Merged
merged 12 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,048 changes: 1,903 additions & 1,145 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ exclude = [
"vendor/webpki",
"vendor/ring",
"polkadot/node/service",
"substrate/client/db",
"substrate/client/state-db",
]

members = [
Expand Down Expand Up @@ -55,8 +53,3 @@ members = [

[patch."https://github.com/paritytech/polkadot"]
polkadot-service = { path = "polkadot/node/service" }

# Remove after we upgrade to polkadot-v0.9.36
[patch."https://github.com/paritytech/substrate"]
sc-state-db = { path = "substrate/client/state-db" }
sc-client-db = { path = "substrate/client/db" }
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.33", 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
3 changes: 2 additions & 1 deletion crates/phala-mq/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ impl<T: Decode> TypedReceiver<T> {
Err(err) => {
if msg.sender.always_well_formed() {
panic!(
"Failed to decode critical mq message, please upgrade the pRuntime client"
"Failed to decode critical mq message (dest={:?}), please upgrade the pRuntime client",
msg.destination
);
} else {
return Err(TypedReceiveError::CodecError(err));
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.33" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
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.33" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
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
24 changes: 12 additions & 12 deletions crates/phala-pallet-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ codec = { package = "parity-scale-codec", version = "3.0", default-features = fa
scale-info = { version = "2.0", default-features = false, features = ["derive", "serde", "decode"] }

# Substrate
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
sp-io = { 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 }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37", default-features = false }
frame-support = { 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 }

[dev-dependencies]
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
sp-core = { 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 = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }

[features]
default = ["std"]
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.33", 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.33", features = ["full_crypto"] }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", 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.33" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", 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