diff --git a/src/kernel_evm/Cargo.lock b/src/kernel_evm/Cargo.lock index e1d871e962790dec9372f90b16b869b130777765..fe6ff09fba5954152687f64adfbc06e34a1693dd 100644 --- a/src/kernel_evm/Cargo.lock +++ b/src/kernel_evm/Cargo.lock @@ -86,12 +86,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" - [[package]] name = "bitvec" version = "0.19.6" @@ -153,12 +147,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byteorder" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" - [[package]] name = "byteorder" version = "1.4.3" @@ -183,43 +171,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "clap" -version = "4.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" -dependencies = [ - "bitflags 2.3.1", - "clap_derive", - "clap_lex", - "is-terminal", - "once_cell", - "strsim", - "termcolor", -] - -[[package]] -name = "clap_derive" -version = "4.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddf67631444a3a3e3e5ac51c36a5e01335302de677bd78759eaa90ab1f46644" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "const-decoder" version = "0.3.0" @@ -412,17 +363,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -574,7 +514,6 @@ dependencies = [ "tezos-smart-rollup-encoding", "tezos-smart-rollup-entrypoint", "tezos-smart-rollup-host", - "tezos-smart-rollup-installer", "tezos-smart-rollup-installer-config", "tezos-smart-rollup-mock", "tezos-smart-rollup-panic-hook", @@ -613,7 +552,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ - "byteorder 1.4.3", + "byteorder", "rustc-hex", "static_assertions", ] @@ -704,12 +643,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "hermit-abi" version = "0.2.6" @@ -836,18 +769,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "is-terminal" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix 0.37.3", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" version = "1.0.5" @@ -889,12 +810,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "lexical-core" version = "0.7.6" @@ -902,7 +817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec 0.5.2", - "bitflags 1.3.2", + "bitflags", "cfg-if", "ryu", "static_assertions", @@ -980,12 +895,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "log" version = "0.4.17" @@ -1084,12 +993,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - [[package]] name = "p256" version = "0.9.0" @@ -1235,8 +1138,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70" dependencies = [ "bit-set", - "bitflags 1.3.2", - "byteorder 1.4.3", + "bitflags", + "byteorder", "lazy_static", "num-traits", "quick-error 2.0.1", @@ -1363,7 +1266,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] @@ -1425,25 +1328,11 @@ version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ - "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" -dependencies = [ - "bitflags 1.3.2", - "errno 0.3.1", + "bitflags", + "errno", "io-lifetimes", "libc", - "linux-raw-sys 0.3.8", + "linux-raw-sys", "windows-sys 0.45.0", ] @@ -1578,12 +1467,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strum" version = "0.20.0" @@ -1596,7 +1479,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ - "heck 0.3.3", + "heck", "proc-macro2", "quote", "syn", @@ -1646,19 +1529,10 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix 0.36.11", + "rustix", "windows-sys 0.42.0", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "tezos-smart-rollup" version = "0.2.0" @@ -1720,22 +1594,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "tezos-smart-rollup-installer" -version = "0.2.0" -dependencies = [ - "blst", - "clap", - "hex", - "serde_yaml", - "tezos-smart-rollup-encoding", - "tezos-smart-rollup-host", - "tezos-smart-rollup-installer-config", - "tezos_data_encoding", - "thiserror", - "wasm-gen", -] - [[package]] name = "tezos-smart-rollup-installer-config" version = "0.2.0" @@ -1791,7 +1649,7 @@ dependencies = [ "anyhow", "base58", "blst", - "byteorder 1.4.3", + "byteorder", "cryptoxide", "ed25519-dalek", "hex", @@ -1959,7 +1817,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "byteorder 1.4.3", + "byteorder", "crunchy", "hex", "static_assertions", @@ -2016,16 +1874,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wasm-gen" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b854b1461005a7b3365742310f7faa3cac3add809d66928c64a40c7e9e842ebb" -dependencies = [ - "byteorder 0.5.3", - "leb128", -] - [[package]] name = "which" version = "4.4.0" @@ -2053,15 +1901,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2074,13 +1913,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -2089,16 +1928,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] @@ -2107,28 +1937,13 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -2137,84 +1952,42 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - [[package]] name = "winnow" version = "0.4.1" diff --git a/src/kernel_evm/kernel/Cargo.toml b/src/kernel_evm/kernel/Cargo.toml index 7d480ce3ac66f959152f9861eca8f6eb3cb72607..d14533de3971568d3917e4334943014c6f1498fd 100644 --- a/src/kernel_evm/kernel/Cargo.toml +++ b/src/kernel_evm/kernel/Cargo.toml @@ -38,16 +38,10 @@ path = "../../kernel_sdk/installer-kernel" [dependencies.tezos-smart-rollup-installer-config] path = "../../kernel_sdk/installer-config" -[dependencies.tezos-smart-rollup-installer] -path = "../../kernel_sdk/installer-client" - [dev-dependencies.tezos-smart-rollup-mock] path = "../../kernel_sdk/mock" features = ["proto-nairobi"] -[dev-dependencies.tezos_data_encoding] -version = "0.5" - [dependencies] tezos_ethereum = { path = "../ethereum" } primitive-types = { version = "0.11.1", default-features = false } @@ -58,6 +52,7 @@ evm-execution = { path = "../evm_execution" } rlp = "0.5.2" sha3 = { version = "0.10.6", default-features = false } libsecp256k1 = { version = "0.7", default-features = false, features = ["static-context", "hmac"] } +tezos_data_encoding = "0.5" [features] default = ["panic-hook"] diff --git a/src/kernel_evm/kernel/src/error.rs b/src/kernel_evm/kernel/src/error.rs index fdb0d310dfea1394458ae4d5119e0fbbe3a422a5..a4f2343afca1888ae1753b3c55ec2148a229dd1a 100644 --- a/src/kernel_evm/kernel/src/error.rs +++ b/src/kernel_evm/kernel/src/error.rs @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Nomadic Labs // SPDX-FileCopyrightText: 2023 Functori +// SPDX-FileCopyrightText: 2023 Trilitech // // SPDX-License-Identifier: MIT use core::str::Utf8Error; @@ -33,6 +34,7 @@ pub enum StorageError { #[derive(Debug)] pub enum UpgradeProcessError { InvalidUpgradeNonce, + ConfigSerialisation(tezos_data_encoding::enc::BinError), } #[derive(Debug)] @@ -69,3 +71,9 @@ impl From for Error { Self::InvalidConversion } } + +impl From for Error { + fn from(e: UpgradeProcessError) -> Self { + Self::UpgradeError(e) + } +} diff --git a/src/kernel_evm/kernel/src/safe_storage.rs b/src/kernel_evm/kernel/src/safe_storage.rs index e2f8a072e4ded7eb680a79dd63f5b71e909a0fcf..d47d0d712ec12e7df33fc4439964b9da120344d6 100644 --- a/src/kernel_evm/kernel/src/safe_storage.rs +++ b/src/kernel_evm/kernel/src/safe_storage.rs @@ -1,9 +1,11 @@ // SPDX-FileCopyrightText: 2023 Nomadic Labs // SPDX-FileCopyrightText: 2023 Functori +// SPDX-FileCopyrightText: 2023 Trilitech // // SPDX-License-Identifier: MIT use crate::upgrade::CONFIG_INTERPRETER_PATH; +use crate::upgrade::KERNEL_BOOT_PATH; use tezos_smart_rollup_core::PREIMAGE_HASH_SIZE; use tezos_smart_rollup_host::{ input::Message, @@ -11,7 +13,6 @@ use tezos_smart_rollup_host::{ path::{concat, OwnedPath, Path, RefPath}, runtime::{Runtime, RuntimeError, ValueType}, }; -use tezos_smart_rollup_installer::KERNEL_BOOT_PATH; pub const TMP_PATH: RefPath = RefPath::assert_from(b"/tmp"); diff --git a/src/kernel_evm/kernel/src/upgrade.rs b/src/kernel_evm/kernel/src/upgrade.rs index 064704b0b53c80806d2a489b667f2a0fa644020f..442852e579420294719a34352002df4955203920 100644 --- a/src/kernel_evm/kernel/src/upgrade.rs +++ b/src/kernel_evm/kernel/src/upgrade.rs @@ -7,18 +7,18 @@ use std::str::FromStr; use crate::error::Error; +use crate::error::UpgradeProcessError; use crate::parsing::{SIGNATURE_HASH_SIZE, UPGRADE_NONCE_SIZE}; use crate::CHAIN_ID; use libsecp256k1::Message; use primitive_types::{H160, U256}; use sha3::{Digest, Keccak256}; +use tezos_data_encoding::enc::BinWriter; use tezos_ethereum::signatures::{caller, signature}; use tezos_smart_rollup_core::PREIMAGE_HASH_SIZE; use tezos_smart_rollup_debug::debug_msg; use tezos_smart_rollup_host::path::{OwnedPath, RefPath}; use tezos_smart_rollup_host::runtime::Runtime; -use tezos_smart_rollup_installer::installer::with_config_program; -use tezos_smart_rollup_installer::{KERNEL_BOOT_PATH, PREPARE_KERNEL_PATH}; use tezos_smart_rollup_installer_config::binary::owned::{ OwnedConfigInstruction, OwnedConfigProgram, }; @@ -83,6 +83,8 @@ pub fn check_dictator_signature( } } +// Boot path for kernels +pub const KERNEL_BOOT_PATH: RefPath = RefPath::assert_from(b"/kernel/boot.wasm"); // Path that will contain the config interpretation. pub const CONFIG_INTERPRETER_PATH: RefPath = RefPath::assert_from(b"/installer/config_interpreter"); @@ -96,19 +98,16 @@ pub fn upgrade_kernel( debug_msg!(host, "Kernel upgrade initialisation.\n"); let root_hash = root_hash.to_vec(); - // Create config consisting of a reveal instruction, followed by a move one. - let reveal_instructions = vec![ - OwnedConfigInstruction::reveal_instr( - root_hash.into(), - OwnedPath::from(PREPARE_KERNEL_PATH), - ), - OwnedConfigInstruction::move_instr( - OwnedPath::from(PREPARE_KERNEL_PATH), - OwnedPath::from(KERNEL_BOOT_PATH), - ), - ]; - - let kernel_config = with_config_program(OwnedConfigProgram(reveal_instructions)); + // Create config consisting of a reveal instruction. + let reveal_instructions = vec![OwnedConfigInstruction::reveal_instr( + root_hash.into(), + OwnedPath::from(KERNEL_BOOT_PATH), + )]; + + let mut kernel_config = Vec::new(); + OwnedConfigProgram(reveal_instructions) + .bin_write(&mut kernel_config) + .map_err(UpgradeProcessError::ConfigSerialisation)?; host.store_write_all(&CONFIG_INTERPRETER_PATH, &kernel_config)?;