feat(cli): support custom testnets in pluto run#562
Merged
Conversation
Register a fully-specified --testnet-* custom network via eth2util::network::add_test_network in the run bridge, before the cluster lock is loaded in App::run, so the lock's custom genesis fork version resolves against the supported-networks registry during EIP-712 signature verification (Charon app/app.go:171-173). This lifts the former fail-fast rejection of --testnet-* in check_unsupported_flags for the supported (fully-specified) path. Partially-specified testnet flags stay ignored (Charon's IsNonZero gate). The TestnetConfig->Network mapping leaks the owned CLI strings into Network's &'static str fields (bounded to one custom testnet per process) and clamps the i64 genesis timestamp to u64. Closes #531
emlautarom1
force-pushed
the
worktree-issue-531-custom-testnets-run
branch
from
July 21, 2026 23:09
d81f657 to
a6134bd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Enables pluto run to honor fully-specified --testnet-* custom network flags by registering the custom network in eth2util::network before App::run loads/verifies the cluster lock, allowing fork-version lookups used during EIP-712 signature verification to succeed.
Changes:
- Remove fail-fast rejection of fully-specified
--testnet-*flags forpluto run. - Register a fully-specified custom testnet via
pluto_eth2util::network::add_test_networkduringbuild_app_config(beforeApp::runlock load). - Add tests covering (a) successful registration/lookup and (b) partial testnet flags being ignored and not registered.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
emlautarom1
marked this pull request as ready for review
July 22, 2026 01:18
emlautarom1
approved these changes
Jul 22, 2026
emlautarom1
left a comment
Collaborator
There was a problem hiding this comment.
Boilerplate code (config threading). LGTM.
iamquang95
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #531. Part of #402 (app-wiring follow-up).
pluto runnow honors a fully-specified--testnet-*custom network. The run bridge registers it viaeth2util::network::add_test_networkbefore the cluster lock is loaded inApp::run, so the lock's custom genesis fork version resolves against the supported-networks registry during EIP-712 signature verification. This lifts the previous fail-fast rejection of--testnet-*for the supported path.Why registration must precede lock load
With
--no-verifyoff (the default), a v1.3.0+ lock'sverify_signaturescomputes an EIP-712 digest that callsfork_version_to_chain_id->network_from_fork_version, which rejects a fork version absent from the registry withInvalid fork version. Registering the custom testnet first makes that lookup succeed. This mirrors Charon, and follows the CLI-side registration precedent already increate_cluster.rs.Tests
build_app_config_registers_fully_specified_testnet: a fully-specified testnet is registered by the bridge and its (previously-unknown) fork version then resolves viafork_version_to_network/fork_version_to_chain_id— the exact lookup the lock performs during load.build_app_config_ignores_partial_testnet: a partial config is neither rejected nor registered.