2018-11-29 05:23:40 +00:00
|
|
|
# beacon_chain
|
|
|
|
# Copyright (c) 2018 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
2019-11-25 15:30:02 +00:00
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
2018-11-29 05:23:40 +00:00
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
# Temporary dumping ground for extra types and helpers that could make it into
|
|
|
|
# the spec potentially
|
|
|
|
|
2018-12-27 23:40:22 +00:00
|
|
|
# TOdO
|
|
|
|
|
|
|
|
type
|
|
|
|
UpdateFlag* = enum
|
|
|
|
skipValidation ##\
|
|
|
|
## The `skipValidation` flag is used to skip over certain checks that are
|
|
|
|
## normally done when an untrusted block arrives from the network. The
|
|
|
|
## primary use case for this flag is when a proposer must propose a new
|
|
|
|
## block - in order to do so, it needs to update the state as if the block
|
|
|
|
## was valid, before it can sign it.
|
2019-03-28 17:06:43 +00:00
|
|
|
nextSlot ##\
|
|
|
|
## Perform the operation as if the next slot was being processed - this is
|
|
|
|
## useful when using the state to verify data that will go in the next slot,
|
|
|
|
## for example when proposing
|
|
|
|
## TODO need to be careful here, easy to assume that slot number change is
|
|
|
|
## enough, vs advancing the state - however, making a full state copy
|
|
|
|
## is expensive also :/
|
2020-01-30 21:03:47 +00:00
|
|
|
skipMerkleValidation ##\
|
|
|
|
## When processing deposits, skip verifying the Merkle proof trees of each
|
|
|
|
## deposit. This is a holdover from both interop issues with the malformed
|
|
|
|
## proofs and, more currently, nim-beacon-chain's creation of proofs which
|
|
|
|
## are inconsistent with the current specification. Furthermore several of
|
|
|
|
## the mocking interfaces deliberately do not create Merkle proofs. Whilst
|
|
|
|
## this seems less than entirely justifiable, for now enable keeping those
|
|
|
|
## in place while minimizing the tech debt they create. One, in principle,
|
|
|
|
## should be able to remove this flag entirely. It is not intrinsically an
|
|
|
|
## expensive operation to perform.
|
2018-12-27 23:40:22 +00:00
|
|
|
|
|
|
|
UpdateFlags* = set[UpdateFlag]
|