Skip to content

Commit

Permalink
Merge branch 'main' into hive_contracts_
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp authored Sep 19, 2024
2 parents e423ebc + fd1c039 commit 53547c4
Show file tree
Hide file tree
Showing 82 changed files with 739 additions and 1,268 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bridge-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docs-site--preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ on:

jobs:
deploy-docs-site-preview:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/docs-site--production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ on:

jobs:
deploy-docs-site-production:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/eventindexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
Expand All @@ -66,6 +69,9 @@ jobs:
runs-on: [arc-runner-set]

steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/fork-diff--preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ on:

jobs:
deploy-fork-diff-preview:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/fork-diff--production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ on:

jobs:
deploy-fork-diff-production:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nfts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
38 changes: 34 additions & 4 deletions .github/workflows/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Prepare environment
run: sudo apt-get update && sudo apt-get install -y git nc

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand All @@ -38,10 +41,6 @@ jobs:
working-directory: ./packages/protocol
run: pnpm compile:l2 && pnpm test:l2 && pnpm layout:l2

- name: L2-Generate genesis
working-directory: ./packages/protocol
run: pnpm genesis:test

- name: L1-Unit tests
working-directory: ./packages/protocol
run: pnpm compile:l1 && pnpm test:l1 && pnpm layout:l1
Expand All @@ -60,3 +59,34 @@ jobs:
sleep 1
done
pnpm test:deploy:l1
genesis-docker:
if: github.event.pull_request.draft == false
runs-on: [taiko-runner]
permissions:
# Give the necessary permissions for stefanzweifel/git-auto-commit-action.
contents: write
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/[email protected]

- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies

- name: Compile
working-directory: ./packages/protocol
run: pnpm clean && pnpm compile

- name: L2-Generate Genesis (using docker)
working-directory: ./packages/protocol
run: pnpm genesis:test
3 changes: 3 additions & 0 deletions .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ jobs:
runs-on: [arc-runner-set]

steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/repo--vercel-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
run: |
echo "Vercel Project ID: ${{ env.VERCEL_PROJECT_ID }}"
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/snaefell-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/supplementary-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/taiko-client--docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ on:
jobs:
push-docker-image:
name: Build and push docker image
runs-on: [ubuntu-latest]
runs-on: [arc-runner-set]

steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout
uses: actions/checkout@v4

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/taiko-client--hive_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ jobs:
hive_tests:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'option.hive-test')
name: hive tests
runs-on: [ubuntu-latest]
timeout-minutes: 15
runs-on: [arc-runner-set]
timeout-minutes: 20

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- uses: actions/checkout@v4

- name: Set up Go
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/taiko-client--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ jobs:
lint:
if: github.event.pull_request.draft == false
name: Lint
runs-on: [ubuntu-latest]
runs-on: [arc-runner-set]
steps:
- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git make

- uses: actions/checkout@v4

- name: Set up Go
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/taikoon-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ui-lib--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
with:
access_token: ${{ github.token }}

- name: Install Git
run: sudo apt-get update && sudo apt-get install -y git

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages/bridge-ui": "2.12.0",
"packages/docs-site": "1.11.9",
"packages/docs-site": "1.12.0",
"packages/eventindexer": "0.13.0",
"packages/fork-diff": "0.6.0",
"packages/guardian-prover-health-check": "0.1.0",
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This section describes our coding standards at Taiko.

**It is important you use the correct commit type**. For minor semver bumps, use `feat`, for patches use `fix`. For a major bump use `feat(scope)!` or `fix(scope)!`. If you use `chore`, `docs`, or `ci`, then it won't result in a release-please PR or version bump.

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/validate-pr-title.yml).
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/repo--validate-pr-title.yml).

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.

Expand Down
21 changes: 18 additions & 3 deletions packages/bridge-ui/src/libs/bridge/Bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { routingContractsMap } from '$bridgeConfig';
import { MessageStatusError, ProcessMessageError, ReleaseError, WrongChainError, WrongOwnerError } from '$libs/error';
import type { BridgeProver } from '$libs/proof';
import { getConnectedWallet } from '$libs/util/getConnectedWallet';
import { isSmartContract } from '$libs/util/isSmartContract';
import { getLogger } from '$libs/util/logger';
import { config } from '$libs/wagmi';

Expand Down Expand Up @@ -262,6 +263,11 @@ export abstract class Bridge {
console.error('Failed to estimate gas, using fallback', error);
estimatedGas = 1_300_000n;
}

