Bridge commands duplicate signer construction and miss new signer types
評価
- 難易度
- 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 はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
celo-org/developer-tooling のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
celo-org/developer-tooling#793 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
celo-org/developer-tooling#786 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
celo-org/developer-tooling#800 · コメント 1 件 ·
-
bug celocli
難易度 4/5 3〜5日 初心者へのやさしさ 50/100
celo-org/developer-tooling#790 ·
-
--ledgerLiveMode iterates the BIP-44 change index instead of the hardened account index対応中かも @Steve0x2a が 45 日前に担当しました。 オープンbug celocli
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
celo-org/developer-tooling#789 ·
celo-org/developer-tooling の issue をすべて見る
似ている issue
-
bug hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
libredb/libredb-studio#1941 ·
メンテナーはふだん 1 日以内に返信
-
chore other
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
alastair-smith/card-games#308 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
paperclipai/paperclip#17379 ·
メンテナーはふだん 1 日以内に返信
-
[good first issue, hacktoberfest] 🏯 Hacktoberfest Task - Add new Anime Quote 626 (good-first-issue)オープンcommunity first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
lingdojo/kana-dojo#33040 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
bug mobile ui
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信