// StateOracle defines the high-level API used to retrieve L2 state data pre-images// The returned data is always the preimage of the requested hash.typeStateOracleinterface{// NodeByHash retrieves the merkle-patricia trie node pre-image for a given hash.// Trie nodes may be from the world state trie or any account storage trie.// Contract code is not stored as part of the trie and must be retrieved via CodeByHash// Returns an error if the pre-image is unavailable.NodeByHash(nodeHashcommon.Hash)([]byte,error)// CodeByHash retrieves the contract code pre-image for a given hash.// codeHash should be retrieved from the world state account for a contract.// Returns an error if the pre-image is unavailable.CodeByHash(codeHashcommon.Hash)([]byte,error)}
// Oracle defines the high-level API used to retrieve L2 data.// The returned data is always the preimage of the requested hash.typeOracleinterface{StateOracle// BlockByHash retrieves the block with the given hash.// Returns an error if the block is not available.BlockByHash(blockHashcommon.Hash)(*types.Block,error)}