diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/index.html b/rust/oasis_runtime_sdk/modules/rofl/app/index.html index 762c00f16a..6a7526964f 100644 --- a/rust/oasis_runtime_sdk/modules/rofl/app/index.html +++ b/rust/oasis_runtime_sdk/modules/rofl/app/index.html @@ -1,2 +1,2 @@ -oasis_runtime_sdk::modules::rofl::app - Rust

Module oasis_runtime_sdk::modules::rofl::app

source ·
Expand description

Wrapper to make development of ROFL components easier.

+oasis_runtime_sdk::modules::rofl::app - Rust

Module oasis_runtime_sdk::modules::rofl::app

source ·
Expand description

Wrapper to make development of ROFL components easier.

Re-exports§

  • pub use crate::modules::rofl::app_id::AppId;

Modules§

  • Prelude for ROFL applications.

Structs§

  • A runtime client meant for use within runtimes.
  • Application environment.

Traits§

  • ROFL component application.
\ No newline at end of file diff --git a/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html b/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html index 6c69ae6df1..da7f984ee4 100644 --- a/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html +++ b/rust/oasis_runtime_sdk/modules/rofl/app/trait.App.html @@ -1,4 +1,4 @@ -App in oasis_runtime_sdk::modules::rofl::app - Rust

Trait oasis_runtime_sdk::modules::rofl::app::App

source ·
pub trait App: Send + Sync + 'static {
+App in oasis_runtime_sdk::modules::rofl::app - Rust

Trait oasis_runtime_sdk::modules::rofl::app::App

source ·
pub trait App: Send + Sync + 'static {
     const VERSION: Version;
 
     // Required methods
@@ -22,23 +22,23 @@
     fn start(self)
        where Self: Sized { ... }
 }
Expand description

ROFL component application.

-

Required Associated Constants§

source

const VERSION: Version

ROFL application version.

-

Required Methods§

source

fn id() -> AppId

Identifier of the application (used for registrations).

-
source

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity +

Required Associated Constants§

source

const VERSION: Version

ROFL application version.

+

Required Methods§

source

fn id() -> AppId

Identifier of the application (used for registrations).

+
source

fn consensus_trust_root() -> Option<TrustRoot>

Return the consensus layer trust root for this runtime; if None, consensus layer integrity verification will not be performed.

-

Provided Methods§

source

fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
where +

Provided Methods§

source

fn new_transaction<B>(&self, method: &str, body: B) -> Transaction
where B: Encode,

Create a new unsigned transaction.

-
source

fn run<'async_trait>( +

source

fn run<'async_trait>( self: Arc<Self>, env: Environment<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Main application processing loop.

-
source

fn on_runtime_block<'async_trait>( +

source

fn on_runtime_block<'async_trait>( self: Arc<Self>, env: Environment<Self>, round: u64, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Logic that runs on each runtime block. Only one of these will run concurrently.

-
source

fn start(self)
where +

source

fn start(self)
where Self: Sized,

