Fix bug in lcli transition-blocks and improve pretty-ssz (#4513)

## Proposed Changes

- Fix bad `state_root` reuse in `lcli transition-blocks` that resulted in invalid results at skipped slots.
- Modernise `lcli pretty-ssz` to include fork-generic decoders for `SignedBeaconBlock` and `BeaconState` which respect the `--network`/`--testnet-dir` flag.

## Additional Info

Breaking change: the underscore names like `signed_block_merge` are removed in favour of the fork-generic name `SignedBeaconBlock`, and fork-specific names which match the superstruct variants, e.g. `SignedBeaconBlockMerge`.
This commit is contained in:
Michael Sproul
2023-07-31 01:53:05 +00:00
parent eafe08780c
commit b96cfcaaa4
4 changed files with 64 additions and 24 deletions

View File

@@ -968,7 +968,9 @@ fn run<T: EthSpec>(
.map_err(|e| format!("Failed to skip slots: {}", e))
}
("pretty-ssz", Some(matches)) => {
run_parse_ssz::<T>(matches).map_err(|e| format!("Failed to pretty print hex: {}", e))
let network_config = get_network_config()?;
run_parse_ssz::<T>(network_config, matches)
.map_err(|e| format!("Failed to pretty print hex: {}", e))
}
("deploy-deposit-contract", Some(matches)) => {
deploy_deposit_contract::run::<T>(env, matches)