Skip to content

Commit

Permalink
feat(protocol): make getInvocationDelays return non-zero values for b…
Browse files Browse the repository at this point in the history
…ase chains (#15968)
  • Loading branch information
dantaik committed Feb 21, 2024
1 parent d90e90a commit bb8aaf4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
31 changes: 18 additions & 13 deletions packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,24 @@ contract Bridge is EssentialContract, IBridge {
virtual
returns (uint256 invocationDelay, uint256 invocationExtraDelay)
{
// Only on the base layer (L1) should the returned values be non-zero.
// if (
// block.chainid == 1 // Ethereum mainnet
// || block.chainid == 2 // Ropsten
// || block.chainid == 4 // Rinkeby
// || block.chainid == 5 // Goerli
// || block.chainid == 42 // Kovan
// || block.chainid == 11_155_111 // Sepolia
// ) {
// return (6 hours, 15 minutes);
// }

return (0, 0);
if (
block.chainid == 1 // Ethereum mainnet
) {
// 384 seconds = 6.4 minutes = one ethereum epoch
return (6 hours, 384 seconds);
} else if (
block.chainid == 2 // Ropsten
|| block.chainid == 4 // Rinkeby
|| block.chainid == 5 // Goerli
|| block.chainid == 42 // Kovan
|| block.chainid == 17_000 // Holesky
|| block.chainid == 11_155_111 // Sepolia
) {
return (30 minutes, 384 seconds);
} else {
// This is a L2 chain where there is no delay in message executation.
return (0, 0);
}
}

/// @notice Hash the message
Expand Down
6 changes: 3 additions & 3 deletions packages/protocol/contracts/signal/SignalService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ contract SignalService is EssentialContract, ISignalService {
bytes[] storageProof;
}

mapping(uint64 chainId => mapping(bytes32 kind => uint64 blockId)) public topBlockId;
mapping(address => bool) public isAuthorized;
uint256[49] private __gap;
mapping(uint64 chainId => mapping(bytes32 kind => uint64 blockId)) public topBlockId; // slot 1
mapping(address => bool) public isAuthorized; // slot 2
uint256[48] private __gap;

event Authorized(address indexed addr, bool authrized);

Expand Down

0 comments on commit bb8aaf4

Please sign in to comment.