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

changeKeystorePassphrase silently drops blspublickey from validator keystores

オープン 初心者向け
#793 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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 はありません

環境構築

はじめの一歩

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

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

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

似ている issue

TypeScript の issue をもっと見る

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

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