Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bridge commands duplicate signer construction and miss new signer types

オープン
#794 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@palango がすでに取り組んでいます。

2026年8月19日 から。

  • #795 @palango による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

packages/cli/src/base.ts:229-308 の BaseCommand.getWalletClient() から始め、続いて packages/cli/src/commands/bridge/deposit.ts、withdraw-prove.ts、withdraw-finalize.ts における wallet の構築を比較します。各コマンドが BaseCommand.init() をスキップし、L1 chain と transport をどのようにバインドしているかを追跡します。3 つのコマンドが BaseCommand と signer の選択を共有しながら、それぞれの L1 動作を維持し、そこで追加された signer type をサポートできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Summary

Three bridge commands bypass BaseCommand's wallet construction and reimplement it, so any signer type added to BaseCommand silently does not work for them.

Detail

packages/cli/src/commands/bridge/deposit.ts, withdraw-prove.ts and withdraw-finalize.ts each declare async init() {} to skip BaseCommand.init(), then build their own wallet client in a private getL1WalletClient(). That method re-implements the --useLedger / --privateKey branching already present in BaseCommand.getWalletClient() (packages/cli/src/base.ts:229-308):

// packages/cli/src/commands/bridge/deposit.ts:149-162
} else if (res.flags.privateKey) {
  const account = privateKeyToAccount(ensureLeading0x(res.flags.privateKey))
  if (res.flags.from && !isAddressEqual(res.flags.from, account.address)) { ... }
  return createWalletClient({ account, chain: config.l1Chain, transport: http(l1RpcUrl) })
}

The duplication is understandable — these commands sign against L1, not the L2 chain --node points at, so they need a different chain and transport. But the signer selection logic is identical and has been copied rather than shared.

Why it matters

The branching is an exhaustive if/else if over signer types. Any signer added to BaseCommand — a keystore option, a new HSM, anything — works everywhere except these three commands, with no compile-time error and no runtime warning. The user just silently gets a different (or no) signer.

Suggested fix

Extract signer selection from chain/transport binding in BaseCommand, so a command can ask for "the configured signer, bound to this chain and transport". The bridge commands then pass their L1 chain and transport into the shared helper instead of re-deriving the account. That collapses three copies into one and makes new signer types work everywhere by construction.

Context

Found while scoping a --keystore option (like cast --keystore). That work is deliberately scoped to BaseCommand and will not cover the bridge commands, so --keystore will not work with bridge:deposit, bridge:withdraw-prove or bridge:withdraw-finalize until this is addressed.

主要言語
TypeScript
スター
43
フォーク
36
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

celo-org/developer-tooling のほかの issue

celo-org/developer-tooling の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。