changeKeystorePassphrase silently drops blspublickey from validator keystores
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- security
調査の方向性
packages/sdk/keystores/src/keystore-base.ts の changeKeystorePassphrase から始め、新しい V3 オブジェクトがどのように構築されるかを調べてください。packages/sdk/keystores/src/test-constants.ts の GETH_GEN_KEYSTORE1 を使って passphrase の変更を再現し、その後、再暗号化後も blspublickey が存在したままであることを示すリグレッションテストを追加してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
KeystoreBase.changeKeystorePassphrase destroys any non-standard top-level field in a V3 keystore. Celo validator keystores generated by geth carry a blspublickey field, so changing such a keystore's passphrase silently loses it.
Cause
packages/sdk/keystores/src/keystore-base.ts re-encrypts by decrypting the private key and building a fresh V3 object. That object only ever contains version, id, address and crypto, so everything else in the original file is dropped:
in : {address, blspublickey, crypto, id, version}
out: {address, crypto, id, version}
^^^^^^^^^^^^ silently lost
There is no error and no warning — the write succeeds and the field is simply gone.
Reproduce
GETH_GEN_KEYSTORE1 in packages/sdk/keystores/src/test-constants.ts is a real geth-generated fixture containing a blspublickey. Persist it, call changeKeystorePassphrase, then re-read the raw entry: the field is absent.
Not a regression
This predates the removal of ethereumjs-wallet (#792). That library's toV3 had exactly the same behaviour, so the migration neither introduced nor worsened it. It was left alone there deliberately to keep that PR strictly behaviour-neutral and easy to review.
Suggested fix
Preserve unknown top-level fields across re-encryption — spread the parsed original and overwrite only crypto (and id), rather than constructing the object from scratch. Add a regression test using the GETH_GEN_KEYSTORE1 fixture asserting blspublickey survives a passphrase change.
Worth deciding at the same time whether importPrivateKey should be able to write such fields, or whether preservation on re-encryption is the whole scope.
Impact
Limited. @celo/keystores has no consumers inside this monorepo — celocli never reads or writes keystore files — so this only affects external npm consumers of the package who manage geth-generated validator keystores.
- 主要言語
- TypeScript
- スター
- 43
- フォーク
- 36
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
celo-org/developer-tooling のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
celo-org/developer-tooling#786 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
celo-org/developer-tooling#800 · コメント 1 件 ·
-
Bridge commands duplicate signer construction and miss new signer types対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
celo-org/developer-tooling#794 ·
-
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 が 49 日前に担当しました。 オープンbug celocli
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
celo-org/developer-tooling#789 ·
celo-org/developer-tooling の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
keptinventory/kept#336 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
hemi-earn
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vetro-protocol/vetro-monorepo#1013 ·
メンテナーはふだん 1 日以内に返信