forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 12
Espresso 1: Contracts #443
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
Closed
Closed
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
fdfc7e5
contracts-bedrock: add Espresso BatchAuthenticator and supporting infra
QuentinI 25f2234
Update packages/contracts-bedrock/src/L1/BatchAuthenticator.sol
QuentinI 8b76632
Remove stray path
QuentinI 97d4a34
Remove hardcoded Sepolia URL
QuentinI 857717f
Use OZ v5 in mock verifier
QuentinI 00d6510
Fix Codex's suggestion
QuentinI cabd2ee
Lower pragma
QuentinI 7ea3c59
Remove unrelated foundry.toml changes
QuentinI 5e4bcf8
scripts/checks: clean up exclude lists per PR review
QuentinI f84ac86
Fix re-initialization
QuentinI 6b85fa1
Add batcher address history
QuentinI a882446
contracts-bedrock: drop OZ TUP from espresso deploy
palango c8db328
Remove pause from BatchAuthenticator
QuentinI 8630695
Add a defensive check
QuentinI 353252f
test: add end-to-end dual-batcher switch test
QuentinI de02776
Fix tests
QuentinI 0ccf6ec
switchBatcher from toggle to a setter
QuentinI d9a4585
Use OZ Checkpoints for batcher history
QuentinI 3b4618a
contracts-bedrock: deploy espresso impls via vm.getCode, drop suppres…
QuentinI 4821ebe
Check batcher in Espresso mode
shenkeyao c67ab4d
regenerate snapshots for UnauthorizedEspressoBatcher error
QuentinI d2ed3bc
contracts-bedrock: wire espresso proxies to shared OP Stack ProxyAdmin
QuentinI 12048f9
add caller to BatchInfoAuthenticated event
QuentinI 9448a74
forge fmt
piersy 05fd400
Remove unused imports
piersy eeed5c2
Rename tests to fit test name convention
piersy 308f90f
op-chain-ops/script: resolve directory-qualified getCode artifact names
QuentinI 6fd5401
contracts-bedrock: fix semgrep checks-fast findings
QuentinI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
73 changes: 73 additions & 0 deletions
73
packages/contracts-bedrock/interfaces/L1/IBatchAuthenticator.sol
This file contains hidden or 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,73 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| import {IEspressoTEEVerifier} from "@espresso-tee-contracts/interface/IEspressoTEEVerifier.sol"; | ||
| import {ISystemConfig} from "interfaces/L1/ISystemConfig.sol"; | ||
|
|
||
| interface IBatchAuthenticator { | ||
| /// @notice Error thrown when an invalid address (zero address) is provided. | ||
| error InvalidAddress(address contract_); | ||
|
|
||
| /// @notice Error thrown when the fallback batcher caller does not match the expected address. | ||
| error UnauthorizedFallbackBatcher(address sender, address expected); | ||
|
|
||
| /// @notice Error thrown when `setEspressoBatcher` is called with the address | ||
| /// that is already the currently-active batcher. | ||
| error NoChange(address batcher); | ||
|
|
||
| /// @notice Error thrown when the Espresso TEE batcher caller does not match the configured espressoBatcher. | ||
| error UnauthorizedEspressoBatcher(address sender, address expected); | ||
|
|
||
| /// @notice Emitted when a batch info is authenticated. `caller` is the | ||
| /// address that invoked `authenticateBatchInfo`. | ||
| event BatchInfoAuthenticated(bytes32 commitment, address indexed caller); | ||
|
|
||
| /// @notice Emitted when a signer registration is initiated through this contract. | ||
| event SignerRegistrationInitiated(address indexed caller); | ||
|
|
||
| /// @notice Emitted when the Espresso batcher address is updated. `fromBlock` | ||
| /// is the L1 block number at which `newEspressoBatcher` becomes the | ||
| /// authorized batcher. | ||
| event EspressoBatcherUpdated( | ||
| address indexed oldEspressoBatcher, | ||
| address indexed newEspressoBatcher, | ||
| uint64 indexed fromBlock | ||
| ); | ||
|
|
||
| /// @notice Emitted when the active batcher is switched. | ||
| event BatcherSwitched(bool indexed activeIsEspresso); | ||
|
|
||
| function authenticateBatchInfo(bytes32 commitment, bytes memory _signature) external; | ||
|
|
||
| function espressoTEEVerifier() external view returns (IEspressoTEEVerifier); | ||
|
|
||
| function nitroValidator() external view returns (address); | ||
|
|
||
| function owner() external view returns (address); | ||
|
|
||
| /// @notice Returns the currently-active Espresso batcher address (the value of the | ||
| /// latest history entry). | ||
| function espressoBatcher() external view returns (address); | ||
|
|
||
| /// @notice Number of entries in the Espresso batcher history. | ||
| function espressoBatcherHistoryLength() external view returns (uint256); | ||
|
|
||
| /// @notice Returns the Espresso batcher history entry at `_index` | ||
| /// (oldest first). Reverts on out-of-bounds index. | ||
| function espressoBatcherAt(uint32 _index) external view returns (address batcher_, uint64 fromBlock_); | ||
|
|
||
| /// @notice Returns the Espresso batcher address that was authorized at | ||
| /// L1 block `_l1Block`. Returns `address(0)` if `_l1Block` precedes the first | ||
| /// entry. | ||
| function espressoBatcherAtBlock(uint64 _l1Block) external view returns (address); | ||
|
|
||
| function registerSigner(bytes memory verificationData, bytes memory data) external; | ||
|
|
||
| function activeIsEspresso() external view returns (bool); | ||
|
|
||
| function systemConfig() external view returns (ISystemConfig); | ||
|
|
||
| function setActiveIsEspresso(bool _desired) external; | ||
|
|
||
| function setEspressoBatcher(address _newEspressoBatcher) external; | ||
| } |
This file contains hidden or 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
Submodule espresso-tee-contracts
added at
bf6e60
1 change: 1 addition & 0 deletions
1
packages/contracts-bedrock/lib/openzeppelin-contracts-upgradeable-v5
Submodule openzeppelin-contracts-upgradeable-v5
added at
dd89be
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.