Parent
Part of #954 (split from PR #840).
What
Add BeaconDepositDataSpecTest to the spec test suite. Mirrors Go's GenerateETHDepositData() which validates deposit signing root computation.
Reference implementation
Branch test/simple-spec-test-types, file: anchor/spec_tests/src/types/beacon_deposit_data.rs
Details
- Parses validator public key, withdrawal credentials, and fork version from fixture
- Constructs a
DepositMessage with ChainSpec::mainnet().max_effective_balance
- Computes domain via
spec.compute_domain(Domain::Deposit, fork_version, Hash256::ZERO)
- Validates
signing_root matches expected value
- Fixture validator PK has no
0x prefix (test prepends it)
- 1 fixture:
beacon.DepositDataSpecTest_deposit_data_root_and_ssz.json
Changes needed
- New file:
anchor/spec_tests/src/types/beacon_deposit_data.rs
- Add module + re-export in
anchor/spec_tests/src/types/mod.rs
- Add dispatch arm
"beacon.DepositDataSpecTest" in anchor/spec_tests/src/runner/types_dispatcher.rs
Parent
Part of #954 (split from PR #840).
What
Add
BeaconDepositDataSpecTestto the spec test suite. Mirrors Go'sGenerateETHDepositData()which validates deposit signing root computation.Reference implementation
Branch
test/simple-spec-test-types, file:anchor/spec_tests/src/types/beacon_deposit_data.rsDetails
DepositMessagewithChainSpec::mainnet().max_effective_balancespec.compute_domain(Domain::Deposit, fork_version, Hash256::ZERO)signing_rootmatches expected value0xprefix (test prepends it)beacon.DepositDataSpecTest_deposit_data_root_and_ssz.jsonChanges needed
anchor/spec_tests/src/types/beacon_deposit_data.rsanchor/spec_tests/src/types/mod.rs"beacon.DepositDataSpecTest"inanchor/spec_tests/src/runner/types_dispatcher.rs