forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add preconf from taiko-mono helder branch
- Loading branch information
Keszey Dániel
authored and
Keszey Dániel
committed
Jul 3, 2024
1 parent
af3743d
commit 346959e
Showing
9 changed files
with
131 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/protocol/contracts/L1/preconfs/ISequencerRegistry.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
/// @title ISequencerRegistry | ||
/// @custom:security-contact [email protected] | ||
interface ISequencerRegistry { | ||
/// @notice Return true if the specified address can propose blocks, false otherwise | ||
/// @param _proposer The address proposing a block | ||
function isEligibleSigner(address _proposer) external returns (bool); | ||
} |
50 changes: 50 additions & 0 deletions
50
packages/protocol/contracts/L1/preconfs/SequencerRegistry.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import "../../common/EssentialContract.sol"; | ||
import "./ISequencerRegistry.sol"; | ||
|
||
/// @title SequencerRegistry | ||
/// A dummy implementation that only whitelist some trusted addresses. A real | ||
/// implementation would only allow a single proposer address to propose a block | ||
/// using some selection mechanism. | ||
/// @custom:security-contact [email protected] | ||
contract SequencerRegistry is EssentialContract, ISequencerRegistry { | ||
/// @dev Emitted when the status of a sequencer is updated. | ||
/// @param sequencer The address of the sequencer whose state has updated. | ||
/// @param enabled If the sequencer is now enabled or not. | ||
event SequencerUpdated(address indexed sequencer, bool enabled); | ||
|
||
/// @notice Whitelisted sequencers | ||
mapping(address sequencer => bool enabled) public sequencers; | ||
|
||
uint256[49] private __gap; | ||
|
||
/// @notice Initializes the contract with the provided address manager. | ||
/// @param _owner The address of the owner. | ||
function init(address _owner) external initializer { | ||
__Essential_init(_owner); | ||
} | ||
|
||
/// @notice Sets/unsets an the imageId as trusted entity | ||
/// @param _sequencers The list of sequencers | ||
/// @param _enabled The corresponding list of the new status of the sequencers | ||
function setSequencers( | ||
address[] memory _sequencers, | ||
bool[] memory _enabled | ||
) | ||
external | ||
onlyOwner | ||
{ | ||
require(_sequencers.length == _enabled.length, "invalid input data"); | ||
for (uint256 i = 0; i < _sequencers.length; i++) { | ||
sequencers[_sequencers[i]] = _enabled[i]; | ||
emit SequencerUpdated(_sequencers[i], _enabled[i]); | ||
} | ||
} | ||
|
||
/// @inheritdoc ISequencerRegistry | ||
function isEligibleSigner(address _proposer) external view returns (bool) { | ||
return sequencers[_proposer]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
{} | ||
{ | ||
"address_manager": "0x19A827174F66B3c66ad7063951D7b4F94f996e77", | ||
"bridge": "0x1a76F7BA873f90805B49A51cBA617E699Cf142B0", | ||
"erc721_vault": "0x9D46a79Ad6e0dcb36AbAb982e608e186E6826b7C", | ||
"signal_service": "0x798684a55404079b77E19A86325e0c11eA5BB09D" | ||
} |