Skip to content

Commit

Permalink
Merge master with the cache changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cashmaney committed Jul 30, 2023
1 parent fa4c10a commit 5696bcb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 0 additions & 2 deletions cosmwasm/enclaves/execute/src/ecalls.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use sgx_types::sgx_status_t;

pub use read_verifier::ecalls::ecall_submit_store_roots;

/// # Safety
/// This function reads buffers which must be correctly initialized by the caller,
/// see safety section of slice::[from_raw_parts](https://doc.rust-lang.org/std/slice/fn.from_raw_parts.html#safety)
Expand Down
2 changes: 2 additions & 0 deletions cosmwasm/enclaves/execute/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub mod registration;
mod sdk_entrypoints;
mod tests;

pub use sdk_entrypoints::ecall_app_begin_blocker;

#[cfg(feature = "production")]
#[ctor]
fn init_logger() {
Expand Down
8 changes: 8 additions & 0 deletions cosmwasm/enclaves/execute/src/sdk_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ macro_rules! validate_input_length {
};
}

/// # Safety
/// This function must only be called with valid pointers and lengths.
/// - `in_roots` and `in_roots_len`: must point to a valid sequence of bytes representing roots.
/// - `in_compute_root` and `in_compute_root_len`: must point to a valid sequence of bytes representing compute roots.
/// It's the caller's responsibility to ensure that the pointers are valid and the lengths are correct.
#[no_mangle]
pub unsafe extern "C" fn ecall_app_begin_blocker(
in_roots: *const u8,
Expand Down Expand Up @@ -55,5 +60,8 @@ pub unsafe extern "C" fn ecall_app_begin_blocker(
}
}

/// # Safety
/// This function's safety requirements depend on the expected implementation.
/// Since the function body is empty, there are currently no specific safety concerns.
#[no_mangle]
pub unsafe extern "C" fn end_blocker() {}
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ fn is_subslice(larger: &[u8], smaller: &[u8]) -> bool {
false
}

#[cfg(feature = "light-client-validation")]
pub fn is_last_msg_in_block() -> bool {
let verified_msgs = VERIFIED_MESSAGES.lock().unwrap();
return verified_msgs.remaining() == 0;
}

#[cfg(feature = "light-client-validation")]
pub fn verify_block_info(base_env: &BaseEnv) -> Result<(), EnclaveError> {
let verified_msgs = VERIFIED_MESSAGES.lock().unwrap();
Expand Down

0 comments on commit 5696bcb

Please sign in to comment.