Skip to content

Commit

Permalink
Remove teerex/teeracle/sidechain pallet integration (#2491)
Browse files Browse the repository at this point in the history
* remove teeracle

* remove teeracle

* remove teeracle feature

* remove extra edl

* fix clippy

* init

* remove teerex

* fix imp and vcmp

* fix toml

* fix compile error
  • Loading branch information
Kailai-Wang committed Feb 15, 2024
1 parent f8f16d2 commit d4426c8
Show file tree
Hide file tree
Showing 45 changed files with 91 additions and 1,210 deletions.
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 2 additions & 12 deletions bitacross-worker/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions bitacross-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ members = [
"core-primitives/substrate-sgx/environmental",
"core-primitives/substrate-sgx/externalities",
"core-primitives/substrate-sgx/sp-io",
"core-primitives/teerex-storage",
"core-primitives/test",
"core-primitives/time-utils",
"core-primitives/top-pool",
Expand Down Expand Up @@ -91,22 +90,3 @@ sgx_urts = { version = "1.1.6", git = "https://github.com/apache/incubator-teacl

[patch.crates-io]
ring = { git = "https://github.com/betrusted-io/ring-xous", branch = "0.16.20-cleanup" }

#[patch."https://github.com/integritee-network/integritee-node"]
#my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network//integritee-node", branch = "ab/integrate-pallet-teerex-refactoring" }

#[patch."https://github.com/scs/substrate-api-client"]
#substrate-api-client = { path = "../../scs/substrate-api-client" }
#substrate-client-keystore = { path = "../../scs/substrate-api-client/client-keystore" }

#[patch."https://github.com/integritee-network/pallets.git"]
#pallet-claims = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#pallet-enclave-bridge = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#pallet-teerex = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#pallet-sidechain = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#sgx-verify = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#test-utils = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#claims-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#enclave-bridge-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#teerex-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
#common-primitives = { git = "https://github.com/integritee-network//pallets", branch = "ab/shard-config-upgradability-2" }
1 change: 0 additions & 1 deletion bitacross-worker/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ ita-sgx-runtime = { path = "../app-libs/sgx-runtime" }
lc-direct-call = { path = "../litentry/core/direct-call" }
litentry-primitives = { path = "../litentry/primitives" }
my-node-runtime = { package = "rococo-parachain-runtime", path = "../../runtime/rococo" }
pallet-teerex = { path = "../../pallets/teerex", default-features = false }
scale-value = "0.6.0"
sp-core-hashing = "6.0.0"

Expand Down
1 change: 0 additions & 1 deletion bitacross-worker/cli/src/base_cli/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pub mod faucet;
pub mod listen;
pub mod litentry;
pub mod register_tcb_info;
pub mod shield_funds;
pub mod transfer;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
command_utils::{get_chain_api, *},
Cli, CliResult, CliResultOk,
};
use itp_node_api::api_client::TEEREX;
use itp_node_api::api_client::TEEBAG;
use itp_types::{parentchain::Hash, OpaqueCall};
use itp_utils::ToHexPrefixed;
use log::*;
Expand Down Expand Up @@ -106,7 +106,7 @@ impl RegisterTcbInfoCommand {

let call = OpaqueCall::from_tuple(&compose_call!(
chain_api.metadata(),
TEEREX,
TEEBAG,
"register_tcb_info",
tcb_info,
intel_signature,
Expand Down
92 changes: 0 additions & 92 deletions bitacross-worker/cli/src/base_cli/commands/shield_funds.rs

This file was deleted.

7 changes: 1 addition & 6 deletions bitacross-worker/cli/src/base_cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
use crate::{
base_cli::commands::{
balance::BalanceCommand, faucet::FaucetCommand, listen::ListenCommand,
register_tcb_info::RegisterTcbInfoCommand, shield_funds::ShieldFundsCommand,
transfer::TransferCommand,
register_tcb_info::RegisterTcbInfoCommand, transfer::TransferCommand,
},
command_utils::*,
Cli, CliResult, CliResultOk, ED25519_KEY_TYPE, SR25519_KEY_TYPE,
Expand Down Expand Up @@ -72,9 +71,6 @@ pub enum BaseCommand {
/// Register TCB info for FMSPC
RegisterTcbInfo(RegisterTcbInfoCommand),

/// Transfer funds from an parentchain account to an incognito account
ShieldFunds(ShieldFundsCommand),

// Litentry's commands below
/// query sgx-runtime metadata and print the raw (hex-encoded) metadata to stdout
/// we could have added a parameter like `--raw` to `PrintSgxMetadata`, but
Expand All @@ -95,7 +91,6 @@ impl BaseCommand {
BaseCommand::ListWorkers => list_workers(cli),
BaseCommand::Listen(cmd) => cmd.run(cli),
BaseCommand::RegisterTcbInfo(cmd) => cmd.run(cli),
BaseCommand::ShieldFunds(cmd) => cmd.run(cli),
// Litentry's commands below
BaseCommand::PrintSgxMetadataRaw => print_sgx_metadata_raw(cli),
}
Expand Down
25 changes: 12 additions & 13 deletions bitacross-worker/cli/src/trusted_operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ use base58::{FromBase58, ToBase58};
use codec::{Decode, Encode, Input};
use ita_stf::{Getter, StfError, TrustedCallSigned};
use itc_rpc_client::direct_client::{DirectApi, DirectClient};
use itp_node_api::api_client::{ParentchainApi, TEEREX};
use itp_node_api::api_client::{ParentchainApi, TEEBAG};
use itp_rpc::{Id, RpcRequest, RpcResponse, RpcReturnValue};
use itp_sgx_crypto::ShieldingCryptoEncrypt;
use itp_stf_primitives::types::{ShardIdentifier, TrustedOperation};
use itp_types::{BlockNumber, DirectRequestStatus, RsaRequest, TrustedOperationStatus};
use itp_utils::{FromHexPrefixed, ToHexPrefixed};
use litentry_primitives::ParentchainHash as Hash;
use log::*;
use my_node_runtime::RuntimeEvent;
use pallet_teerex::Event as TeerexEvent;
use my_node_runtime::{pallet_teebag::Event as TeebagEvent, RuntimeEvent};
use sp_core::H256;
use std::{
fmt::Debug,
Expand Down Expand Up @@ -150,7 +149,7 @@ fn send_indirect_request<T: Decode + Debug>(
chain_api.set_signer(signer.into());

let request = RsaRequest::new(shard, call_encrypted);
let xt = compose_extrinsic!(&chain_api, TEEREX, "call_worker", request);
let xt = compose_extrinsic!(&chain_api, TEEBAG, "post_opaque_task", request);

let block_hash = match chain_api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock) {
Ok(xt_report) => {
Expand All @@ -176,14 +175,14 @@ fn send_indirect_request<T: Decode + Debug>(
let event_result = subscription.next_events::<RuntimeEvent, Hash>();
if let Some(Ok(event_records)) = event_result {
for event_record in event_records {
if let RuntimeEvent::Teerex(TeerexEvent::ProcessedParentchainBlock(
_signer,
confirmed_block_hash,
trusted_calls_merkle_root,
confirmed_block_number,
)) = event_record.event
if let RuntimeEvent::Teebag(TeebagEvent::ParentchainBlockProcessed {
who: _signer,
block_number: confirmed_block_number,
block_hash: confirmed_block_hash,
task_merkle_root: trusted_calls_merkle_root,
}) = event_record.event
{
info!("Confirmation of ProcessedParentchainBlock received");
info!("Confirmation of ParentchainBlockProcessed received");
debug!("shard: {:?}", shard);
debug!("confirmed parentchain block Hash: {:?}", block_hash);
debug!("trusted calls merkle root: {:?}", trusted_calls_merkle_root);
Expand All @@ -194,9 +193,9 @@ fn send_indirect_request<T: Decode + Debug>(
confirmed_block_hash,
confirmed_block_number,
) {
error!("ProcessedParentchainBlock event: {:?}", e);
error!("ParentchainBlockProcessed event: {:?}", e);
return Err(TrustedOperationError::Default {
msg: format!("ProcessedParentchainBlock event: {:?}", e),
msg: format!("ParentchainBlockProcessed event: {:?}", e),
})
};

Expand Down
20 changes: 0 additions & 20 deletions bitacross-worker/core-primitives/enclave-bridge-storage/Cargo.toml

This file was deleted.

31 changes: 0 additions & 31 deletions bitacross-worker/core-primitives/enclave-bridge-storage/src/lib.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ pub use substrate_api_client::{api::Error as ApiClientError, rpc::TungsteniteRpc
pub mod account;
pub mod chain;
pub mod pallet_teebag;
pub mod pallet_teerex;

pub use account::*;
pub use chain::*;
pub use pallet_teebag::*;
pub use pallet_teerex::*;

pub type ApiResult<T> = Result<T, ApiClientError>;

0 comments on commit d4426c8

Please sign in to comment.