**What type of PR is this?** Optimisation **What does this PR do? Why is it needed?** Use `InitializeFromProtoUnsafeXXX` instead of `InitializeFromProtoXXX` when possible. (@nisdas' change) This change avoids useless copies. The difference between these two methods is the latest copies the input state. However, if the input state is guaranteed not to be modified after the use of this function (and, in particular, if the input state is not used at all after the use of this function), then copying it is unnecessarry. ==> Using the "unsafe" method is fine in this case. **Other notes for review** As a reviewer, you should ensure that when the unsafe method is used, then the input state is never modified after the use of the function. This PR is much easier to review directly in VSCode, because it displays more context by default. **Acknowledgements** - [x] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md). - [x] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd). - [x] I have added a description with sufficient context for reviewers to understand this PR. - [x] I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).
Pcli (Prysm CLI)
This is a utility to help users perform Ethereum consensus specific commands.
Usage
Name:
pcli - A command line utility to run Ethereum consensus specific commands
Usage:
pcli [global options] command [command options] [arguments...]
Commands: help, h Shows a list of commands or help for one command state-transition: state-transition Subcommand to run manual state transitions
Flags:
--help, -h show help (default: false)
--version, -v print the version (default: false)
State Transition Subcommand: pcli state-transition - Subcommand to run manual state transitions
State Transition Usage:: pcli state-transition [command options] [arguments...]
State Transition Flags: --block-path value Path to block file(ssz) --pre-state-patch value Path to pre state file(ssz) --expected-post-state-path value Path to expected post state file(ssz) --help, -h show help (default: false)
Example
To use pcli manual state transition:
bazel run //tools/pcli:pcli -- state-transition --block-path /path/to/block.ssz --pre-state-path /path/to/state.ssz