diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 111930a0..552f8215 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,10 +138,10 @@ jobs: working-directory: ./machine/emulator run: | make bundle-boost - wget https://github.com/cartesi/machine-emulator/releases/download/v0.19.0/add-generated-files.diff + wget https://github.com/cartesi/machine-emulator/releases/download/v0.20.0-test/add-generated-files.diff git apply add-generated-files.diff make - sudo make install + sudo make install DESTDIR=$GITHUB_WORKSPACE/ PREFIX=usr/ - name: Setup env run: | diff --git a/cartesi-rollups/node/blockchain-reader/src/lib.rs b/cartesi-rollups/node/blockchain-reader/src/lib.rs index 23973a57..e8bf8c77 100644 --- a/cartesi-rollups/node/blockchain-reader/src/lib.rs +++ b/cartesi-rollups/node/blockchain-reader/src/lib.rs @@ -569,7 +569,10 @@ mod blockchain_reader_tests { let mut machine = Machine::create( &MachineConfig::new_with_ram(RAMConfig { length: 134217728, - image_filename: "../../../test/programs/linux.bin".into(), + backing_store: cartesi_machine::config::machine::BackingStoreConfig { + data_filename: "../../../test/programs/linux.bin".into(), + ..Default::default() + }, }), &RuntimeConfig::default(), ) diff --git a/cartesi-rollups/node/blockchain-reader/src/test_utils.rs b/cartesi-rollups/node/blockchain-reader/src/test_utils.rs index b69ea563..36ec2b61 100644 --- a/cartesi-rollups/node/blockchain-reader/src/test_utils.rs +++ b/cartesi-rollups/node/blockchain-reader/src/test_utils.rs @@ -13,7 +13,7 @@ use cartesi_rollups_contracts::i_input_box::IInputBox; use serde::Deserialize; use std::{ fs::{self, File}, - io::Read, + io::{Read, Seek}, path::PathBuf, }; @@ -77,8 +77,11 @@ pub async fn spawn_anvil_and_provider() -> Result<(AnvilInstance, DynProvider, A let dave_app_factory = deployment_address("DaveAppFactory"); let initial_hash = { - // $ xxd -p -c32 test/programs/echo/machine-image/hash - let mut file = File::open(program_path.join("machine-image").join("hash")).unwrap(); + // Root hash is stored in hash_tree.sht at offset 0x60 (node 1's hash in sparse tree). + // Equivalent to: xxd -seek 0x60 -l 0x20 -c 0x20 -p .../machine-image/hash_tree.sht + let mut file = + File::open(program_path.join("machine-image").join("hash_tree.sht")).unwrap(); + file.seek(std::io::SeekFrom::Start(0x60)).unwrap(); let mut buffer = [0u8; 32]; file.read_exact(&mut buffer).unwrap(); buffer diff --git a/cartesi-rollups/node/state-manager/src/persistent_state_access.rs b/cartesi-rollups/node/state-manager/src/persistent_state_access.rs index b11d772f..704d1a60 100644 --- a/cartesi-rollups/node/state-manager/src/persistent_state_access.rs +++ b/cartesi-rollups/node/state-manager/src/persistent_state_access.rs @@ -330,7 +330,10 @@ mod tests { let mut machine = Machine::create( &MachineConfig::new_with_ram(RAMConfig { length: 134217728, - image_filename: "../../../test/programs/linux.bin".into(), + backing_store: cartesi_machine::config::machine::BackingStoreConfig { + data_filename: "../../../test/programs/linux.bin".into(), + ..Default::default() + }, }), &RuntimeConfig::default(), ) diff --git a/cartesi-rollups/node/state-manager/src/sql/test_helper.rs b/cartesi-rollups/node/state-manager/src/sql/test_helper.rs index 73758261..d849c6b0 100644 --- a/cartesi-rollups/node/state-manager/src/sql/test_helper.rs +++ b/cartesi-rollups/node/state-manager/src/sql/test_helper.rs @@ -21,7 +21,10 @@ pub fn setup_db() -> (TempDir, Connection) { let mut machine = Machine::create( &MachineConfig::new_with_ram(RAMConfig { length: 134217728, - image_filename: "../../../test/programs/linux.bin".into(), + backing_store: cartesi_machine::config::machine::BackingStoreConfig { + data_filename: "../../../test/programs/linux.bin".into(), + ..Default::default() + }, }), &RuntimeConfig::default(), ) diff --git a/justfile b/justfile index 4c251252..4e1c6481 100644 --- a/justfile +++ b/justfile @@ -7,13 +7,18 @@ clean-emulator: clean-contracts: clean-consensus-contracts clean-prt-contracts clean-bindings clean-deployments make -C machine/emulator clean # wtf? this is cleaning the emulator, not contracts +apply-generated-files-diff VERSION="v0.20.0-test": + cd machine/emulator && \ + wget https://github.com/cartesi/machine-emulator/releases/download/{{VERSION}}/add-generated-files.diff && \ + git apply add-generated-files.diff + # setup the emulator locally. # ```sh # export PATH=$PATH:$PWD/usr/bin # ``` -setup: update-submodules clean-emulator clean-contracts +setup: update-submodules clean-emulator clean-contracts apply-generated-files-diff make -C machine/emulator bundle-boost - make -C machine/emulator uarch-with-toolchain # Requires docker, necessary for machine bindings + make -C machine/emulator # Requires docker, necessary for machine bindings make -C machine/emulator -j$(nproc) all make -C machine/emulator install DESTDIR=$PWD/ PREFIX=usr/ diff --git a/machine/rust-bindings/cartesi-machine/src/config/machine.rs b/machine/rust-bindings/cartesi-machine/src/config/machine.rs index e599ed6f..5d3b6dde 100644 --- a/machine/rust-bindings/cartesi-machine/src/config/machine.rs +++ b/machine/rust-bindings/cartesi-machine/src/config/machine.rs @@ -4,15 +4,43 @@ use serde::{Deserialize, Serialize}; use std::path::PathBuf; +/// Backing store config; matches C++ backing_store_config (data_filename, etc.). +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +pub struct BackingStoreConfig { + #[serde(default)] + pub shared: bool, + #[serde(default)] + pub create: bool, + #[serde(default)] + pub truncate: bool, + #[serde(default)] + pub data_filename: PathBuf, + #[serde(default)] + pub dht_filename: PathBuf, + #[serde(default)] + pub dpt_filename: PathBuf, +} + +/// Config with only backing_store; matches C++ backing_store_config_only. +#[derive(Clone, Debug, Default, Serialize, Deserialize)] +pub struct BackingStoreConfigOnly { + #[serde(default)] + pub backing_store: BackingStoreConfig, +} + #[derive(Clone, Debug, Serialize, Deserialize)] pub struct MachineConfig { pub processor: ProcessorConfig, pub ram: RAMConfig, pub dtb: DTBConfig, pub flash_drive: FlashDriveConfigs, + #[serde(default)] pub tlb: TLBConfig, + #[serde(default)] pub clint: CLINTConfig, + #[serde(default)] pub plic: PLICConfig, + #[serde(default)] pub htif: HTIFConfig, pub uarch: UarchConfig, pub cmio: CmioConfig, @@ -93,106 +121,206 @@ fn default_config() -> MachineConfig { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct ProcessorConfig { + #[serde(default)] + pub backing_store: BackingStoreConfig, + #[serde(default)] pub x0: u64, + #[serde(default)] pub x1: u64, + #[serde(default)] pub x2: u64, + #[serde(default)] pub x3: u64, + #[serde(default)] pub x4: u64, + #[serde(default)] pub x5: u64, + #[serde(default)] pub x6: u64, + #[serde(default)] pub x7: u64, + #[serde(default)] pub x8: u64, + #[serde(default)] pub x9: u64, + #[serde(default)] pub x10: u64, + #[serde(default)] pub x11: u64, + #[serde(default)] pub x12: u64, + #[serde(default)] pub x13: u64, + #[serde(default)] pub x14: u64, + #[serde(default)] pub x15: u64, + #[serde(default)] pub x16: u64, + #[serde(default)] pub x17: u64, + #[serde(default)] pub x18: u64, + #[serde(default)] pub x19: u64, + #[serde(default)] pub x20: u64, + #[serde(default)] pub x21: u64, + #[serde(default)] pub x22: u64, + #[serde(default)] pub x23: u64, + #[serde(default)] pub x24: u64, + #[serde(default)] pub x25: u64, + #[serde(default)] pub x26: u64, + #[serde(default)] pub x27: u64, + #[serde(default)] pub x28: u64, + #[serde(default)] pub x29: u64, + #[serde(default)] pub x30: u64, + #[serde(default)] pub x31: u64, + #[serde(default)] pub f0: u64, + #[serde(default)] pub f1: u64, + #[serde(default)] pub f2: u64, + #[serde(default)] pub f3: u64, + #[serde(default)] pub f4: u64, + #[serde(default)] pub f5: u64, + #[serde(default)] pub f6: u64, + #[serde(default)] pub f7: u64, + #[serde(default)] pub f8: u64, + #[serde(default)] pub f9: u64, + #[serde(default)] pub f10: u64, + #[serde(default)] pub f11: u64, + #[serde(default)] pub f12: u64, + #[serde(default)] pub f13: u64, + #[serde(default)] pub f14: u64, + #[serde(default)] pub f15: u64, + #[serde(default)] pub f16: u64, + #[serde(default)] pub f17: u64, + #[serde(default)] pub f18: u64, + #[serde(default)] pub f19: u64, + #[serde(default)] pub f20: u64, + #[serde(default)] pub f21: u64, + #[serde(default)] pub f22: u64, + #[serde(default)] pub f23: u64, + #[serde(default)] pub f24: u64, + #[serde(default)] pub f25: u64, + #[serde(default)] pub f26: u64, + #[serde(default)] pub f27: u64, + #[serde(default)] pub f28: u64, + #[serde(default)] pub f29: u64, + #[serde(default)] pub f30: u64, + #[serde(default)] pub f31: u64, + #[serde(default)] pub pc: u64, + #[serde(default)] pub fcsr: u64, + #[serde(default)] pub mvendorid: u64, + #[serde(default)] pub marchid: u64, + #[serde(default)] pub mimpid: u64, + #[serde(default)] pub mcycle: u64, + #[serde(default)] pub icycleinstret: u64, + #[serde(default)] pub mstatus: u64, + #[serde(default)] pub mtvec: u64, + #[serde(default)] pub mscratch: u64, + #[serde(default)] pub mepc: u64, + #[serde(default)] pub mcause: u64, + #[serde(default)] pub mtval: u64, + #[serde(default)] pub misa: u64, + #[serde(default)] pub mie: u64, + #[serde(default)] pub mip: u64, + #[serde(default)] pub medeleg: u64, + #[serde(default)] pub mideleg: u64, + #[serde(default)] pub mcounteren: u64, + #[serde(default)] pub menvcfg: u64, + #[serde(default)] pub stvec: u64, + #[serde(default)] pub sscratch: u64, + #[serde(default)] pub sepc: u64, + #[serde(default)] pub scause: u64, + #[serde(default)] pub stval: u64, + #[serde(default)] pub satp: u64, + #[serde(default)] pub scounteren: u64, + #[serde(default)] pub senvcfg: u64, + #[serde(default)] pub ilrsc: u64, + #[serde(default)] pub iprv: u64, + #[serde(default)] #[serde(rename = "iflags_X")] pub iflags_x: u64, + #[serde(default)] #[serde(rename = "iflags_Y")] pub iflags_y: u64, + #[serde(default)] #[serde(rename = "iflags_H")] pub iflags_h: u64, + #[serde(default)] pub iunrep: u64, } @@ -205,7 +333,7 @@ impl Default for ProcessorConfig { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct RAMConfig { pub length: u64, - pub image_filename: PathBuf, + pub backing_store: BackingStoreConfig, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -213,7 +341,7 @@ pub struct DTBConfig { pub bootargs: String, pub init: String, pub entrypoint: String, - pub image_filename: PathBuf, + pub backing_store: BackingStoreConfig, } impl Default for DTBConfig { @@ -224,18 +352,18 @@ impl Default for DTBConfig { #[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct MemoryRangeConfig { - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none", default)] pub start: Option, - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none", default)] pub length: Option, - pub image_filename: PathBuf, - pub shared: bool, + #[serde(default)] + pub read_only: bool, + pub backing_store: BackingStoreConfig, } #[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct CmioBufferConfig { - pub image_filename: PathBuf, - pub shared: bool, + pub backing_store: BackingStoreConfig, } #[derive(Clone, Debug, Default, Serialize, Deserialize)] @@ -272,91 +400,113 @@ pub struct VirtIODeviceConfig { pub type FlashDriveConfigs = Vec; -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct TLBConfig { - pub image_filename: PathBuf, -} - -impl Default for TLBConfig { - fn default() -> Self { - default_config().tlb - } + #[serde(default)] + pub backing_store: BackingStoreConfig, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct CLINTConfig { + #[serde(default)] pub mtimecmp: u64, } -impl Default for CLINTConfig { - fn default() -> Self { - default_config().clint - } -} - -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct PLICConfig { + #[serde(default)] pub girqpend: u64, + #[serde(default)] pub girqsrvd: u64, } -impl Default for PLICConfig { - fn default() -> Self { - default_config().plic - } -} - -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct HTIFConfig { + #[serde(default)] pub fromhost: u64, + #[serde(default)] pub tohost: u64, + #[serde(default)] pub console_getchar: bool, + #[serde(default)] pub yield_manual: bool, + #[serde(default)] pub yield_automatic: bool, } -impl Default for HTIFConfig { - fn default() -> Self { - default_config().htif - } -} - #[derive(Clone, Debug, Serialize, Deserialize)] pub struct UarchProcessorConfig { + #[serde(default)] + pub backing_store: BackingStoreConfig, + #[serde(default)] pub x0: u64, + #[serde(default)] pub x1: u64, + #[serde(default)] pub x2: u64, + #[serde(default)] pub x3: u64, + #[serde(default)] pub x4: u64, + #[serde(default)] pub x5: u64, + #[serde(default)] pub x6: u64, + #[serde(default)] pub x7: u64, + #[serde(default)] pub x8: u64, + #[serde(default)] pub x9: u64, + #[serde(default)] pub x10: u64, + #[serde(default)] pub x11: u64, + #[serde(default)] pub x12: u64, + #[serde(default)] pub x13: u64, + #[serde(default)] pub x14: u64, + #[serde(default)] pub x15: u64, + #[serde(default)] pub x16: u64, + #[serde(default)] pub x17: u64, + #[serde(default)] pub x18: u64, + #[serde(default)] pub x19: u64, + #[serde(default)] pub x20: u64, + #[serde(default)] pub x21: u64, + #[serde(default)] pub x22: u64, + #[serde(default)] pub x23: u64, + #[serde(default)] pub x24: u64, + #[serde(default)] pub x25: u64, + #[serde(default)] pub x26: u64, + #[serde(default)] pub x27: u64, + #[serde(default)] pub x28: u64, + #[serde(default)] pub x29: u64, + #[serde(default)] pub x30: u64, + #[serde(default)] pub x31: u64, + #[serde(default)] pub pc: u64, + #[serde(default)] pub cycle: u64, + #[serde(default)] pub halt_flag: bool, } @@ -368,9 +518,9 @@ impl Default for UarchProcessorConfig { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct UarchRAMConfig { - #[serde(skip_serializing_if = "Option::is_none")] + #[serde(skip_serializing_if = "Option::is_none", default)] pub length: Option, - pub image_filename: PathBuf, + pub backing_store: BackingStoreConfig, } impl Default for UarchRAMConfig { diff --git a/machine/rust-bindings/cartesi-machine/src/machine.rs b/machine/rust-bindings/cartesi-machine/src/machine.rs index b718130b..26dd7d6a 100644 --- a/machine/rust-bindings/cartesi-machine/src/machine.rs +++ b/machine/rust-bindings/cartesi-machine/src/machine.rs @@ -128,13 +128,16 @@ impl Machine { } /// Stores a machine instance to a directory, serializing its entire state. + /// Uses CM_SHARING_ALL so that the current machine state is written for all + /// address ranges (required when storing in-memory machines that have no + /// backing files). pub fn store(&mut self, dir: &Path) -> Result<()> { let dir_cstr = path_to_cstring(dir); let err_code = unsafe { cartesi_machine_sys::cm_store( self.machine, dir_cstr.as_ptr(), - cartesi_machine_sys::CM_SHARING_CONFIG, + cartesi_machine_sys::CM_SHARING_ALL, ) }; check_err!(err_code)?; @@ -654,7 +657,7 @@ mod tests { use crate::{ config::{ - machine::{DTBConfig, MachineConfig, MemoryRangeConfig, RAMConfig}, + machine::{BackingStoreConfig, MachineConfig, MemoryRangeConfig, RAMConfig}, runtime::RuntimeConfig, }, constants, @@ -663,36 +666,46 @@ mod tests { }; fn make_basic_machine_config() -> MachineConfig { - MachineConfig::new_with_ram(RAMConfig { + let mut config = Machine::default_config().expect("failed to get default config"); + config.ram = RAMConfig { length: 134217728, - image_filename: "../../../test/programs/linux.bin".into(), - }) - .dtb(DTBConfig { - entrypoint: "echo Hello from inside!".to_string(), - ..Default::default() - }) - .add_flash_drive(MemoryRangeConfig { - image_filename: "../../../test/programs/rootfs.ext2".into(), + backing_store: BackingStoreConfig { + data_filename: "../../../test/programs/linux.bin".into(), + ..Default::default() + }, + }; + config.dtb.entrypoint = "echo Hello from inside!".to_string(); + config.flash_drive = vec![MemoryRangeConfig { + backing_store: BackingStoreConfig { + data_filename: "../../../test/programs/rootfs.ext2".into(), + ..Default::default() + }, ..Default::default() - }) + }]; + config } fn make_cmio_machine_config() -> MachineConfig { - MachineConfig::new_with_ram(RAMConfig { + let mut config = Machine::default_config().expect("failed to get default config"); + config.ram = RAMConfig { length: 134217728, - image_filename: "../../../test/programs/linux.bin".into(), - }) - .dtb(DTBConfig { - entrypoint: - "echo '{\"domain\":16,\"id\":\"'$(echo -n Hello from inside! | hex --encode)'\"}' \ + backing_store: BackingStoreConfig { + data_filename: "../../../test/programs/linux.bin".into(), + ..Default::default() + }, + }; + config.dtb.entrypoint = + "echo '{\"domain\":16,\"id\":\"'$(echo -n Hello from inside! | hex --encode)'\"}' \ | rollup gio | grep -Eo '0x[0-9a-f]+' | tr -d '\\n' | hex --decode; echo" - .to_string(), - ..Default::default() - }) - .add_flash_drive(MemoryRangeConfig { - image_filename: "../../../test/programs/rootfs.ext2".into(), + .to_string(); + config.flash_drive = vec![MemoryRangeConfig { + backing_store: BackingStoreConfig { + data_filename: "../../../test/programs/rootfs.ext2".into(), + ..Default::default() + }, ..Default::default() - }) + }]; + config } fn create_machine(config: &MachineConfig) -> Result { diff --git a/prt/tests/common/runners/helpers/patched_commitment.lua b/prt/tests/common/runners/helpers/patched_commitment.lua index 81820f40..a46bf4ae 100644 --- a/prt/tests/common/runners/helpers/patched_commitment.lua +++ b/prt/tests/common/runners/helpers/patched_commitment.lua @@ -32,7 +32,7 @@ local function filter_map_patches(patches, base_cycle, log2_stride, log2_stride_ local span = bint256.one() << (log2_stride_count + log2_stride) local mask = (bint256.one() << log2_stride) - 1 if (patch.meta_cycle & mask):iszero() and -- alignment; first bits are zero - patch.meta_cycle > base_cycle and -- meta_cycle is within lower bound + patch.meta_cycle > base_cycle and -- meta_cycle is within lower bound patch.meta_cycle <= base_cycle + span -- meta_cycle is within upper bounds then local position = ((patch.meta_cycle - base_cycle) >> log2_stride) - 1 diff --git a/prt/tests/rollups/dave/node.lua b/prt/tests/rollups/dave/node.lua index 7ff56ae7..b1d828e1 100644 --- a/prt/tests/rollups/dave/node.lua +++ b/prt/tests/rollups/dave/node.lua @@ -61,6 +61,7 @@ sqlite3 -readonly ./_state/%d/db \ 'SELECT repetitions, HEX(leaf) FROM leafs WHERE level=0 ORDER BY leaf_index ASC' 2>&1 ]] function Dave:root_commitment(epoch_index) + print(string.format("[Dave] root_commitment(epoch_index=%d) called", epoch_index)) local query = function() assert(db_exists(epoch_index), string.format("db %d doesn't exist ", epoch_index)) @@ -87,14 +88,21 @@ function Dave:root_commitment(epoch_index) builder:add(leaf, repetitions) end - return initial_state, builder:build(initial_state.root_hash) + local commitment = builder:build(initial_state.root_hash) + print(string.format("[Dave] root_commitment(epoch_index=%d) -> root=%s", epoch_index, commitment.root_hash:hex_string())) + return initial_state, commitment end local initial_state, commitment + local attempt = 0 time.sleep_until(function() + attempt = attempt + 1 self.sender:advance_blocks(1) local ok ok, initial_state, commitment = pcall(query) + if not ok and (attempt == 1 or attempt % 10 == 0) then + print(string.format("[Dave] root_commitment(epoch_index=%d) attempt %d failed: %s", epoch_index, attempt, tostring(initial_state))) + end return ok end, 5) diff --git a/prt/tests/rollups/setup_path.lua b/prt/tests/rollups/setup_path.lua index 0c44f163..fd0764a7 100644 --- a/prt/tests/rollups/setup_path.lua +++ b/prt/tests/rollups/setup_path.lua @@ -1,7 +1,19 @@ --- setup client-lua path -package.path = package.path .. ";../common/?.lua" -package.path = package.path .. ";../../client-lua/?.lua" +-- Resolve repo root from caller (e.g. test_cases/simple.lua) so paths work from any cwd. +local function repo_root_from_caller() + local info = debug.getinfo(2, "S") + if not info or not info.source then return nil end + local source = info.source:gsub("^@", "") + local dir = source:gsub("/[^/]*$", "") + if dir == "" or dir == source then return nil end + return dir .. "/../../../" +end --- setup cartesi machine path -package.path = package.path .. ";/opt/cartesi/lib/lua/5.4/?.lua" -package.cpath = package.cpath .. ";/opt/cartesi/lib/lua/5.4/?.so" +local repo_root = repo_root_from_caller() or "../../.." +local rollups = repo_root .. "/prt/tests/rollups" + +local usr = repo_root .. "/usr" +package.path = usr .. "/share/lua/5.4/?.lua;" .. package.path +package.cpath = usr .. "/lib/lua/5.4/?.so;" .. package.cpath + +-- Client-lua and test common (relative to rollups) +package.path = package.path .. ";" .. rollups .. "/../common/?.lua;" .. rollups .. "/../../client-lua/?.lua" diff --git a/prt/tests/rollups/test_cases/simple.lua b/prt/tests/rollups/test_cases/simple.lua index bfdb3026..269a4855 100755 --- a/prt/tests/rollups/test_cases/simple.lua +++ b/prt/tests/rollups/test_cases/simple.lua @@ -5,7 +5,7 @@ local env = require "test_env" -- Main Execution -env.spawn_blockchain {env.sample_inputs[1]} +env.spawn_blockchain { env.sample_inputs[1] } local first_epoch = assert(env.reader:read_epochs_sealed()[1]) assert(first_epoch.input_upper_bound == 1) -- there's one input for epoch 0 already! diff --git a/prt/tests/rollups/test_env.lua b/prt/tests/rollups/test_env.lua index e6ca8a85..56b18c41 100644 --- a/prt/tests/rollups/test_env.lua +++ b/prt/tests/rollups/test_env.lua @@ -56,10 +56,12 @@ function Env.spawn_blockchain(inputs) local blockchain = Blockchain:new(ANVIL_LOAD_PATH, ANVIL_DUMP_PATH) Env.blockchain = blockchain - Env.reader = Reader:new(INPUT_BOX_ADDRESS, DAVE_APP_FACTORY_ADDRESS, TEMPLATE_MACHINE_HASH, SALT, blockchain.endpoint) + Env.reader = Reader:new(INPUT_BOX_ADDRESS, DAVE_APP_FACTORY_ADDRESS, TEMPLATE_MACHINE_HASH, SALT, blockchain + .endpoint) Env.app_address = Env.reader.app_address Env.consensus_address = Env.reader.consensus_address - Env.sender = Sender:new(INPUT_BOX_ADDRESS, DAVE_APP_FACTORY_ADDRESS, Env.app_address, blockchain.pks[1], blockchain.endpoint) + Env.sender = Sender:new(INPUT_BOX_ADDRESS, DAVE_APP_FACTORY_ADDRESS, Env.app_address, blockchain.pks[1], + blockchain.endpoint) Env.sender:tx_add_inputs(inputs) Env.sender:tx_new_dave_app(TEMPLATE_MACHINE_HASH, SALT) Env.sender:advance_blocks(2)