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

Polkadot v0.9.37 #1165

Closed
wants to merge 17 commits into from
1,123 changes: 673 additions & 450 deletions Cargo.lock

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions app-libs/sgx-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ scale-info = { version = "2.0.1", default-features = false, features = ["derive"
itp-sgx-runtime-primitives = { path = "../../core-primitives/sgx-runtime-primitives", default-features = false }

# Substrate dependencies
frame-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-executive = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-system-benchmarking = { optional = true, default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-grandpa = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-transaction-payment = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-block-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-consensus-aura = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-inherents = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-offchain = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-session = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-transaction-pool = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-version = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }

# Integritee dependencies
pallet-evm = { default-features = false, optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.36" }
pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.36" }
pallet-evm = { default-features = false, optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.37" }
pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.37" }

[features]
default = ["std"]
Expand Down
20 changes: 10 additions & 10 deletions app-libs/stf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ itp-utils = { default-features = false, path = "../../core-primitives/utils" }
sp-io = { default-features = false, features = ["disable_oom", "disable_panic_handler", "disable_allocator"], path = "../../core-primitives/substrate-sgx/sp-io" }

# Substrate dependencies
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-application-crypto = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }

# scs / integritee
my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.36" }
pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.36" }
my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.37" }
pallet-parentchain = { default-features = false, git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.37" }


[dev-dependencies]
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }

[features]
default = ["std"]
Expand Down
4 changes: 3 additions & 1 deletion app-libs/stf/src/stf_sgx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ where
type Hash = Runtime::Hash;

fn get_events(state: &mut State) -> Vec<Box<Self::EventRecord>> {
state.execute_with(|| frame_system::Pallet::<Runtime>::read_events_no_consensus())
state.execute_with(|| {
frame_system::Pallet::<Runtime>::read_events_no_consensus().collect::<Vec<_>>()
})
}

fn get_event_count(state: &mut State) -> Self::EventIndex {
Expand Down
24 changes: 12 additions & 12 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ sgx_crypto_helper = { branch = "master", git = "https://github.com/apache/teacla
ws = { version = "0.9.1", features = ["ssl"] }

# scs / integritee
my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.36" }
pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.36" }
substrate-api-client = { features = ["ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.36" }
substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.36" }
teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.36" }
my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "polkadot-v0.9.37" }
pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "polkadot-v0.9.37" }
substrate-api-client = { features = ["ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.37" }
substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.37" }
teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.37" }

# substrate dependencies
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
frame-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-balances = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }

# local dependencies
ita-stf = { path = "../app-libs/stf" }
Expand Down
5 changes: 3 additions & 2 deletions cli/src/base_cli/commands/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ pub struct FaucetCommand {

impl FaucetCommand {
pub(crate) fn run(&self, cli: &Cli) {
let api = get_chain_api(cli).set_signer(AccountKeyring::Alice.pair());
let mut api = get_chain_api(cli);
api.set_signer(AccountKeyring::Alice.pair());
let mut nonce = api.get_nonce().unwrap();
for account in &self.accounts {
let to = get_accountid_from_str(account);
#[allow(clippy::redundant_clone)]
let xt: UncheckedExtrinsicV4<_, _> = compose_extrinsic_offline!(
api.clone().signer.unwrap(),
api.clone().signer().unwrap(),
RuntimeCall::Balances(BalancesCall::transfer {
dest: MultiAddress::Id(to.clone()),
value: PREFUNDING_AMOUNT
Expand Down
4 changes: 2 additions & 2 deletions cli/src/base_cli/commands/shield_funds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct ShieldFundsCommand {

impl ShieldFundsCommand {
pub(crate) fn run(&self, cli: &Cli) {
let chain_api = get_chain_api(cli);
let mut chain_api = get_chain_api(cli);

let shard_opt = match self.shard.from_base58() {
Ok(s) => ShardIdentifier::decode(&mut &s[..]),
Expand All @@ -60,7 +60,7 @@ impl ShieldFundsCommand {

// get the sender
let from = get_pair_from_str(&self.from);
let chain_api = chain_api.set_signer(sr25519_core::Pair::from(from));
chain_api.set_signer(sr25519_core::Pair::from(from));

// get the recipient
let to = get_accountid_from_str(&self.to);
Expand Down
3 changes: 2 additions & 1 deletion cli/src/base_cli/commands/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ impl TransferCommand {
let to_account = get_accountid_from_str(&self.to);
info!("from ss58 is {}", from_account.public().to_ss58check());
info!("to ss58 is {}", to_account.to_ss58check());
let api = get_chain_api(cli).set_signer(sr25519_core::Pair::from(from_account));
let mut api = get_chain_api(cli);
api.set_signer(sr25519_core::Pair::from(from_account));
let xt = api.balance_transfer(GenericAddress::Id(to_account.clone()), self.amount);
let tx_hash = api.send_extrinsic(xt.hex_encode(), XtStatus::InBlock).unwrap();
println!("[+] TrustedOperation got finalized. Hash: {:?}\n", tx_hash);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/base_cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn list_accounts() {
}

fn print_metadata(cli: &Cli) {
let meta = get_chain_api(cli).get_metadata().unwrap();
let meta = get_chain_api(cli).metadata().metadata.clone();
println!("Metadata:\n {}", Metadata::pretty_format(&meta).unwrap());
}

Expand Down
13 changes: 9 additions & 4 deletions cli/src/oracle/commands/add_to_whitelist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,21 @@ pub struct AddToWhitelistCmd {

impl AddToWhitelistCmd {
pub fn run(&self, cli: &Cli) {
let api = get_chain_api(cli);
let mut api = get_chain_api(cli);
let mrenclave = mrenclave_from_base58(&self.mrenclave);
let from = get_pair_from_str(&self.from);

let market_data_source = self.source.clone();

let api = api.set_signer(from.into());
api.set_signer(from.into());

let call =
compose_call!(api.metadata, TEERACLE, ADD_TO_WHITELIST, market_data_source, mrenclave);
let call = compose_call!(
api.metadata(),
TEERACLE,
ADD_TO_WHITELIST,
market_data_source,
mrenclave
);

// compose the extrinsic
let xt: UncheckedExtrinsicV4<_, _> = compose_extrinsic!(api, "Sudo", "sudo", call);
Expand Down
15 changes: 7 additions & 8 deletions cli/src/trusted_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,38 +107,37 @@ fn send_request(
trusted_args: &TrustedCli,
trusted_operation: &TrustedOperation,
) -> Option<Vec<u8>> {
let chain_api = get_chain_api(cli);
let mut chain_api = get_chain_api(cli);
let encryption_key = get_shielding_key(cli).unwrap();
let call_encrypted = encryption_key.encrypt(&trusted_operation.encode()).unwrap();

let shard = read_shard(trusted_args).unwrap();

let arg_signer = &trusted_args.xt_signer;
let signer = get_pair_from_str(arg_signer);
let _chain_api = chain_api.set_signer(sr25519_core::Pair::from(signer));
chain_api.set_signer(sr25519_core::Pair::from(signer));

let request = Request { shard, cyphertext: call_encrypted };
let xt = compose_extrinsic!(_chain_api, TEEREX, "call_worker", request);
let xt = compose_extrinsic!(chain_api, TEEREX, "call_worker", request);

// send and watch extrinsic until block is executed
let block_hash =
_chain_api.send_extrinsic(xt.hex_encode(), XtStatus::InBlock).unwrap().unwrap();
let block_hash = chain_api.send_extrinsic(xt.hex_encode(), XtStatus::InBlock).unwrap().unwrap();

info!(
"Trusted call extrinsic sent and successfully included in parentchain block with hash {:?}.",
block_hash
);
info!("Waiting for execution confirmation from enclave...");
let (events_in, events_out) = channel();
_chain_api.subscribe_events(events_in).unwrap();
chain_api.subscribe_events(events_in).unwrap();

loop {
let ret: ProcessedParentchainBlockArgs =
_chain_api.wait_for_event::<ProcessedParentchainBlockArgs>(&events_out).unwrap();
chain_api.wait_for_event::<ProcessedParentchainBlockArgs>(&events_out).unwrap();
info!("Confirmation of ProcessedParentchainBlock received");
debug!("Expected block Hash: {:?}", block_hash);
debug!("Confirmed stf block Hash: {:?}", ret.block_hash);
match _chain_api.get_header::<Header>(Some(block_hash)) {
match chain_api.get_header::<Header>(Some(block_hash)) {
Ok(option) => {
match option {
None => {
Expand Down
4 changes: 2 additions & 2 deletions core-primitives/attestation-handler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ itp-types = { path = "../types", default-features = false }
httparse = { default-features = false, git = "https://github.com/integritee-network/httparse-sgx", branch = "sgx-experimental" }

# substrate deps
sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
sp-core = { default-features = false, features = ["full_crypto"], git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }

[features]
default = ["std"]
Expand Down
Loading