Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol): fix and improve CrossChainSynced event #15202

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/protocol/contracts/L1/libs/LibVerifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ library LibVerifying {
);

event CrossChainSynced(
uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot
uint64 indexed syncedInBlock,
uint64 indexed blockId,
bytes32 blockHash,
bytes32 signalRoot
);

// Warning: Any errors defined here must also be defined in TaikoErrors.sol.
Expand Down Expand Up @@ -222,8 +225,8 @@ library LibVerifying {
blockId: blockId,
assignedProver: blk.assignedProver,
prover: ts.prover,
blockHash: ts.blockHash,
signalRoot: ts.signalRoot,
blockHash: blockHash,
signalRoot: signalRoot,
tier: ts.tier,
contestations: ts.contestations
});
Expand All @@ -244,7 +247,10 @@ library LibVerifying {
.sendSignal(signalRoot);

emit CrossChainSynced(
lastVerifiedBlockId, blockHash, signalRoot
uint64(block.number),
lastVerifiedBlockId,
blockHash,
signalRoot
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L2/TaikoL2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ contract TaikoL2 is Ownable2StepUpgradeable, TaikoL2Signer, ICrossChainSync {
// allow for multi-hop bridging.
ISignalService(signalService).sendSignal(l1SignalRoot);
emit CrossChainSynced(
l1Height, uint64(block.number), l1BlockHash, l1SignalRoot
uint64(block.number), l1Height, l1BlockHash, l1SignalRoot
);

// Update state variables
Expand Down
8 changes: 4 additions & 4 deletions packages/protocol/contracts/common/ICrossChainSync.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ interface ICrossChainSync {
}

/// @dev Emitted when a block has been synced across chains.
/// @param remoteBlockId The ID of the remote block whose block hash and
/// signal root are synced.
/// @param syncedInBlock The ID of this chain's block where the sync
/// happened.
/// @param blockId The ID of the remote block whose block hash and
/// signal root are synced.
/// @param blockHash The hash of the synced block.
/// @param signalRoot The root hash representing cross-chain signals.
event CrossChainSynced(
uint64 indexed remoteBlockId,
uint64 syncedInBlock,
uint64 indexed syncedInBlock,
uint64 indexed blockId,
bytes32 blockHash,
bytes32 signalRoot
);
Expand Down