Skip to content
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
711 changes: 364 additions & 347 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ rocket = { version = "0.5.0-rc.2", git = "https://github.com/SergioBenitez/Rocke
derive_more = { version = "0.99.17", git = "https://github.com/JelteF/derive_more" }

# For pink-extension-runtime, it will introduce Substrate from crates-io which usually different with polkadot-branch
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
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.32", features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", features = ["disable_target_static_assertions"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime-interface = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", features = ["disable_target_static_assertions"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-externalities = { 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" }
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.0", default-features = false, features = ["derive-codec"] }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-finality-grandpa = { 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" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }

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.32", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false, features = ["full_crypto"] }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }
sp-finality-grandpa = { 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-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false, features = ["full_crypto"] }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }

# for pruntime_client
async-trait = "0.1.57"
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.32", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", 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.32", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", 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
12 changes: 6 additions & 6 deletions crates/phala-node-rpc-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ 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.32" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
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" }

# client dependencies
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
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" }

phala-mq = { path = "../../crates/phala-mq" }
phala-pallets = { path = "../../pallets/phala" }
Expand Down
7 changes: 4 additions & 3 deletions crates/phala-node-rpc-ext/src/storage_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ where
.into_par_iter()
.map(|(id, mut header)| -> Result<_, Error> {
let api = client.runtime_api();
let hash = client.expect_block_hash_from_id(&id).expect("Should get the block hash");
if (*header.number()).into() == 0u64 {
let state = backend
.state_at(&client.expect_block_hash_from_id(&id).expect("Should get the block hash"))
.state_at(hash)
.map_err(|e| Error::invalid_block(id, e))?;
return Ok(StorageChanges {
main_storage_changes: state
Expand All @@ -125,7 +126,7 @@ where
}

let extrinsics = client
.block_body(&id)
.block_body(hash)
.map_err(|e| Error::invalid_block(id, e))?
.ok_or_else(|| Error::invalid_block(id, "block body not found"))?;
let parent_hash = *header.parent_hash();
Expand All @@ -140,7 +141,7 @@ where
.map_err(|e| Error::invalid_block(id, e))?;

let state = backend
.state_at(&client.expect_block_hash_from_id(&id).expect("Should get the block hash"))
.state_at(hash)
.map_err(|e| Error::invalid_block(parent_id, e))?;

let storage_changes = api
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.32", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", 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
10 changes: 5 additions & 5 deletions crates/phala-trie-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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.32", features = ["full_crypto"] }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }
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 }

serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
hash-db = "0.15.2"
Expand All @@ -21,8 +21,8 @@ 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.32" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", features = ["full_crypto"] }
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"] }
hash256-std-hasher = { version = "0.15", default-features = false }
hex = "0.4"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion crates/phala-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hex = { version = "0.4", default-features = false, features = ["alloc"] }
serde = { version = "1.0.101", default-features = false, optional = true }
codec = { package = "parity-scale-codec", version = "3.1", default-features = false, features = ["full"] }
scale-info = { version = "2.1", default-features = false, features = ["derive"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33", default-features = false }

phala-mq = { path = "../../crates/phala-mq", default-features = false }
prpc = { path = "../../crates/prpc", default-features = false }
Expand Down
32 changes: 16 additions & 16 deletions crates/pink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ edition = "2021"
[dependencies]
sha2 = "0.10.2"
log = "0.4.14"
pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
pallet-contracts = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
pallet-contracts-proc-macro = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }

frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
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-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-sandbox = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-io = { 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-sandbox = { 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" }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }

scale = { package = "parity-scale-codec", version = "3.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.1", default-features = false, features = ["derive", "serde", "decode"] }
Expand Down
2 changes: 2 additions & 0 deletions crates/pink/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use frame_support::weights::Weight;
use pallet_contracts_primitives::StorageDeposit;
use pallet_contracts::Determinism;
use scale::{Decode, Encode};
use sp_runtime::DispatchError;

Expand Down Expand Up @@ -296,6 +297,7 @@ impl Contract {
storage_deposit_limit,
input_data,
false,
Determinism::Deterministic,
)
},
);
Expand Down
2 changes: 1 addition & 1 deletion crates/pink/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ mod tests {
let mut params = vec![(n + 1) as u8];
params.extend_from_slice(input);
let result =
Contracts::bare_call(ALICE, addr.clone(), 0, GAS_LIMIT, None, params, false)
Contracts::bare_call(ALICE, addr.clone(), 0, GAS_LIMIT, None, params, false, pallet_contracts::Determinism::Deterministic)
.result
.unwrap();
assert!(!result.did_revert());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
source: crates/pink/src/runtime.rs
assertion_line: 151
assertion_line: 150
expression: "(<PinkRuntime as frame_system::Config>::BlockWeights::get(),\n <PinkRuntime as Config>::Schedule::get(),\n <PinkRuntime as Config>::DeletionQueueDepth::get(),\n <PinkRuntime as Config>::DeletionWeightLimit::get(),\n <PinkRuntime as Config>::MaxCodeLen::get(),\n <PinkRuntime as Config>::MaxStorageKeyLen::get())"
---
(
BlockWeights {
base_block: Weight {
ref_time: 5346284000,
ref_time: 358523000,
proof_size: 0,
},
max_block: Weight {
Expand All @@ -16,12 +16,12 @@ expression: "(<PinkRuntime as frame_system::Config>::BlockWeights::get(),\n <
per_class: PerDispatchClass {
normal: WeightsPerClass {
base_extrinsic: Weight {
ref_time: 86298000,
ref_time: 98974000,
proof_size: 0,
},
max_extrinsic: Some(
Weight {
ref_time: 1299913702000,
ref_time: 1299901026000,
proof_size: 11990383647911208550,
},
),
Expand All @@ -40,12 +40,12 @@ expression: "(<PinkRuntime as frame_system::Config>::BlockWeights::get(),\n <
},
operational: WeightsPerClass {
base_extrinsic: Weight {
ref_time: 86298000,
ref_time: 98974000,
proof_size: 0,
},
max_extrinsic: Some(
Weight {
ref_time: 1799913702000,
ref_time: 1799901026000,
proof_size: 16602069666338596454,
},
),
Expand All @@ -64,7 +64,7 @@ expression: "(<PinkRuntime as frame_system::Config>::BlockWeights::get(),\n <
},
mandatory: WeightsPerClass {
base_extrinsic: Weight {
ref_time: 86298000,
ref_time: 98974000,
proof_size: 0,
},
max_extrinsic: None,
Expand All @@ -88,6 +88,7 @@ expression: "(<PinkRuntime as frame_system::Config>::BlockWeights::get(),\n <
},
instruction_weights: InstructionWeights {
version: "3 ps",
fallback: "0 ps",
i64const: "4.7 ns",
i64load: "20.4 ns",
i64store: "17.5 ns",
Expand Down
3 changes: 2 additions & 1 deletion crates/pink/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
};
use frame_support::traits::Currency;
use frame_system::RawOrigin;
use pallet_contracts::Determinism;
use phala_crypto::sr25519::Sr25519SecretKey;
use phala_trie_storage::{deserialize_trie_backend, serialize_trie_backend, MemoryDB};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -167,7 +168,7 @@ where
code: Vec<u8>,
) -> Result<Hash, DispatchError> {
self.execute_mut(false, None, || {
crate::runtime::Contracts::bare_upload_code(account.clone(), code, None)
crate::runtime::Contracts::bare_upload_code(account.clone(), code, None, Determinism::Deterministic)
})
.0
.map(|v| v.code_hash)
Expand Down
Loading