Open
Conversation
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
Ports the Go
TestCreateClustertest suite to Rust, covering all majorcreate_clusterflows end-to-end, and fixes several correctness issues uncovered in the process.New tests (
crates/cli/src/commands/create_cluster.rs)A shared
run_test_create_clusterhelper drives all test cases, mirroring the Go test loop. Each case exercisesrun()against a temp directory and asserts:cluster-lock.jsonpassesverify_hashes()andverify_signatures()Test cases covered:
simnetgoerlicustom_testnet_flagscustom_target_gas_limittarget_gas_limitsolo_flow_definition_from_disksolo_flow_definition_from_networksplitkeys--split-existing-keys, keys generated in a temp dirsplitkeys_with_cluster_definitionfour_partial_deposits/two_partial_depositswith_fee_recipient_and_withdrawal_addressesvalidate_defGolden files live in
crates/cli/src/commands/testdata/and can be regenerated withUPDATE_GOLDEN=1 cargo test.Bug fixes
create_cluster::run— calldef.set_definition_hashes()before proceeding with key generation; the hashes were previously unset, causingverify_hashes()to fail.definition.rsdeserialization — validate thatnum_validators == validator_addresses.len()for schema versions v1.5–v1.10; add#[serde(default)]tofee_recipient_address,withdrawal_address, andcompoundingso older JSON examples without those fields still deserialize correctly.lock.rsno_registrationcheck — remove the zero-fee_recipientguard. The Go reference useslen == 0(missing field), not the zero Ethereum address; a legitimately zero fee-recipient is valid. Only an all-zero BLS signature or pubkey indicates a missing registration.cluster-definition-005.json— fix malformed timestamp (stray spaces around:separators).Test plan
cargo test -p pluto-clipasses with all new test cases greenUPDATE_GOLDEN=1 cargo testregenerates golden files without diff