Skip to content

Commit

Permalink
Merge branch 'main' into support-batch-propose
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Sep 19, 2024
2 parents 758442c + c62f3f6 commit db7b7a0
Show file tree
Hide file tree
Showing 37 changed files with 621 additions and 472 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/bridge-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on: workflow_call

jobs:
build:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- 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
9 changes: 6 additions & 3 deletions .github/workflows/eventindexer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint-eventindexer:
name: lint-eventindexer
if: github.event_name == 'pull_request'
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- uses: actions/setup-go@v5
with:
Expand All @@ -35,7 +35,7 @@ jobs:
args: --config=.golangci.yml --timeout=4m

test-eventindexer:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
needs: lint-eventindexer
steps:
Expand Down Expand Up @@ -66,9 +66,12 @@ jobs:
# Skip dependabot PRs
if: ${{ github.event_name == 'pull_request' && ! startsWith(github.ref, 'refs/heads/dependabot/') }}
name: Build and push docker image
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
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
5 changes: 4 additions & 1 deletion .github/workflows/nfts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
jobs:
build-nfts-contracts:
if: github.event.pull_request.draft == false
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
build-protocol:
if: github.event.pull_request.draft == false
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
permissions:
# Give the necessary permissions for stefanzweifel/git-auto-commit-action.
contents: write
Expand All @@ -19,6 +19,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
9 changes: 6 additions & 3 deletions .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
lint-relayer:
name: lint-relayer
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
steps:
- uses: actions/setup-go@v5
with:
Expand All @@ -36,7 +36,7 @@ jobs:

test-relayer:
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
needs: lint-relayer
steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -66,9 +66,12 @@ jobs:
# Skip dependabot PRs
if: ${{ github.event_name == 'pull_request' && ! startsWith(github.ref, 'refs/heads/dependabot/') }}
name: Build and push docker image
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
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
5 changes: 4 additions & 1 deletion .github/workflows/snaefell-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on: workflow_call

jobs:
build:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/supplementary-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
jobs:
build-supplementary-contracts:
if: github.event.pull_request.draft == false
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- 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
5 changes: 4 additions & 1 deletion .github/workflows/taikoon-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on: workflow_call

jobs:
build:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ui-lib--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ on: workflow_call

jobs:
build:
runs-on: [taiko-runner]
runs-on: [arc-runner-set]
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

- name: Checkout repository
uses: actions/checkout@v4
with:
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ If you've already deployed a ProverSet but would like to upgrade it through the
Execute the following command, filling in the values in the curly braces appropriately.

```bash
forge create --private-key {YOUR_PRIVATE_KEY} --chain-id 17000 --rpc-url {YOUR_RPC_URL} contracts/layer1/provers/ProverSet.sol:ProverSet
forge create --private-key {YOUR_PRIVATE_KEY} --chain-id {CHAIN_ID} --rpc-url {YOUR_RPC_URL} contracts/layer1/provers/ProverSet.sol:ProverSet
```

<Aside>
Expand Down Expand Up @@ -174,7 +174,7 @@ If you've already deployed a ProverSet but would like to upgrade it through the
Then, navigate to the `protocol` package in `taiko-mono` and execute the following command substituting values in curly braces as necessary.
```bash
forge verify-contract --chain-id 17000 --etherscan-api-key {GET-API-KEY-FROM-ETHERSCAN-FIRST} {PUT-CONTRACT-ADDRESS-HERE} contracts/team/proving/ProverSet.sol:ProverSet
forge verify-contract --chain-id {CHAIN_ID} --etherscan-api-key {GET-API-KEY-FROM-ETHERSCAN-FIRST} {PUT-CONTRACT-ADDRESS-HERE} contracts/layer1/provers/ProverSet.sol:ProverSet
```
You should get a success message and your contract should now show up as verified on Etherscan!
Expand Down
Loading

0 comments on commit db7b7a0

Please sign in to comment.