# EPF - Update 8 & 9 ## tl;dr * Opened PR: [0xprivateChaos/grandine-zk#1](https://github.com/0xprivateChaos/grandine-zk/pull/1) * Added a **guest** **program** for Zisk under `guest/zisk/` * Implemented logic in `build.rs` to serialize and write **BeaconState** and **SignedBeaconBlock** into `build/input.bin` * The guest program now reads from `build/input.bin` for execution ## Details The guest program (`main.rs`) performs the following steps: 1. Reads serialized input (`BeaconState` + `SignedBeaconBlock`). 2. Loads configuration using `Config::pectra_devnet_6()`. 3. Calls `read_block_and_state()` to deserialize state, block, and cache. 4. Executes `state_transition()` to update the beacon state. 5. Computes the resulting state root using `hash_tree_root()`. 6. Writes the state root to the output, 4 bytes at a time. ```rust fn main() { let input = read_input(); let config = Config::pectra_devnet_6(); let (block, mut state, cache) = read_block_and_state::<Mainnet>(&config, &input).expect("Failed to read input"); state_transition(&config, &cache, &mut state, &block).expect("State transition failed"); let root = state.hash_tree_root(); for i in 0..8 { let word = u32::from_le_bytes(root.0[i * 4..(i + 1) * 4].try_into().unwrap()); set_output(i, word); } } ``` ### Current Status * Building guest program manually using: ``` cargo-zisk build --release ``` * Hitting a **linter error**, which needs to be fixed before moving forward. ## Next Week * Connect **host** and **guest** so they work together end-to-end.