Docs
Reference
Contract documentation
common
ICrossChainSync

ICrossChainSync

This interface is implemented by both the TaikoL1 and TaikoL2 contracts. It outlines the essential methods required for synchronizing and accessing block hashes across chains. The core idea is to ensure that data between both chains remain consistent and can be cross-referenced with integrity.

CrossChainSynced

event CrossChainSynced(uint64 srcHeight, bytes32 blockHash, bytes32 signalRoot)

Emitted when a block has been synced across chains.

Parameters

NameTypeDescription
srcHeightuint64The height (block id) that was synced.
blockHashbytes32The hash of the synced block.
signalRootbytes32The root hash representing cross-chain signals.

getCrossChainBlockHash

function getCrossChainBlockHash(uint64 blockId) external view returns (bytes32)

Fetches the hash of a block from the opposite chain.

Parameters

NameTypeDescription
blockIduint64The target block id. Specifying 0 retrieves the hash of the latest block.

Return Values

NameTypeDescription
[0]bytes32The hash of the desired block from the other chain.

getCrossChainSignalRoot

function getCrossChainSignalRoot(uint64 blockId) external view returns (bytes32)

Retrieves the root hash of the signal service storage for a given block from the opposite chain.

Parameters

NameTypeDescription
blockIduint64The target block id. Specifying 0 retrieves the root of the latest block.

Return Values

NameTypeDescription
[0]bytes32The root hash for the specified block's signal service.