mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-24 20:28:33 +00:00
* rolls back some of the ref changes * adds utility to calculate stack sizes * works around bugs in nim exception handling and rvo
17 lines
594 B
Nim
17 lines
594 B
Nim
import
|
|
confutils, chronicles,
|
|
../beacon_chain/spec/[crypto, datatypes],
|
|
../beacon_chain/[extras, state_transition, ssz]
|
|
|
|
cli do(pre: string, blck: string, post: string, verifyStateRoot = false):
|
|
let
|
|
stateX = SSZ.loadFile(pre, BeaconStateRef)
|
|
blckX = SSZ.loadFile(blck, SignedBeaconBlock)
|
|
flags = if verifyStateRoot: {skipStateRootValidation} else: {}
|
|
|
|
var stateY = HashedBeaconState(data: stateX[], root: hash_tree_root(stateX[]))
|
|
if not state_transition(stateY, blckX, flags, noRollback):
|
|
error "State transition failed"
|
|
else:
|
|
SSZ.saveFile(post, stateY.data)
|