Bridge commands duplicate signer construction and miss new signer types
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- cli, developer-experience
Línea de trabajo
Comienza con BaseCommand.getWalletClient() en packages/cli/src/base.ts:229-308 y luego compara la construcción de la wallet en packages/cli/src/commands/bridge/deposit.ts, withdraw-prove.ts y withdraw-finalize.ts. Traza cómo cada comando omite BaseCommand.init() y vincula su cadena L1 y su transporte. El trabajo estará terminado cuando los tres comandos compartan la selección del signer con BaseCommand, conserven su comportamiento L1 y admitan los tipos de signer añadidos allí.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 43
- Forks
- 36
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de celo-org/developer-tooling
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
celo-org/developer-tooling#793 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
celo-org/developer-tooling#786 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
celo-org/developer-tooling#800 · 1 comentario ·
-
Zero CELO gas balance is reported as a contract revert: "gas required exceeds allowance (0)"Abiertobug celocli
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
celo-org/developer-tooling#790 ·
-
--ledgerLiveMode iterates the BIP-44 change index instead of the hardened account indexPosiblemente ocupada @Steve0x2a la tomó hace 44 días. Abiertobug celocli
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
celo-org/developer-tooling#789 ·
Todos los issues de celo-org/developer-tooling
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
maniator/verticopolis#1303 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
components-web-app/docs#297 ·
-
listFeatures/getFeatureExamples never return Kotlin examples for Android or server Kotlin SDKsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
appwrite/mcp-for-docs#23 · 1 comentario ·
-
`@vanilla-extract/turbopack-plugin`: "getImageSize is not a function" with Next.js 16.4.x when a `.css.ts` file imports an imagePosiblemente ocupada @aevarOrigo la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vanilla-extract-css/vanilla-extract#1799 · 1 comentario ·
-
native
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prime-radiant-inc/evener#4839 ·
Los mantenedores suelen responder en 1 día