Start the application.

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/rust/src-files.js b/rust/src-files.js index cf1cae5573..bbefeb3829 100644 --- a/rust/src-files.js +++ b/rust/src-files.js @@ -6,7 +6,7 @@ var srcIndex = new Map(JSON.parse('[\ ["oasis_contract_sdk_storage",["",[],["cell.rs","lib.rs","map.rs"]]],\ ["oasis_contract_sdk_types",["",[["modules",[],["contracts.rs","mod.rs"]]],["address.rs","crypto.rs","env.rs","event.rs","lib.rs","message.rs","storage.rs","testing.rs","token.rs"]]],\ ["oasis_core_runtime",["",[["common",[["crypto",[["mrae",[],["deoxysii.rs","mod.rs","nonce.rs"]]],["hash.rs","mod.rs","signature.rs","x25519.rs"]],["sgx",[["pcs",[],["certificates.rs","constants.rs","mod.rs","policy.rs","quote.rs","report.rs","tcb.rs","utils.rs"]]],["egetkey.rs","ias.rs","mod.rs","seal.rs"]]],["bytes.rs","key_format.rs","logger.rs","mod.rs","namespace.rs","panic.rs","process.rs","quantity.rs","time.rs","version.rs","versioned.rs"]],["consensus",[["keymanager",[],["churp.rs"]],["roothash",[["commitment",[],["executor.rs","mod.rs","pool.rs"]]],["block.rs","message.rs","mod.rs"]],["state",[["keymanager",[],["churp.rs"]]],["beacon.rs","keymanager.rs","mod.rs","registry.rs","roothash.rs","staking.rs"]],["tendermint",[["verifier",[["store",[],["lru.rs","mod.rs","state.rs"]]],["cache.rs","clock.rs","handle.rs","io.rs","mod.rs","noop.rs","predicates.rs","signature.rs","types.rs"]]],["merkle.rs","mod.rs"]]],["address.rs","beacon.rs","governance.rs","keymanager.rs","mod.rs","registry.rs","scheduler.rs","staking.rs","transaction.rs","verifier.rs"]],["enclave_rpc",[],["client.rs","context.rs","demux.rs","dispatcher.rs","mod.rs","session.rs","sessions.rs","transport.rs","types.rs"]],["storage",[["mkvs",[["cache",[],["lru_cache.rs","mod.rs"]],["sync",[],["errors.rs","host.rs","merge.rs","mod.rs","noop.rs","proof.rs","stats.rs"]],["tree",[],["commit.rs","errors.rs","insert.rs","iterator.rs","lookup.rs","macros.rs","marshal.rs","mod.rs","node.rs","overlay.rs","prefetch.rs","remove.rs"]]],["marshal.rs","mod.rs"]]],["mod.rs"]],["transaction",[],["context.rs","dispatcher.rs","mod.rs","rwset.rs","tags.rs","tree.rs","types.rs"]]],["app.rs","attestation.rs","cache.rs","config.rs","dispatcher.rs","future.rs","host.rs","identity.rs","init.rs","lib.rs","policy.rs","protocol.rs","types.rs"]]],\ -["oasis_runtime_sdk",["",[["crypto",[["multisig",[],["mod.rs"]],["signature",[],["context.rs","digests.rs","ed25519.rs","mod.rs","secp256k1.rs","secp256r1.rs","secp384r1.rs","sr25519.rs"]]],["mod.rs","random.rs"]],["modules",[["access",[],["mod.rs","types.rs"]],["accounts",[],["fee.rs","mod.rs","types.rs"]],["consensus",[],["mod.rs","types.rs"]],["consensus_accounts",[],["mod.rs","state.rs","types.rs"]],["core",[],["mod.rs","types.rs"]],["rewards",[],["mod.rs","types.rs"]],["rofl",[["app",[],["client.rs","env.rs","mod.rs","notifier.rs","prelude.rs","processor.rs","registration.rs"]]],["app_id.rs","config.rs","error.rs","event.rs","mod.rs","policy.rs","state.rs","types.rs"]]],["mod.rs"]],["storage",[],["confidential.rs","hashed.rs","host.rs","mkvs.rs","mod.rs","overlay.rs","prefix.rs","typed.rs"]],["testing",[],["keymanager.rs","keys.rs","mock.rs","mod.rs"]],["types",[],["address.rs","callformat.rs","message.rs","mod.rs","token.rs","transaction.rs"]]],["callformat.rs","config.rs","context.rs","dispatcher.rs","enclave_rpc.rs","error.rs","event.rs","history.rs","keymanager.rs","lib.rs","module.rs","runtime.rs","schedule_control.rs","sender.rs","state.rs","subcall.rs"]]],\ +["oasis_runtime_sdk",["",[["crypto",[["multisig",[],["mod.rs"]],["signature",[],["context.rs","digests.rs","ed25519.rs","mod.rs","secp256k1.rs","secp256r1.rs","secp384r1.rs","sr25519.rs"]]],["mod.rs","random.rs"]],["modules",[["access",[],["mod.rs","types.rs"]],["accounts",[],["fee.rs","mod.rs","types.rs"]],["consensus",[],["mod.rs","types.rs"]],["consensus_accounts",[],["mod.rs","state.rs","types.rs"]],["core",[],["mod.rs","types.rs"]],["rewards",[],["mod.rs","types.rs"]],["rofl",[["app",[["init",[],["mod.rs"]]],["client.rs","env.rs","mod.rs","notifier.rs","prelude.rs","processor.rs","registration.rs"]]],["app_id.rs","config.rs","error.rs","event.rs","mod.rs","policy.rs","state.rs","types.rs"]]],["mod.rs"]],["storage",[],["confidential.rs","hashed.rs","host.rs","mkvs.rs","mod.rs","overlay.rs","prefix.rs","typed.rs"]],["testing",[],["keymanager.rs","keys.rs","mock.rs","mod.rs"]],["types",[],["address.rs","callformat.rs","message.rs","mod.rs","token.rs","transaction.rs"]]],["callformat.rs","config.rs","context.rs","dispatcher.rs","enclave_rpc.rs","error.rs","event.rs","history.rs","keymanager.rs","lib.rs","module.rs","runtime.rs","schedule_control.rs","sender.rs","state.rs","subcall.rs"]]],\ ["oasis_runtime_sdk_contracts",["",[["abi",[["oasis",[],["crypto.rs","env.rs","memory.rs","mod.rs","storage.rs","validation.rs"]]],["gas.rs","mod.rs"]]],["code.rs","lib.rs","results.rs","store.rs","types.rs","wasm.rs"]]],\ ["oasis_runtime_sdk_macros",["",[["module_derive",[],["method_handler.rs","migration_handler.rs","mod.rs","module.rs"]]],["error_derive.rs","event_derive.rs","generators.rs","lib.rs","version_from_cargo.rs"]]],\ ["rofl_utils",["",[],["https.rs","lib.rs"]]]\ diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/init/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/init/mod.rs.html new file mode 100644 index 0000000000..faa836a28f --- /dev/null +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/init/mod.rs.html @@ -0,0 +1,25 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+
//! Additional init functionalities performed by ROFL apps when running in a virtual machine
+//! environment (e.g. Intel TDX).
+
+#[cfg(feature = "tdx")]
+mod tdx;
+
+/// Perform post-registration initialization. This will set up things like external networking
+/// support inside the virtual machine.
+pub(crate) fn post_registration_init() {
+    #[cfg(feature = "tdx")]
+    tdx::post_registration_init();
+}
+
\ No newline at end of file diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html index 00f0fd6cb2..2ec15f72c6 100644 --- a/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html +++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/mod.rs.html @@ -130,6 +130,7 @@ 130 131 132 +133
//! Wrapper to make development of ROFL components easier.
 use std::sync::Arc;
 
@@ -152,6 +153,7 @@
 
 mod client;
 mod env;
+mod init;
 mod notifier;
 pub mod prelude;
 mod processor;
diff --git a/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html b/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html
index 8bcdbbe0e2..93d4601d0e 100644
--- a/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html
+++ b/rust/src/oasis_runtime_sdk/modules/rofl/app/processor.rs.html
@@ -191,6 +191,7 @@
 191
 192
 193
+194
 
use std::sync::Arc;
 
 use anyhow::{anyhow, Result};
@@ -209,7 +210,7 @@
 };
 use rand::rngs::OsRng;
 
-use super::{notifier, registration, App, Environment};
+use super::{init, notifier, registration, App, Environment};
 
 /// Size of the processor command queue.
 const CMDQ_BACKLOG: usize = 32;
@@ -367,13 +368,14 @@
     }
 
     async fn cmd_initial_registration_completed(&self) -> Result<()> {
-        slog::info!(
-            self.logger,
-            "initial registration completed, starting application"
-        );
+        slog::info!(self.logger, "initial registration completed");
+
+        // Perform post-registration initialization.
+        init::post_registration_init();
 
         // Start application after first registration.
-        tokio::spawn(self.state.app.clone().run(self.env.clone()));
+        slog::info!(self.logger, "starting application");
+        tokio::spawn(self.state.app.clone().run(self.env.clone()));
 
         // Notify notifier task.
         self.tasks