Skip to content

Commit

Permalink
Merge branch 'main' into relayer_extra_padding_for_contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jan 3, 2025
2 parents 945f137 + 395ac5f commit 9a487f5
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/bridge-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_<appname(bridge-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-site--preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fork-diff--preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/guardian-prover-health-check-ui--ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/guardian-prover-health-check-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_<appname(guardian-prover-health-check-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
Expand All @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/guardian-prover-health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/protocol-monitors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/protocol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/repo--typo-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/snaefell-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_<appname(snaefell-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
# 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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/taiko-client--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 18 additions & 9 deletions packages/taiko-client/proposer/transaction_builder/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,38 @@ 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)

gasPrice := new(big.Int).Add(baseFee, gasTipCap)
gasUsed, err := b.rpc.L1.EstimateGas(ctx, ethereum.CallMsg{
From: txmgr.From(),
gasFeeCap := new(big.Int).Add(baseFee, gasTipCap)
msg := 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,
})
}
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)
}

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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
Expand Down

0 comments on commit 9a487f5

Please sign in to comment.