-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bridge-template
- Loading branch information
Showing
19 changed files
with
344 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Bug report 🐛 | ||
description: Report a bug | ||
title: "[Bug] <insert descriptive title>" | ||
labels: ["bug", "triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Before submitting, please check if an existing issue already exists. Thanks for taking the time to improve Taiko! | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Describe the bug | ||
description: A concise description of the problem and what you expected to happen. | ||
value: Description of the bug here. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: steps-to-reproduce | ||
attributes: | ||
label: Steps to reproduce | ||
description: Steps to reproduce the bug, a numbered list could be good. | ||
value: Steps to reproduce here. | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context | ||
description: Provide any additional context, screenshots, etc. | ||
value: Additional context here. |
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,29 @@ | ||
name: Feature request 💡 | ||
description: Request a feature | ||
title: "[Feat] <insert descriptive title>" | ||
labels: ["feat", "triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Before submitting, please check if an existing issue already exists. Thanks for taking the time to improve Taiko! | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Describe the feature request | ||
description: A concise description of what the problem and proposed solution is. | ||
value: Description of the feature request here. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: alternatives | ||
attributes: | ||
label: Describe alternatives you've considered | ||
description: A concise description of any alternative solutions you've considered. | ||
value: Description of the alternatives you've considered here. | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context | ||
description: Provide any additional context, screenshots, etc. | ||
value: Additional context here. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,11 @@ | ||
# Taiko branding | ||
|
||
This package contains all you need for Taiko branding. | ||
|
||
## Naming | ||
|
||
For naming, we use Taiko or Taiko Labs. For the handle, we refer to Taiko with `taikoxyz`, which is where you can find us (ie. twitter: @taikoxyz, github: @taikoxyz). Please maintain this convention. | ||
|
||
## Logos | ||
|
||
Use SVG and PNG where you can, as the image quality is better. |
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 |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
// ╱╱╰╯╰╯╰┻┻╯╰┻━━╯╰━━━┻╯╰┻━━┻━━╯ | ||
pragma solidity ^0.8.9; | ||
|
||
import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol"; | ||
|
||
import "../common/ConfigManager.sol"; | ||
import "../common/EssentialContract.sol"; | ||
import "../common/IHeaderSync.sol"; | ||
|
@@ -17,7 +19,7 @@ import "./v1/V1Events.sol"; | |
import "./v1/V1Finalizing.sol"; | ||
import "./v1/V1Proposing.sol"; | ||
import "./v1/V1Proving.sol"; | ||
import "@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol"; | ||
import "./v1/V1Utils.sol"; | ||
|
||
/** | ||
* @author dantaik <[email protected]> | ||
|
@@ -28,7 +30,7 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
using SafeCastUpgradeable for uint256; | ||
|
||
LibData.State public state; | ||
uint256[44] private __gap; | ||
uint256[43] private __gap; | ||
|
||
function init( | ||
address _addressManager, | ||
|
@@ -73,7 +75,8 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
V1Proposing.proposeBlock(state, inputs); | ||
V1Finalizing.verifyBlocks( | ||
state, | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX, | ||
false | ||
); | ||
} | ||
|
||
|
@@ -99,7 +102,8 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
V1Proving.proveBlock(state, AddressResolver(this), blockIndex, inputs); | ||
V1Finalizing.verifyBlocks( | ||
state, | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX, | ||
false | ||
); | ||
} | ||
|
||
|
@@ -117,7 +121,6 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
* on L2. Note that the `invalidBlock` transaction is supposed to | ||
* be the only transaction in the L2 block. | ||
*/ | ||
|
||
function proveBlockInvalid( | ||
uint256 blockIndex, | ||
bytes[] calldata inputs | ||
|
@@ -130,12 +133,21 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
); | ||
V1Finalizing.verifyBlocks( | ||
state, | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX | ||
LibConstants.TAIKO_MAX_VERIFICATIONS_PER_TX, | ||
false | ||
); | ||
} | ||
|
||
/** | ||
* Add or remove a prover from the whitelist. | ||
* Verify up to N blocks. | ||
* @param maxBlocks Max number of blocks to verify. | ||
*/ | ||
function verifyBlocks(uint256 maxBlocks) external nonReentrant { | ||
require(maxBlocks > 0, "L1:maxBlocks"); | ||
V1Finalizing.verifyBlocks(state, maxBlocks, true); | ||
} | ||
|
||
/* Add or remove a prover from the whitelist. | ||
* | ||
* @param prover The prover to be added or removed. | ||
* @param whitelisted True to add; remove otherwise. | ||
|
@@ -148,7 +160,15 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
} | ||
|
||
/** | ||
* Return whether a prover is whitelisted. | ||
* Halt or resume the chain. | ||
* @param toHalt True to halt, false to resume. | ||
*/ | ||
function halt(bool toHalt) public onlyOwner { | ||
V1Utils.halt(state, toHalt); | ||
} | ||
|
||
/** | ||
* Check whether a prover is whitelisted. | ||
* | ||
* @param prover The prover. | ||
* @return True if the prover is whitelisted, false otherwise. | ||
|
@@ -157,14 +177,12 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events { | |
return V1Proving.isProverWhitelisted(state, prover); | ||
} | ||
|
||
|
||
/** | ||
* Verify up to N blocks. | ||
* @param maxBlocks Max number of blocks to verify. | ||
/** | ||
* Check if the L1 is halted. | ||
* @return True if halted, false otherwise. | ||
*/ | ||
function verifyBlocks(uint256 maxBlocks) external nonReentrant { | ||
require(maxBlocks > 0, "L1:maxBlocks"); | ||
V1Finalizing.verifyBlocks(state, maxBlocks); | ||
function isHalted() public view returns (bool) { | ||
return V1Utils.isHalted(state); | ||
} | ||
|
||
function isCommitValid(bytes32 hash) public view returns (bool) { | ||
|
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
Oops, something went wrong.