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
1 change: 0 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2576,7 +2576,6 @@ name = "itp-ocall-api"
version = "0.8.0"
dependencies = [
"itp-types",
"its-primitives",
"parity-scale-codec",
"sgx_types",
"sp-runtime",
Expand Down
2 changes: 1 addition & 1 deletion core-primitives/enclave-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod enclave_base;
pub mod enclave_test;
pub mod error;
pub mod remote_attestation;
pub mod side_chain;
pub mod sidechain;
pub mod teerex_api;
pub mod utils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use sgx_types::sgx_status_t;
use sp_runtime::{generic::SignedBlock, traits::Block};

/// trait for handling blocks on the side chain
pub trait SideChain: Send + Sync + 'static {
pub trait Sidechain: Send + Sync + 'static {
/// Sync parentchain blocks and execute pending tops in the enclave
fn sync_parentchain<PB: Block>(
&self,
Expand All @@ -37,7 +37,7 @@ pub trait SideChain: Send + Sync + 'static {
fn execute_trusted_calls(&self) -> EnclaveResult<()>;
}

impl SideChain for Enclave {
impl Sidechain for Enclave {
fn sync_parentchain<PB: Block>(
&self,
blocks: &[SignedBlock<PB>],
Expand Down
2 changes: 0 additions & 2 deletions core-primitives/ocall-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ sgx_types = { rev = "v1.1.3", git = "https://github.com/apache/teaclave-sgx-sdk.

# local deps
itp-types = { path = "../types", default-features = false }
its-primitives = { path = "../../sidechain/primitives", default-features = false }

[features]
default = ["std"]
Expand All @@ -26,5 +25,4 @@ std = [
"sp-runtime/std",
"sp-std/std",
"itp-types/std",
"its-primitives/std",
]
11 changes: 5 additions & 6 deletions core-primitives/ocall-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use alloc::vec::Vec;
use codec::{Decode, Encode};
use core::fmt::Debug;
use itp_types::{TrustedOperationStatus, WorkerRequest, WorkerResponse};
use its_primitives::traits::SignedBlock;
use sgx_types::*;
use sp_runtime::OpaqueExtrinsic;

Expand Down Expand Up @@ -64,18 +63,18 @@ pub trait EnclaveRpcOCallApi: Clone + Debug + Send + Sync + Default {

/// trait for o-calls related to on-chain interactions
pub trait EnclaveOnChainOCallApi: Clone + Debug + Send + Sync {
fn send_block_and_confirmation<SB: SignedBlock>(
&self,
confirmations: Vec<OpaqueExtrinsic>,
signed_blocks: Vec<SB>,
) -> SgxResult<()>;
fn send_to_parentchain(&self, extrinsics: Vec<OpaqueExtrinsic>) -> SgxResult<()>;

fn worker_request<V: Encode + Decode>(
&self,
req: Vec<WorkerRequest>,
) -> SgxResult<Vec<WorkerResponse<V>>>;
}

pub trait EnclaveSidechainOCallApi: Clone + Debug + Send + Sync {
fn propose_sidechain_blocks<SB: Encode>(&self, signed_blocks: Vec<SB>) -> SgxResult<()>;
}

/// Newtype for IPFS CID
pub struct IpfsCid(pub [u8; 46]);

Expand Down
1 change: 0 additions & 1 deletion enclave-runtime/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,6 @@ name = "itp-ocall-api"
version = "0.8.0"
dependencies = [
"itp-types",
"its-primitives",
"parity-scale-codec",
"sgx_types",
"sp-runtime",
Expand Down
7 changes: 5 additions & 2 deletions enclave-runtime/Enclave.edl
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ enclave {
[out, size = resp_size] uint8_t * response, uint32_t resp_size
);

sgx_status_t ocall_send_block_and_confirmation(
[in, size = confirmations_size] uint8_t * confirmations, uint32_t confirmations_size,
sgx_status_t ocall_propose_sidechain_blocks(
[in, size = signed_blocks_size] uint8_t * signed_blocks, uint32_t signed_blocks_size
);

sgx_status_t ocall_send_to_parentchain(
[in, size = extrinsics_size] uint8_t * extrinsics, uint32_t extrinsics_size
);

sgx_status_t ocall_update_status_event(
[in, size = hash_size] uint8_t * hash_encoded, uint32_t hash_size,
[in, size = status_size] uint8_t * status_update_encoded, uint32_t status_size
Expand Down
Loading