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
Name | Type | Description |
---|---|---|
srcHeight | uint64 | The height (block id) that was synced. |
blockHash | bytes32 | The hash of the synced block. |
signalRoot | bytes32 | The 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
Name | Type | Description |
---|---|---|
blockId | uint64 | The target block id. Specifying 0 retrieves the hash of the latest block. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | The 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
Name | Type | Description |
---|---|---|
blockId | uint64 | The target block id. Specifying 0 retrieves the root of the latest block. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bytes32 | The root hash for the specified block's signal service. |