From 9d039c55fbf1306a1426a6f9eb875e805d11609c Mon Sep 17 00:00:00 2001 From: Rodi-Can Bozman Date: Fri, 5 Dec 2025 17:01:35 +0100 Subject: [PATCH] Etherlink/IC: store header to allow apply blueprint to take over assemble block --- etherlink/kernel_latest/kernel/src/sub_block.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etherlink/kernel_latest/kernel/src/sub_block.rs b/etherlink/kernel_latest/kernel/src/sub_block.rs index a05c687e0f60..13d72e7b5b07 100644 --- a/etherlink/kernel_latest/kernel/src/sub_block.rs +++ b/etherlink/kernel_latest/kernel/src/sub_block.rs @@ -6,7 +6,7 @@ use crate::{ apply::{pure_fa_deposit, revm_run_transaction}, block::GAS_LIMIT, - block_storage, + block_storage, blueprint_storage, bridge::{execute_etherlink_deposit, DepositResult}, chains::{ChainConfigTrait, EvmChainConfig, ETHERLINK_SAFE_STORAGE_ROOT_PATH}, configuration::fetch_pure_evm_config, @@ -671,6 +671,13 @@ pub fn assemble_block( base_fee_per_gas, ); + // We need to store the block header in order for the evm node + // to be able to switch between [assemble_block] and [apply_blueprint]. + // If we don't do the following store instruction, the [apply_blueprint] + // will fail to fetch the current block number. + let header: blueprint_storage::BlockHeader<_> = sub_block.clone().into(); + blueprint_storage::store_current_block_header(host, &header)?; + block_storage::store_current( host, ÐERLINK_SAFE_STORAGE_ROOT_PATH, -- GitLab