From dff1ef4f2b1fd12a0d3078a1cfc7a9ed15c0355b Mon Sep 17 00:00:00 2001 From: Roger <50648015+RogerLamTd@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:18:20 +0800 Subject: [PATCH 1/4] fix(repo): update versioning in version.go for client (#18700) --- release-please-config.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index fff43beb15e..b32db2f415b 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -27,7 +27,13 @@ }, "packages/relayer": {}, "packages/taiko-client": { - "package-name": "taiko-alethia-client" + "package-name": "taiko-alethia-client", + "extra-files": [ + { + "type": "generic", + "path": "internal/version/version.go" + } + ] }, "packages/ui-lib": {} } From 13a5b1b50e0bf9f030449af49cb0b58ce4288729 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 3 Jan 2025 13:24:05 +0800 Subject: [PATCH 2/4] fix(taiko-client): fix proposing fee estimation (#18702) --- .../taiko-client/proposer/transaction_builder/fallback.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/taiko-client/proposer/transaction_builder/fallback.go b/packages/taiko-client/proposer/transaction_builder/fallback.go index a97970f431e..9305e7ec69b 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback.go @@ -150,13 +150,12 @@ func (b *TxBuilderWithFallback) estimateCandidateCost( } log.Debug("Suggested gas price", "gasTipCap", gasTipCap, "baseFee", baseFee, "blobBaseFee", blobBaseFee) - gasPrice := new(big.Int).Add(baseFee, gasTipCap) + gasFeeCap := new(big.Int).Add(baseFee, gasTipCap) gasUsed, err := b.rpc.L1.EstimateGas(ctx, ethereum.CallMsg{ From: txmgr.From(), To: candidate.To, Gas: candidate.GasLimit, - GasPrice: gasPrice, - GasFeeCap: gasPrice, + GasFeeCap: gasFeeCap, GasTipCap: gasTipCap, Value: candidate.Value, Data: candidate.TxData, @@ -165,7 +164,7 @@ func (b *TxBuilderWithFallback) estimateCandidateCost( return nil, fmt.Errorf("failed to estimate gas used: %w", err) } - feeWithoutBlob := new(big.Int).Mul(gasPrice, new(big.Int).SetUint64(gasUsed)) + feeWithoutBlob := new(big.Int).Mul(gasFeeCap, new(big.Int).SetUint64(gasUsed)) // If its a type-2 transaction, we won't calculate blob fee. if len(candidate.Blobs) == 0 { From ca3987a63761ef85fd7ff43f1023d98d619a6773 Mon Sep 17 00:00:00 2001 From: Roger <50648015+RogerLamTd@users.noreply.github.com> Date: Fri, 3 Jan 2025 13:47:25 +0800 Subject: [PATCH 3/4] chore(repo): workflows skip dependabot prs (#18701) --- .github/workflows/bridge-ui.yml | 6 +++--- .github/workflows/docs-site--preview.yml | 2 +- .github/workflows/fork-diff--preview.yml | 2 +- .github/workflows/guardian-prover-health-check-ui--ci.yml | 1 - .github/workflows/guardian-prover-health-check-ui.yml | 5 +++-- .github/workflows/guardian-prover-health-check.yml | 6 +++--- .github/workflows/protocol-monitors.yml | 2 +- .github/workflows/protocol.yml | 4 ++-- .github/workflows/repo--typo-check.yml | 2 +- .github/workflows/snaefell-ui.yml | 3 +++ .github/workflows/taiko-client--test.yml | 2 +- 11 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bridge-ui.yml b/.github/workflows/bridge-ui.yml index 68815001452..b767a57be71 100644 --- a/.github/workflows/bridge-ui.yml +++ b/.github/workflows/bridge-ui.yml @@ -17,7 +17,7 @@ on: jobs: build-and-test: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} uses: ./.github/workflows/bridge-ui--ci.yml # Deployment name follow the pattern: deploy___ @@ -37,7 +37,7 @@ jobs: # Hekla testnet deploy_bridge-ui_hekla_preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: @@ -62,7 +62,7 @@ jobs: # Mainnet deploy_bridge-ui_mainnet_preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: diff --git a/.github/workflows/docs-site--preview.yml b/.github/workflows/docs-site--preview.yml index ed682196d5a..acd2226b733 100644 --- a/.github/workflows/docs-site--preview.yml +++ b/.github/workflows/docs-site--preview.yml @@ -14,7 +14,7 @@ on: jobs: deploy-docs-site-preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.event.pull_request.head.repo.fork == false }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' }} runs-on: [arc-runner-set] steps: - name: Install Git diff --git a/.github/workflows/fork-diff--preview.yml b/.github/workflows/fork-diff--preview.yml index cc1af86c65d..a93f356e107 100644 --- a/.github/workflows/fork-diff--preview.yml +++ b/.github/workflows/fork-diff--preview.yml @@ -14,7 +14,7 @@ on: jobs: deploy-fork-diff-preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} runs-on: [arc-runner-set] steps: - name: Install Git diff --git a/.github/workflows/guardian-prover-health-check-ui--ci.yml b/.github/workflows/guardian-prover-health-check-ui--ci.yml index abdf477b41b..c2935406a18 100644 --- a/.github/workflows/guardian-prover-health-check-ui--ci.yml +++ b/.github/workflows/guardian-prover-health-check-ui--ci.yml @@ -4,7 +4,6 @@ on: workflow_call jobs: check-guardian-prover-health-check-ui: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && !startsWith(github.head_ref, 'refs/heads/dependabot/') }} runs-on: [taiko-runner] steps: - name: Cancel previous runs diff --git a/.github/workflows/guardian-prover-health-check-ui.yml b/.github/workflows/guardian-prover-health-check-ui.yml index ad0d4aa069c..69b91f2a79e 100644 --- a/.github/workflows/guardian-prover-health-check-ui.yml +++ b/.github/workflows/guardian-prover-health-check-ui.yml @@ -12,6 +12,7 @@ on: jobs: build-and-test: + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} uses: ./.github/workflows/guardian-prover-health-check-ui--ci.yml # Deployment name follow the pattern: deploy___ @@ -31,7 +32,7 @@ jobs: deploy_guardians-ui_hekla_preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: @@ -43,7 +44,7 @@ jobs: vercel_token: ${{ secrets.VERCEL_TOKEN }} deploy_guardians-ui_mainnet_preview: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: diff --git a/.github/workflows/guardian-prover-health-check.yml b/.github/workflows/guardian-prover-health-check.yml index fc5f70e5f28..399f3a8dbb7 100644 --- a/.github/workflows/guardian-prover-health-check.yml +++ b/.github/workflows/guardian-prover-health-check.yml @@ -13,7 +13,7 @@ on: jobs: lint-guardian-prover-health-check: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} name: lint-guardian-prover-health-check runs-on: [taiko-runner] steps: @@ -32,7 +32,7 @@ jobs: args: --config=.golangci.yml --timeout=4m test-guardian-prover-health-check: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} runs-on: [taiko-runner] needs: lint-guardian-prover-health-check steps: @@ -58,7 +58,7 @@ jobs: push-guardian-prover-health-check-docker-image: # Skip dependabot PRs - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && !startsWith(github.head_ref, 'refs/heads/dependabot/') && github.event.pull_request.head.repo.fork == false }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.fork == false }} name: Build and push docker image runs-on: [taiko-runner] diff --git a/.github/workflows/protocol-monitors.yml b/.github/workflows/protocol-monitors.yml index 00c96440f94..c7fadee635d 100644 --- a/.github/workflows/protocol-monitors.yml +++ b/.github/workflows/protocol-monitors.yml @@ -11,7 +11,7 @@ on: jobs: deploy-protocol-monitors: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} runs-on: [taiko-runner] permissions: # Give the necessary permissions for stefanzweifel/git-auto-commit-action. diff --git a/.github/workflows/protocol.yml b/.github/workflows/protocol.yml index 174b02a4df0..852364b0779 100644 --- a/.github/workflows/protocol.yml +++ b/.github/workflows/protocol.yml @@ -15,7 +15,7 @@ on: jobs: build-protocol: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} runs-on: [arc-runner-set] permissions: # Give the necessary permissions for stefanzweifel/git-auto-commit-action. @@ -69,7 +69,7 @@ jobs: pnpm test:deploy:l1 genesis-docker: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} runs-on: [taiko-runner] permissions: # Give the necessary permissions for stefanzweifel/git-auto-commit-action. diff --git a/.github/workflows/repo--typo-check.yml b/.github/workflows/repo--typo-check.yml index 326b57eede9..503638d100f 100644 --- a/.github/workflows/repo--typo-check.yml +++ b/.github/workflows/repo--typo-check.yml @@ -4,7 +4,7 @@ on: [pull_request] jobs: check-for-typos: - if: contains(github.event.pull_request.labels.*.name, 'option.workflow_on') || github.event.pull_request.draft == false && github.head_ref != 'release-please-*' + if: ${{ contains(github.event.pull_request.labels.*.name, 'option.workflow_on') || github.event.pull_request.draft == false && github.head_ref != 'release-please-*' && github.actor != 'dependabot[bot]' }} runs-on: [arc-runner-set] steps: diff --git a/.github/workflows/snaefell-ui.yml b/.github/workflows/snaefell-ui.yml index 68b424b20e7..7a0971ca25c 100644 --- a/.github/workflows/snaefell-ui.yml +++ b/.github/workflows/snaefell-ui.yml @@ -5,11 +5,13 @@ on: jobs: build-and-test: + if: ${{ github.actor != 'dependabot[bot]' }} uses: ./.github/workflows/snaefell-ui--ci.yml # Deployment name follow the pattern: deploy___ # The following Vercel project is not found, so disable it at least for now. deploy_snaefell-ui_mainnet_preview: + if: ${{ github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: @@ -21,6 +23,7 @@ jobs: vercel_token: ${{ secrets.VERCEL_TOKEN }} deploy_snaefell-ui_mainnet_production: + if: ${{ github.actor != 'dependabot[bot]' }} needs: build-and-test uses: ./.github/workflows/repo--vercel-deploy.yml with: diff --git a/.github/workflows/taiko-client--test.yml b/.github/workflows/taiko-client--test.yml index f83ff6ed172..0160b8a8596 100644 --- a/.github/workflows/taiko-client--test.yml +++ b/.github/workflows/taiko-client--test.yml @@ -13,7 +13,7 @@ on: jobs: lint: - if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') }} + if: ${{ github.event.pull_request.draft == false && !startsWith(github.head_ref, 'release-please') && github.actor != 'dependabot[bot]' }} name: Lint runs-on: [ubuntu-latest] steps: From 395ac5fdfb0d8eccae96fafda423d19766a94556 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 3 Jan 2025 14:23:12 +0800 Subject: [PATCH 4/4] fix(taiko-client): fix blob transactions estimation when proposing (#18703) --- .../proposer/transaction_builder/fallback.go | 20 ++++++++++++++----- .../transaction_builder/fallback_test.go | 7 +++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/taiko-client/proposer/transaction_builder/fallback.go b/packages/taiko-client/proposer/transaction_builder/fallback.go index 9305e7ec69b..120017b2067 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback.go @@ -143,23 +143,33 @@ func (b *TxBuilderWithFallback) estimateCandidateCost( ctx context.Context, candidate *txmgr.TxCandidate, ) (*big.Int, error) { - txmgr, _ := b.txmgrSelector.Select() - gasTipCap, baseFee, blobBaseFee, err := txmgr.SuggestGasPriceCaps(ctx) + txMgr, _ := b.txmgrSelector.Select() + gasTipCap, baseFee, blobBaseFee, err := txMgr.SuggestGasPriceCaps(ctx) if err != nil { return nil, err } log.Debug("Suggested gas price", "gasTipCap", gasTipCap, "baseFee", baseFee, "blobBaseFee", blobBaseFee) gasFeeCap := new(big.Int).Add(baseFee, gasTipCap) - gasUsed, err := b.rpc.L1.EstimateGas(ctx, ethereum.CallMsg{ - From: txmgr.From(), + msg := ethereum.CallMsg{ + From: txMgr.From(), To: candidate.To, Gas: candidate.GasLimit, GasFeeCap: gasFeeCap, GasTipCap: gasTipCap, Value: candidate.Value, Data: candidate.TxData, - }) + } + if len(candidate.Blobs) != 0 { + var blobHashes []common.Hash + if _, blobHashes, err = txmgr.MakeSidecar(candidate.Blobs); err != nil { + return nil, fmt.Errorf("failed to make sidecar: %w", err) + } + msg.BlobHashes = blobHashes + msg.BlobGasFeeCap = blobBaseFee + } + + gasUsed, err := b.rpc.L1.EstimateGas(ctx, msg) if err != nil { return nil, fmt.Errorf("failed to estimate gas used: %w", err) } diff --git a/packages/taiko-client/proposer/transaction_builder/fallback_test.go b/packages/taiko-client/proposer/transaction_builder/fallback_test.go index 3fcd0eb63c1..8107875b6f6 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback_test.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback_test.go @@ -30,6 +30,13 @@ func (s *TransactionBuilderTestSuite) TestBuildCalldataWithBlobAllowed() { s.NotZero(len(candidate.Blobs)) } +func (s *TransactionBuilderTestSuite) TestBlobAllowed() { + builder := s.newTestBuilderWithFallback(false, false) + s.False(builder.BlobAllow()) + builder = s.newTestBuilderWithFallback(true, false) + s.True(builder.BlobAllow()) +} + func (s *TransactionBuilderTestSuite) newTestBuilderWithFallback(blobAllowed, fallback bool) *TxBuilderWithFallback { l1ProposerPrivKey, err := crypto.ToECDSA(common.FromHex(os.Getenv("L1_PROPOSER_PRIVATE_KEY"))) s.Nil(err)