if (message.to && (await isSmartContract(message.to, Number(message.destChainId)))) {
log(`Recipient is a smart contract, increasing fees by 5 percent`);
estimatedGas = (estimatedGas * 105n) / 100n;
}
if (force) {
return await writeContract(config, {
address: bridgeContract.address,
Expand Down Expand Up @@ -293,10 +299,13 @@ export abstract class Bridge {

if (!message) throw new ProcessMessageError('Message is not defined');

const estimatedGas = await bridgeContract.estimateGas.retryMessage([message, isFinalAttempt], {
let estimatedGas = await bridgeContract.estimateGas.retryMessage([message, isFinalAttempt], {
account: client.account,
});

if (message.to && (await isSmartContract(message.to, Number(message.destChainId)))) {
log(`Recipient is a smart contract, increasing fees by 5 percent`);
estimatedGas = (estimatedGas * 105n) / 100n;
}
log('Estimated gas for retryMessage', estimatedGas);

const { request } = await simulateContract(config, {
Expand All @@ -319,9 +328,15 @@ export abstract class Bridge {

log('Estimating gas for recallMessage', bridgeContract.address, [message, proof]);

const estimatedGas = await bridgeContract.estimateGas.recallMessage([message, proof], { account: client.account });
let estimatedGas = await bridgeContract.estimateGas.recallMessage([message, proof], { account: client.account });
log('Estimated gas for recallMessage', estimatedGas);

if (message.from && (await isSmartContract(message.from, Number(message.srcChainId)))) {
log(`Sender is a smart contract, increasing fees by 5 percent`);
estimatedGas = (estimatedGas * 105n) / 100n;
}
log('Estimated gas for retryMessage', estimatedGas);

const { request } = await simulateContract(config, {
address: bridgeContract.address,
abi: bridgeContract.abi,
Expand Down
19 changes: 19 additions & 0 deletions packages/docs-site/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [1.12.0](https://github.com/taikoxyz/taiko-mono/compare/docs-site-v1.11.9...docs-site-v1.12.0) (2024-09-19)


### Features

* **docs-site:** sitewide banner for ontake fork notification ([#18111](https://github.com/taikoxyz/taiko-mono/issues/18111)) ([5ed6c80](https://github.com/taikoxyz/taiko-mono/commit/5ed6c8085e44b77283fe5ef8874f751126364d84))
* **docs-site:** update docs for ontake fork hekla ([#18143](https://github.com/taikoxyz/taiko-mono/issues/18143)) ([49b5071](https://github.com/taikoxyz/taiko-mono/commit/49b50712551849d185c98237098d236bb0cf884c))
* **docs-site:** update graphics and links for hekla ontake fork ([#18146](https://github.com/taikoxyz/taiko-mono/issues/18146)) ([48a27af](https://github.com/taikoxyz/taiko-mono/commit/48a27afe6be22fc7e1a9d2346ae292544faac0b3))


### Bug Fixes

* **docs-site:** remove duplicate wording ([#18105](https://github.com/taikoxyz/taiko-mono/issues/18105)) ([92c53f8](https://github.com/taikoxyz/taiko-mono/commit/92c53f8655dbdab4c7db1b023823a4e760240894))


### Documentation

* **docs-site:** fix broken link ([#18139](https://github.com/taikoxyz/taiko-mono/issues/18139)) ([e56b81b](https://github.com/taikoxyz/taiko-mono/commit/e56b81bbd83f26c95641cf7deab82dbb5a3da835))

## [1.11.9](https://github.com/taikoxyz/taiko-mono/compare/docs-site-v1.11.8...docs-site-v1.11.9) (2024-09-15)


Expand Down
2 changes: 1 addition & 1 deletion packages/docs-site/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docs-site",
"type": "module",
"version": "1.11.9",
"version": "1.12.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Code } from '@astrojs/starlight/components';
## How can you determine when a Taiko block is `Safe` or `Finalized`?

The `Safe` block state on Taiko is analogous to a `Safe` block state on Ethereum.
Every Taiko L2 block has a corresponding Ethereum L1 block as it's origin that can be queried through a [`taiko-geth API`](https://github.com/taikoxyz/taiko-geth/blob/caf87509fe0f53fc937a3f5cc26325a380a1744e/eth/taiko_api_backend.go#L50).
Every Taiko L2 block has a corresponding Ethereum L1 block as it's origin that can be queried through a [`taiko-geth API`](https://github.com/taikoxyz/taiko-geth/blob/v1.8.0/eth/taiko_api_backend.go#L50).
When that Ethereum L1 block can be considered `Safe`, the corresponding Taiko L2 block can be considered to have reached the same block state.

The `Finalized` block state is referred to as the [`Verified` block state](/core-concepts/multi-proofs#verified-blocks-and-parallel-proving) on Taiko.
Expand All @@ -18,17 +18,17 @@ A Taiko block is `Finalized`/`Verified` when every state transition from genesis

<Code code='
{
"method": "taiko_l1OriginByID",
"id":1,
"jsonrpc":"2.0",
"method": "taiko_l1OriginByID",
"id":1,
"jsonrpc":"2.0",
"params":[ "0x19a3c" ]
}' lang="json" title="query.json" />
<Code code='
"result":
{
"blockID": "0x19a3c",
"l2BlockHash": "0x0905c85f9a288ebe94eb85743a65c8cf6266097b8b826cdca4f4018e6267c26a",
"l1BlockHeight": "0x16ef0f",
"result":
{
"blockID": "0x19a3c",
"l2BlockHash": "0x0905c85f9a288ebe94eb85743a65c8cf6266097b8b826cdca4f4018e6267c26a",
"l1BlockHeight": "0x16ef0f",
"l1BlockHash": "0x419f0c5b2cc90078c7040c3b90d174895ce83d76ebfdd75ad2dd5521036d0938"
}' lang="json" title="response.json" />

Expand Down
Loading

0 comments on commit 53547c4

Please sign in to comment.