Skip to content

refactor: inject purpose keys structurally through SeismicNode#360

Open
ameya-deshmukh wants to merge 2 commits intoseismicfrom
ameya/inject-purpose-keys
Open

refactor: inject purpose keys structurally through SeismicNode#360
ameya-deshmukh wants to merge 2 commits intoseismicfrom
ameya/inject-purpose-keys

Conversation

@ameya-deshmukh
Copy link
Copy Markdown
Contributor

Summary

  • SeismicNode now accepts purpose keys via SeismicNode::new(keys), threading them through the node builder lifecycle (executor builder → EVM config) without relying on the global OnceLock
  • SeismicExecutorBuilder uses injected keys when available, falling back to get_purpose_keys() when constructed via Default (tests, CLI stage command)
  • main.rs uses SeismicNode::new(purpose_keys) instead of SeismicNode::default()
  • Global init_purpose_keys() / get_purpose_keys() retained as deprecated fallback for code paths that can't yet receive keys structurally

Addresses #352 (comment)

Test plan

  • cargo check -p reth-seismic-node -p seismic-reth — compiles clean
  • cargo nextest run -p reth-seismic-node -E 'kind(test)' --no-fail-fast — all integration tests pass
  • cargo +nightly fmt --all

🤖 Generated with Claude Code

@ameya-deshmukh ameya-deshmukh requested a review from cdrappi as a code owner April 3, 2026 14:10
SeismicNode::new(keys) stores purpose keys and threads them through
the executor builder, avoiding reliance on the global OnceLock for the
main node path. The global fallback is retained for tests and CLI
stage command.
@ameya-deshmukh ameya-deshmukh force-pushed the ameya/inject-purpose-keys branch from acbe45a to d363d4d Compare April 3, 2026 14:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

Updates purpose key injection to use structural dependency injection instead of relying solely on global state.

Phase 1

  • crates/seismic/node/src/node.rs:63-66SeismicNode derives Debug and holds Option<&'static GetPurposeKeysResponse> with the secret tx_io_sk. Any debug!("{:?}", seismic_node) would leak the secret key in plaintext.
  • crates/seismic/node/src/node.rs:476-479SeismicExecutorBuilder derives Debug and holds Option<&'static GetPurposeKeysResponse> with the secret key. Debug formatting this struct would expose tx_io_sk.

Both structs need custom Debug implementations that exclude the purpose_keys field or show only [REDACTED] when Some.

LGTM otherwise — the structural injection approach is good architecture and the Box::leak pattern for 'static lifetime is appropriate here.

- Derive Default instead of manual impl for SeismicNode
- Make purpose_keys() a const fn
- Update CLAUDE.md CI Requirements to match actual Seismic CI clippy command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant