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

feat(protocol): make getInvocationDelays return non-zero values for base chains #15968

Merged
merged 7 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
30 changes: 17 additions & 13 deletions packages/protocol/contracts/bridge/Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,23 @@ 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 == 11_155_111 // Sepolia
dantaik marked this conversation as resolved.
Show resolved Hide resolved
) {
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
Loading