mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 05:52:45 +00:00
9a3db7a81f
* Initial implementation of runtime bls skipping. Add libnfuzz skipBLSValidation handling, check that it propagates. * Rename skipBLSValidation -> skipBlsValidation, start skipStateRootValidation * Replace skipValidation flags with more granular flags. Also added skipBlockParentRootValidation flag Mainly replaced with skipBlsValidation but also StateRoot or BlockParentRootValidation flags where appropriate. * Adjust interop test to pass when skipping merkle validation. * Stop skipping validation for mainchain_monitor. * Remove comment. * Also skipMerkleValidation for test_beacon_chain_db.
17 lines
566 B
Nim
17 lines
566 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, BeaconState)
|
|
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):
|
|
error "State transition failed"
|
|
|
|
SSZ.saveFile(post, stateY.data)
|