Documentation
¶
Index ¶
Constants ¶
View Source
const ( MiB = 1024 * 1024 DefaultMaxMessageSize = 2 * MiB MaxContainersLen = int(4 * DefaultMaxMessageSize / 5) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VMBlock ¶
type VMBlock interface {
// Digest returns a succinct representation of this block.
Digest() [32]byte
// Height returns the height of this block in the chain.
Height() uint64
// Time this block was proposed at. This value should be consistent across
// all nodes. If this block hasn't been successfully verified, any value can
// be returned. If this block is the last accepted block, the timestamp must
// be returned correctly. Otherwise, accepted blocks can return any value.
Timestamp() time.Time
// Verify that the state transition this block would make if accepted is
// valid. If the state transition is invalid, a non-nil error should be
// returned.
//
// It is guaranteed that the Parent has been successfully verified.
//
// If nil is returned, it is guaranteed that either Accept or Reject will be
// called on this block, unless the VM is shut down.
Verify(ctx context.Context, pChainHeight uint64) error
// Bytes returns the byte representation of this block.
Bytes() []byte
}
Click to show internal directories.
Click to hide internal directories.