Skip to content

Conversation

rplusq
Copy link
Contributor

@rplusq rplusq commented Oct 8, 2025

Summary

  • Add Turnkey as a remote signer option alongside AWS KMS and GCP KMS
  • Fix wallet feature flags in forge to properly gate foundry-wallets dependency

Changes

  • Added alloy-signer-turnkey dependency to foundry-wallets
  • Implemented Turnkey wallet CLI args and initialization logic
  • Added turnkey feature flags to cast and forge
  • Updated Dockerfile and Makefile to include turnkey in release builds

Bug Fix: forge wallet features

Made foundry-wallets an optional dependency in forge/Cargo.toml and updated feature definitions.

Issue: The aws-kms, gcp-kms, and turnkey features were defined but non-functional when using cargo run --features forge/turnkey. The features only worked in release builds via Makefile.

Root cause: foundry-wallets was a dev-dependency, so feature flags had no effect. Additionally, it was unconditionally compiled in the default build despite being feature-gated, causing unused dependency warnings.

Fix:

  • Made foundry-wallets an optional dependency: foundry-wallets = { workspace = true, optional = true }
  • Updated features to enable the dependency: turnkey = ["dep:foundry-wallets", "foundry-wallets/turnkey"]
  • Added conditional import guard in lib.rs to only use the crate when features are enabled

This aligns forge with cast's wallet handling and resolves clippy warnings about unused dependencies.

Testing

# Before: --turnkey flag doesn't appear
cargo run --bin forge --features forge/turnkey -- create -h | grep turnkey
# (no output)

# After: --turnkey flag works
cargo run --bin forge --features forge/turnkey -- create -h | grep turnkey  
# --turnkey  Use Turnkey

# CI checks pass
cargo check --all                                          #
cargo +nightly fmt -- --check                              #
cargo +nightly clippy --all --all-targets --all-features -- -D warnings  #

🤖 Generated with Claude Code

rplusq and others added 2 commits October 8, 2025 18:30
Add Turnkey as a remote signer option alongside AWS KMS and GCP KMS.

Key changes:
- Added alloy-signer-turnkey dependency to foundry-wallets
- Implemented Turnkey wallet CLI args and initialization logic
- Added turnkey feature flags to cast and forge
- Updated Dockerfile and Makefile to include turnkey in release builds

Fixed forge wallet feature flags:
- Moved foundry-wallets from dev-dependencies to dependencies in forge/Cargo.toml
- This fixes an issue where aws-kms, gcp-kms, and turnkey features were defined
  but non-functional when using cargo run with --features flags
- The features worked in release builds (via Makefile) but not in local dev
- This aligns forge with cast, which already had foundry-wallets as a regular dependency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@rplusq rplusq force-pushed the feat/turnkey-signer branch from 3ebd55f to d4ed301 Compare October 8, 2025 17:30
@rplusq
Copy link
Contributor Author

rplusq commented Oct 8, 2025

Blocked by alloy-rs/alloy#2962, will update when the signer makes it into Alloy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant