Skip to content

Commit

Permalink
Merge branch 'gas_price' of github.com:taikoxyz/taiko-mono into gas_p…
Browse files Browse the repository at this point in the history
…rice
  • Loading branch information
cyberhorsey committed Mar 28, 2023
2 parents 8f8804f + 5f6a5b6 commit 3497871
Show file tree
Hide file tree
Showing 40 changed files with 68 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report 🐛
description: Report a bug
title: "fix: INSERT_DESCRIPTIVE_TITLE"
title: "fix: <insert descriptive title here>"
labels: ["bug", "triage"]
body:
- type: markdown
Expand Down
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Community support
url: https://discord.gg/taikoxyz
about: This issue tracker is only for feature requests and bug reports. Community support is available on Discord!
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request 💡
description: Request a feature
title: "feat: INSERT_DESCRIPTIVE_TITLE"
title: "feat: <insert descriptive title here>"
labels: ["feat", "triage"]
body:
- type: markdown
Expand Down
21 changes: 12 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

Here are some ways you can contribute:

- Open a new issue [here](https://github.com/taikoxyz/taiko-mono/issues).
- Open a new issue [here](https://github.com/taikoxyz/taiko-mono/issues) (please check the issue does not already exist).
- Work on an existing issue (check out the [good first issues list](https://github.com/taikoxyz/taiko-mono/labels/good%20first%20issue)).

> Check out the [coding standards](#coding-standards) and [documentation standards](#documentation-standards) before you start working on a pull request.
Expand All @@ -26,9 +26,11 @@ After your pull request is merged, a bot will automatically leave a comment with

### Pull requests

Specify the scope of your change with a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) in the PR title (for example, `feat(scope): description of feature`). This will be squashed and merged into the `main` branch.
Specify the scope of your change with a [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) in the PR title (for example, `feat(scope): description of feature`). This will be squashed and merged into the `main` branch. You can find the full list of allowed scopes [here](https://github.com/taikoxyz/taiko-mono/blob/main/.github/workflows/lint-pr.yml#L19).

Because we squash all of the changes into a single commit, please try to keep the PR limited to the scope specified in the commit message. This commit message will end up in the automated changelog by checking which packages are affected by the commit. For example, `feat(scope): description of feature` should only impact the `scope` package. If your change is a global one, you can use `feat: description of feature`, for example.
Because we squash all of the changes into a single commit, please try to keep the PR limited to the scope specified in the commit message. This commit message will end up in the automated changelog by checking which packages are affected by the commit.

For example, `feat(scope): description of feature` should only impact the `scope` package. If your change is a global one, you can use `feat: description of feature`, for example.

### Source code comments

Expand All @@ -40,7 +42,7 @@ Follow the [NatSpec format](https://docs.soliditylang.org/en/latest/natspec-form

# Documentation standards

Use the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/) as a base point of reference.
Use the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/) as a base point of reference for writing style.

### Philosophy

Expand All @@ -52,12 +54,13 @@ Use the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-

Group documentation under one of the four categories (adopted from [Diátaxis](https://diataxis.fr/)):

- How to
- Concepts
- Tutorials
- Guides
- Reference
- Resources

### Creating content

### Images
If you are interested in creating some content (video, blog post, tweet thread, visuals, etc.), you are absolutely free to do so. It's useful to get a peer review on these, if you need a peer review please reach out to the community / team on the [Taiko Discord](https://discord.gg/taikoxyz).

- Use SVG files or crushed PNG images.
- Provide alt text.
If you are looking for some more guidance on creating content, you can consult the [Taiko content guide](https://hackmd.io/@taikolabs/BJurgF1bn).
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</h1>

<p align="center">
A decentralized, Ethereum-equivalent ZK-Rollup.
A fully decentralized, Ethereum-equivalent ZK-Rollup.
<br />
<a href="https://taiko.xyz" target="_blank"><strong>Explore the website</strong></a>
</p>
Expand All @@ -17,15 +17,7 @@
[![Twitter Follow](https://img.shields.io/twitter/follow/taikoxyz?style=social)](https://twitter.com/taikoxyz)
[![Discord](https://img.shields.io/discord/984015101017346058?color=%235865F2&label=Discord&logo=discord&logoColor=%23fff)](https://discord.gg/taikoxyz)
[![GitPOAP Badge](https://public-api.gitpoap.io/v1/repo/taikoxyz/taiko-mono/badge)](https://www.gitpoap.io/gh/taikoxyz/taiko-mono)

[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/taikoxyz/taiko-mono/protocol.yml?branch=main&label=Protocol&logo=github)](https://github.com/taikoxyz/taiko-mono/actions/workflows/protocol.yml)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/taikoxyz/taiko-mono/relayer.yml?branch=main&label=Relayer&logo=github)](https://github.com/taikoxyz/taiko-mono/actions/workflows/relayer.yml)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/taikoxyz/taiko-mono/bridge-ui.yml?branch=main&label=Bridge%20UI&logo=github)](https://github.com/taikoxyz/taiko-mono/actions/workflows/bridge-ui.yml)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/taikoxyz/taiko-mono/website.yml?branch=main&label=Website&logo=github)](https://github.com/taikoxyz/taiko-mono/actions/workflows/website.yml)

[![Codecov](https://img.shields.io/codecov/c/github/taikoxyz/taiko-mono?flag=protocol&label=Protocol&logo=codecov&token=E468X2PTJC)](https://app.codecov.io/gh/taikoxyz/taiko-mono/tree/main/packages/protocol)
[![Codecov](https://img.shields.io/codecov/c/github/taikoxyz/taiko-mono?flag=relayer&label=Relayer&logo=codecov&token=E468X2PTJC)](https://app.codecov.io/gh/taikoxyz/taiko-mono/tree/main/packages/relayer)
[![Codecov](https://img.shields.io/codecov/c/github/taikoxyz/taiko-mono?flag=bridge-ui&label=Bridge%20UI&logo=codecov&token=E468X2PTJC)](https://app.codecov.io/gh/taikoxyz/taiko-mono/tree/main/packages/bridge-ui)
[![License](https://img.shields.io/github/license/taikoxyz/taiko-mono)](https://github.com/taikoxyz/taiko-mono/blob/main/LICENSE.md)

</div>

Expand All @@ -36,11 +28,11 @@ Most documentation can be found on the website, at [taiko.xyz](https://taiko.xyz
## Project structure

<pre>
taiko-mono
taiko-mono/
├── <a href="./CHANGELOG.md">CHANGELOG.md</a>
├── <a href="./CONTRIBUTING.md">CONTRIBUTING.md</a>
├── <a href="./LICENSE.md">LICENSE.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-ui">bridge-ui</a>: Taiko Bridge frontend UI
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
);
successToast('Transaction completed!');
let s = store;
s = s.slice(confirmedPendingTxIndex, 0);
s.splice(confirmedPendingTxIndex, 1);
pendingTransactions.set(s);
})();
});
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/src/bridge/ERC20Bridge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ describe('bridge tests', () => {
srcBridgeAddress: '0x',
destBridgeAddress: '0x',
signer: wallet,
destProvider: new ethers.providers.JsonRpcProvider(),
destProvider: new ethers.providers.StaticJsonRpcProvider(),
srcTokenVaultAddress: '0x',
}),
).rejects.toThrowError('message already processed');
Expand Down Expand Up @@ -462,7 +462,7 @@ describe('bridge tests', () => {
srcBridgeAddress: '0x',
destBridgeAddress: '0x',
signer: wallet,
destProvider: new ethers.providers.JsonRpcProvider(),
destProvider: new ethers.providers.StaticJsonRpcProvider(),
srcTokenVaultAddress: '0x',
});

Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/src/bridge/ETHBridge.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ describe('bridge tests', () => {
srcBridgeAddress: '0x',
destBridgeAddress: '0x',
signer: wallet,
destProvider: new ethers.providers.JsonRpcProvider(),
destProvider: new ethers.providers.StaticJsonRpcProvider(),
srcTokenVaultAddress: '0x',
}),
).rejects.toThrowError('message already processed');
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('bridge tests', () => {
srcBridgeAddress: '0x',
destBridgeAddress: '0x',
signer: wallet,
destProvider: new ethers.providers.JsonRpcProvider(),
destProvider: new ethers.providers.StaticJsonRpcProvider(),
srcTokenVaultAddress: '0x',
});

Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/src/components/Transaction.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@
providers[chains[transaction.toChainId].id],
);
transaction.status = await contract.getMessageStatus(transaction.msgHash);
if (transaction.receipt && transaction.receipt.status !== 1) {
clearInterval(interval);
return;
}
transaction.status = await contract.getMessageStatus(transaction.msgHash);
if (transaction.status === MessageStatus.Failed) {
if (transaction.message?.data !== '0x') {
const srcTokenVaultContract = new ethers.Contract(
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/proof/ProofService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const destChain = 31336;
const map = {
[srcChain]: mockProvider,
[destChain]: mockProvider,
} as unknown as Record<string, ethers.providers.JsonRpcProvider>;
} as unknown as Record<string, ethers.providers.StaticJsonRpcProvider>;

describe('prover tests', () => {
beforeEach(() => {
Expand Down
11 changes: 8 additions & 3 deletions packages/bridge-ui/src/proof/ProofService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ import type {
} from '../domain/proof';

export class ProofService implements Prover {
private readonly providers: Record<number, ethers.providers.JsonRpcProvider>;
private readonly providers: Record<
number,
ethers.providers.StaticJsonRpcProvider
>;

constructor(providers: Record<number, ethers.providers.JsonRpcProvider>) {
constructor(
providers: Record<number, ethers.providers.StaticJsonRpcProvider>,
) {
this.providers = providers;
}

Expand All @@ -29,7 +34,7 @@ export class ProofService implements Prover {

private static async getBlockAndBlockHeader(
contract: ethers.Contract,
provider: ethers.providers.JsonRpcProvider,
provider: ethers.providers.StaticJsonRpcProvider,
): Promise<{ block: Block; blockHeader: BlockHeader }> {
const latestSyncedHeader = await contract.getLatestSyncedHeader();

Expand Down
15 changes: 12 additions & 3 deletions packages/bridge-ui/src/provider/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import { ethers } from 'ethers';
import type { ChainID } from '../domain/chain';
import { L1_CHAIN_ID, L1_RPC, L2_CHAIN_ID, L2_RPC } from '../constants/envVars';

export const providers: Record<ChainID, ethers.providers.JsonRpcProvider> = {
[L1_CHAIN_ID]: new ethers.providers.JsonRpcProvider(L1_RPC),
[L2_CHAIN_ID]: new ethers.providers.JsonRpcProvider(L2_RPC),
export const providers: Record<
ChainID,
ethers.providers.StaticJsonRpcProvider
> = {
[L1_CHAIN_ID]: new ethers.providers.StaticJsonRpcProvider(
L1_RPC,
L1_CHAIN_ID,
),
[L2_CHAIN_ID]: new ethers.providers.StaticJsonRpcProvider(
L2_RPC,
L2_CHAIN_ID,
),
};
7 changes: 5 additions & 2 deletions packages/bridge-ui/src/relayer-api/RelayerAPIService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ import { tokenVaults } from '../vault/tokenVaults';
import type { ChainID } from '../domain/chain';

export class RelayerAPIService implements RelayerAPI {
private readonly providers: Record<ChainID, ethers.providers.JsonRpcProvider>;
private readonly providers: Record<
ChainID,
ethers.providers.StaticJsonRpcProvider
>;
private readonly baseUrl: string;

constructor(
baseUrl: string,
providers: Record<ChainID, ethers.providers.JsonRpcProvider>,
providers: Record<ChainID, ethers.providers.StaticJsonRpcProvider>,
) {
this.providers = providers;

Expand Down
7 changes: 5 additions & 2 deletions packages/bridge-ui/src/storage/StorageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ import type { ChainID } from '../domain/chain';

export class StorageService implements Transactioner {
private readonly storage: Storage;
private readonly providers: Record<ChainID, ethers.providers.JsonRpcProvider>;
private readonly providers: Record<
ChainID,
ethers.providers.StaticJsonRpcProvider
>;

constructor(
storage: Storage,
providers: Record<ChainID, ethers.providers.JsonRpcProvider>,
providers: Record<ChainID, ethers.providers.StaticJsonRpcProvider>,
) {
this.storage = storage;
this.providers = providers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Token } from '../domain/token';

export const checkIfTokenIsDeployedCrossChain = async (
token: Token,
provider: ethers.providers.JsonRpcProvider,
provider: ethers.providers.StaticJsonRpcProvider,
destTokenVaultAddress: string,
toChain: Chain,
fromChain: Chain,
Expand Down
3 changes: 0 additions & 3 deletions packages/protocol/solidity-docgen/templates/contract.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
---
title: {{name}}
---
{{>common}}

{{#each items}}
Expand Down
4 changes: 3 additions & 1 deletion packages/website/pages/docs/guides/enable-a-prover.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Callout, Steps } from "nextra-theme-docs";

<Callout>
Only the first prover can get the reward, and others will be rejected by the protocol smart contract. This means the fastest prover will be able to prove the block and earn the reward, **if you have just the minimum hardware outlined in the prerequisited below, it's unlikely you will be able to prove any blocks if there are many other high-performance provers**.
Only the first prover can get the reward, and others will be rejected by the protocol smart contract. This means the fastest prover will be able to prove the block and earn the reward, **if you have just the minimum hardware outlined in the prerequisited below, running a single prover, it's unlikely you will be able to prove any blocks (because you will be competing against other high-performance provers)**.

Meaning, if you do not have a powerful prover, the primary purpose of running a prover is to help test out and provide community feedback on running the node software. Keep in mind this will have a cost in electricity on your computer, and if you are not proving blocks, it's unlikely you will receive a reward to offset that electricity cost.
</Callout>


Expand Down
2 changes: 1 addition & 1 deletion packages/website/pages/docs/guides/run-a-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Finally, set the following environment variables:

<Callout>
You can get a Sepolia L1 endpoint from a few places,
[Alchemy](https://www.alchemy.com/) is one popular example.
[Alchemy](https://www.alchemy.com/) and [Infura](https://www.infura.io/) are two popular RPC providers. **Make sure you select the RPC as Sepolia testnet, and not Ethereum mainnet**.
</Callout>

### Enable your node as a prover (optional)
Expand Down
2 changes: 1 addition & 1 deletion packages/website/pages/docs/guides/swap-tokens.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Steps } from "nextra-theme-docs";

This guide will you help you interact with Swap, which is a fork of Uniswap v2 which Taiko has deployed only for testing purposes.
This guide will help you interact with Swap, which is a fork of Uniswap v2 which Taiko has deployed only for testing purposes.

> The HORSE token and BLL token are both dummy test tokens that are used for testing the bridge and swap.
Expand Down
2 changes: 2 additions & 0 deletions packages/website/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Taiko is a fully decentralized, Ethereum-equivalent ZK-Rollup ([Type 1 ZK-EVM](https://mirror.xyz/labs.taiko.eth/w7NSKDeKfJoEy0p89I9feixKfdK-20JgWF9HZzxfeBo)). Taiko is working on the full Ethereum [ZK-EVM circuits](https://github.com/privacy-scaling-explorations/zkevm-circuits) as part of a community effort led by the EF's PSE team.

Check the Taiko Roadmap [here](/images/roadmaps/taiko-roadmap.png).

## Use the Askja testnet

All the fun tasks can be found under [guides](/docs/guides). Read the full [blog post](https://mirror.xyz/labs.taiko.eth/A6G6TNN-CXDAhl42k_bNHg_20fyGcT0xH-LBBSOPNzU) for more details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: IProofVerifier
---

## IProofVerifier

### verifyZKP
Expand All @@ -16,10 +12,6 @@ function verifyZKP(string verifierId, bytes zkproof, bytes32 instance) external
function verifyMKP(bytes key, bytes value, bytes proof, bytes32 root) external pure returns (bool verified)
```

---

## title: ProofVerifier

## ProofVerifier

### init
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoCustomErrors
---

## TaikoCustomErrors

### L1_0_FEE_BASE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoData
---

## TaikoData

### Config
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoEvents
---

## TaikoEvents

### BlockVerified
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoL1
---

## TaikoL1

### state
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoToken
---

## TaikoToken

_This is Taiko's governance and fee token._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: TaikoL2
---

## TaikoL2

### latestSyncedL1Height
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: Bridge
---

## Bridge

Bridge contract which is deployed on both L1 and L2. Mostly a thin wrapper
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
title: BridgeErrors
---

## BridgeErrors

### B_CANNOT_RECEIVE
Expand Down
Loading

0 comments on commit 3497871

Please sign in to comment.