Skip to content

Commit

Permalink
Merge branch 'main' into bridge-template
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey authored Nov 23, 2022
2 parents a3b60bf + 60574d0 commit d72d5d5
Show file tree
Hide file tree
Showing 19 changed files with 344 additions and 61 deletions.
70 changes: 70 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
"doc"
]
},
{
"login": "davidtaikocha",
"name": "David",
"avatar_url": "https://avatars.githubusercontent.com/u/104078303?v=4",
"profile": "https://github.com/davidtaikocha",
"contributions": [
"doc",
"code"
]
},
{
"login": "dantaik",
"name": "dantaik",
Expand All @@ -24,6 +34,66 @@
"doc",
"code"
]
},
{
"login": "cyberhorsey",
"name": "cyberhorsey",
"avatar_url": "https://avatars.githubusercontent.com/u/113397187?v=4",
"profile": "https://github.com/cyberhorsey",
"contributions": [
"doc",
"code"
]
},
{
"login": "RogerLamTd",
"name": "RogerLamTd",
"avatar_url": "https://avatars.githubusercontent.com/u/50648015?v=4",
"profile": "https://github.com/RogerLamTd",
"contributions": [
"doc",
"code"
]
},
{
"login": "alexshliu",
"name": "alexshliu",
"avatar_url": "https://avatars.githubusercontent.com/u/104080237?v=4",
"profile": "https://github.com/alexshliu",
"contributions": [
"doc",
"code"
]
},
{
"login": "kirataik",
"name": "kirataik",
"avatar_url": "https://avatars.githubusercontent.com/u/104244966?v=4",
"profile": "https://github.com/kirataik",
"contributions": [
"doc",
"code"
]
},
{
"login": "mfinestone",
"name": "mfinestone",
"avatar_url": "https://avatars.githubusercontent.com/u/36642873?v=4",
"profile": "https://github.com/mfinestone",
"contributions": [
"business",
"content"
]
},
{
"login": "shadab-taiko",
"name": "shadab-taiko",
"avatar_url": "https://avatars.githubusercontent.com/u/108871478?v=4",
"profile": "https://github.com/shadab-taiko",
"contributions": [
"doc",
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
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.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
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.
35 changes: 27 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- BADGES -->
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![Solidity](https://github.com/taikoxyz/taiko-mono/actions/workflows/solidity.yml/badge.svg)](https://github.com/taikoxyz/taiko-mono/actions/workflows/solidity.yml)
Expand All @@ -20,20 +22,29 @@
<h3>TAIKO</h3>

<p>
A decentralized Ethereum equivalent ZK rollup
A decentralized Ethereum-equivalent ZK-Rollup
<br />
<a href="https://taiko.xyz" target="_blank"><strong>Explore the website »</strong></a>
<br />
</p>
</div>

## Packages

- [branding](./packages/branding/): branding materials
- [protocol](./packages/protocol/): L1 and L2 smart contracts
- [relayer](./packages/relayer/): bridge relayer
- [website](./packages/website/): main documentation website
- [whitepaper](./packages/whitepaper): Latex source files for Taiko's whitepaper. A PDF will be published automatically to: https://taikoxyz.github.io/taiko-mono/taiko-whitepaper.pdf (linked from https://taiko.xyz).
## Project structure

<pre>
taiko-mono
├── <a href="./CONTRIBUTING.md">CONTRIBUTING.md</a>
├── <a href="./README.md">README.md</a>
...
├── <a href="./packages">packages</a>
│ ├── <a href="./packages/branding">branding</a>: Taiko branding materials
│ ├── <a href="./packages/bridge-frontend">bridge-frontend</a>: Bridge frontend UI
│ ├── <a href="./packages/protocol">protocol</a>: L1 and L2 protocol smart contracts
│ ├── <a href="./packages/relayer">relayer</a>: Bridge relayer
│ ├── <a href="./packages/website">website</a>: Main documentation website at taiko.xyz
│ └── <a href="./packages/whitepaper">whitepaper</a>: Whitepaper source files with automated publishing
...
</pre>

## Contributing guide

Expand All @@ -46,14 +57,22 @@ Each commit will automatically trigger the GitHub Actions to run. If any commit
## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center"><a href="https://github.com/d1onys1us"><img src="https://avatars.githubusercontent.com/u/13951458?v=4?s=100" width="100px;" alt="d1onys1us"/><br /><sub><b>d1onys1us</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=d1onys1us" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/davidtaikocha"><img src="https://avatars.githubusercontent.com/u/104078303?v=4?s=100" width="100px;" alt="David"/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=davidtaikocha" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=davidtaikocha" title="Code">💻</a></td>
<td align="center"><a href="http://taiko.xyz"><img src="https://avatars.githubusercontent.com/u/99078276?v=4?s=100" width="100px;" alt="dantaik"/><br /><sub><b>dantaik</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=dantaik" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=dantaik" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/cyberhorsey"><img src="https://avatars.githubusercontent.com/u/113397187?v=4?s=100" width="100px;" alt="cyberhorsey"/><br /><sub><b>cyberhorsey</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=cyberhorsey" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=cyberhorsey" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/RogerLamTd"><img src="https://avatars.githubusercontent.com/u/50648015?v=4?s=100" width="100px;" alt="RogerLamTd"/><br /><sub><b>RogerLamTd</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=RogerLamTd" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=RogerLamTd" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/alexshliu"><img src="https://avatars.githubusercontent.com/u/104080237?v=4?s=100" width="100px;" alt="alexshliu"/><br /><sub><b>alexshliu</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=alexshliu" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=alexshliu" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/kirataik"><img src="https://avatars.githubusercontent.com/u/104244966?v=4?s=100" width="100px;" alt="kirataik"/><br /><sub><b>kirataik</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=kirataik" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=kirataik" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/mfinestone"><img src="https://avatars.githubusercontent.com/u/36642873?v=4?s=100" width="100px;" alt="mfinestone"/><br /><sub><b>mfinestone</b></sub></a><br /><a href="#business-mfinestone" title="Business development">💼</a> <a href="#content-mfinestone" title="Content">🖋</a></td>
<td align="center"><a href="https://github.com/shadab-taiko"><img src="https://avatars.githubusercontent.com/u/108871478?v=4?s=100" width="100px;" alt="shadab-taiko"/><br /><sub><b>shadab-taiko</b></sub></a><br /><a href="https://github.com/taikoxyz/taiko-mono/commits?author=shadab-taiko" title="Documentation">📖</a> <a href="https://github.com/taikoxyz/taiko-mono/commits?author=shadab-taiko" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
Empty file modified packages/branding/Logo/PNG/Taiko_Favicon_Fluo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions packages/branding/README.md
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.
1 change: 1 addition & 0 deletions packages/protocol/contracts/L1/LibData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ library LibData {
mapping(uint256 => mapping(bytes32 => ForkChoice)) forkChoices;
mapping(bytes32 => uint256) commits;
mapping(address => bool) provers; // Whitelisted provers
uint64 statusBits;
uint64 genesisHeight;
uint64 latestVerifiedHeight;
uint64 latestVerifiedId;
Expand Down
48 changes: 33 additions & 15 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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]>
Expand All @@ -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,
Expand Down Expand Up @@ -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
);
}

Expand All @@ -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
);
}

Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions packages/protocol/contracts/L1/v1/V1Events.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ abstract contract V1Events {
);

event ProverWhitelisted(address indexed prover, bool whitelisted);

event Halted(bool halted);
}
Loading

0 comments on commit d72d5d5

Please sign in to comment.