Assessment reports>SP1 Helios>Threat Model>Component: storage

Component: storage

The storage component manages the storage of accounts and requests, verifying their Merkle proofs against the root of each storage. It executes the state-transition function and updates the storage roots accordingly.

Inputs

  • storage (Vec<ContractStorage>): A vector of ContractStorage objects, which represent the storage data for the accounts and requests.

pub struct ContractStorage { pub address: Address, pub value: TrieAccount, /// The proof that this contracts storage root is correct pub mpt_proof: Vec, /// The storage slots that we want to prove pub storage_slots: Vec, } pub struct StorageSlotWithProof { pub key: B256, pub value: U256, /// The proof that this storage slot is correct pub mpt_proof: Vec, }
  • state_root (B256): The root of the storage state, which is used to verify the integrity of the storage data.

Outputs

  • proof_outputs (StorageProofOutputs): The output of the storage program, which contains the state root and the storage slots with their proofs. It is later passed as an argument to the updateStorageSlot function in the SP1Helios contract.

struct StorageProofOutputs { bytes32 stateRoot; StorageSlot[] storageSlots; }

Expected behavior

  • Invoke the verify_storage_slot_proofs function to verify the proofs of the storage slots.

  • Verify the contract's account node in the global MPT.

  • Verify the storage slots against the contract's storage root.

  • Generate the StorageProofOutputs with the verified state root and storage slots.

Zellic © 2025Back to top ↑