structures

package
v0.7.4-0...-66d0465 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_structures_proto protoreflect.FileDescriptor

Functions

func GeneratePathProof

func GeneratePathProof(from, to *Node) []common.Hash

func GetConflictAncestor

func GetConflictAncestor(n1, n2 *Node) (*Node, *Node, error)
func Link(nd *Node, prev *Node) error

func NewExecutionAssertionStubFromAssertion

func NewExecutionAssertionStubFromAssertion(
	a *protocol.ExecutionAssertion,
	beforeInboxHash common.Hash,
	beforeLogsHash common.Hash,
	beforeMessagesHash common.Hash,
	inboxStack *MessageStack,
) *valprotocol.ExecutionAssertionStub

func NewExecutionAssertionStubFromWholeAssertion

func NewExecutionAssertionStubFromWholeAssertion(
	a *protocol.ExecutionAssertion,
	beforeInboxHash common.Hash,
	inboxStack *MessageStack,
) *valprotocol.ExecutionAssertionStub

Types

type ExecutionAssertionBuf

type ExecutionAssertionBuf struct {
	AfterHash    *common.HashBuf   `protobuf:"bytes,1,opt,name=afterHash,proto3" json:"afterHash,omitempty"`
	DidInboxInsn bool              `protobuf:"varint,2,opt,name=didInboxInsn,proto3" json:"didInboxInsn,omitempty"`
	NumGas       uint64            `protobuf:"varint,3,opt,name=numGas,proto3" json:"numGas,omitempty"`
	Messages     []*common.HashBuf `protobuf:"bytes,4,rep,name=messages,proto3" json:"messages,omitempty"`
	Logs         []*common.HashBuf `protobuf:"bytes,5,rep,name=logs,proto3" json:"logs,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecutionAssertionBuf) Descriptor deprecated

func (*ExecutionAssertionBuf) Descriptor() ([]byte, []int)

Deprecated: Use ExecutionAssertionBuf.ProtoReflect.Descriptor instead.

func (*ExecutionAssertionBuf) GetAfterHash

func (x *ExecutionAssertionBuf) GetAfterHash() *common.HashBuf

func (*ExecutionAssertionBuf) GetDidInboxInsn

func (x *ExecutionAssertionBuf) GetDidInboxInsn() bool

func (*ExecutionAssertionBuf) GetLogs

func (x *ExecutionAssertionBuf) GetLogs() []*common.HashBuf

func (*ExecutionAssertionBuf) GetMessages

func (x *ExecutionAssertionBuf) GetMessages() []*common.HashBuf

func (*ExecutionAssertionBuf) GetNumGas

func (x *ExecutionAssertionBuf) GetNumGas() uint64

func (*ExecutionAssertionBuf) ProtoMessage

func (*ExecutionAssertionBuf) ProtoMessage()

func (*ExecutionAssertionBuf) ProtoReflect

func (x *ExecutionAssertionBuf) ProtoReflect() protoreflect.Message

func (*ExecutionAssertionBuf) Reset

func (x *ExecutionAssertionBuf) Reset()

func (*ExecutionAssertionBuf) String

func (x *ExecutionAssertionBuf) String() string

type Inbox

type Inbox struct {
	*MessageStack
}

func NewInbox

func NewInbox() *Inbox

func (*Inbox) DiscardUpToCount

func (pi *Inbox) DiscardUpToCount(count *big.Int)

func (*Inbox) Equals

func (pi *Inbox) Equals(pi2 *Inbox) bool

type InboxBuf

type InboxBuf struct {
	TopCount   *common.BigIntegerBuf `protobuf:"bytes,1,opt,name=topCount,proto3" json:"topCount,omitempty"`
	Items      []*common.HashBuf     `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"`
	HashOfRest *common.HashBuf       `protobuf:"bytes,3,opt,name=hashOfRest,proto3" json:"hashOfRest,omitempty"`
	// contains filtered or unexported fields
}

func (*InboxBuf) Descriptor deprecated

func (*InboxBuf) Descriptor() ([]byte, []int)

Deprecated: Use InboxBuf.ProtoReflect.Descriptor instead.

func (*InboxBuf) GetHashOfRest

func (x *InboxBuf) GetHashOfRest() *common.HashBuf

func (*InboxBuf) GetItems

func (x *InboxBuf) GetItems() []*common.HashBuf

func (*InboxBuf) GetTopCount

func (x *InboxBuf) GetTopCount() *common.BigIntegerBuf

func (*InboxBuf) ProtoMessage

func (*InboxBuf) ProtoMessage()

func (*InboxBuf) ProtoReflect

func (x *InboxBuf) ProtoReflect() protoreflect.Message

func (*InboxBuf) Reset

func (x *InboxBuf) Reset()

func (*InboxBuf) String

func (x *InboxBuf) String() string

func (*InboxBuf) UnmarshalFromCheckpoint

func (x *InboxBuf) UnmarshalFromCheckpoint(ctx ckptcontext.RestoreContext) (*MessageStack, error)

type MessageStack

type MessageStack struct {
	// contains filtered or unexported fields
}

func NewMessageStack

func NewMessageStack() *MessageStack

func NewRandomMessageStack

func NewRandomMessageStack(count int) *MessageStack

func (*MessageStack) DeliverMessage

func (ms *MessageStack) DeliverMessage(msg inbox.InboxMessage) error

func (*MessageStack) Equals

func (ms *MessageStack) Equals(ms2 *MessageStack) bool

func (*MessageStack) GenerateBisection

func (ms *MessageStack) GenerateBisection(startItemHash common.Hash, segments, count uint64) ([]common.Hash, error)

func (*MessageStack) GetAllMessages

func (ms *MessageStack) GetAllMessages() []inbox.InboxMessage

func (*MessageStack) GetAllMessagesAfter

func (ms *MessageStack) GetAllMessagesAfter(olderAcc common.Hash) ([]inbox.InboxMessage, error)

func (*MessageStack) GetAssertionMessages

func (ms *MessageStack) GetAssertionMessages(beforeInboxHash common.Hash, afterInboxHash common.Hash) ([]inbox.InboxMessage, error)

func (*MessageStack) GetHashAtIndex

func (ms *MessageStack) GetHashAtIndex(height *big.Int) (common.Hash, error)

func (*MessageStack) GetMaxAtHeight

func (ms *MessageStack) GetMaxAtHeight(maxHeight *common.TimeBlocks) (bool, *big.Int)

func (*MessageStack) GetMessages

func (ms *MessageStack) GetMessages(olderAcc common.Hash, count uint64) ([]inbox.InboxMessage, error)

func (*MessageStack) GetTopHash

func (ms *MessageStack) GetTopHash() common.Hash

func (*MessageStack) InboxMessageAfter

func (ms *MessageStack) InboxMessageAfter(startItemHash common.Hash) (inbox.InboxMessage, error)

func (*MessageStack) MarshalForCheckpoint

func (ms *MessageStack) MarshalForCheckpoint(ctx *ckptcontext.CheckpointContext) *InboxBuf

func (*MessageStack) String

func (ms *MessageStack) String() string

func (*MessageStack) TopCount

func (ms *MessageStack) TopCount() *big.Int

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewInitialNode

func NewInitialNode(mach machine.Machine) *Node

func NewInvalidNodeFromPrev

func NewInvalidNodeFromPrev(
	prev *Node,
	disputable *valprotocol.DisputableNode,
	kind valprotocol.ChildType,
	params valprotocol.ChainParams,
	currentTime *common.TimeBlocks,
) *Node

func NewNodeFromPrev

func NewNodeFromPrev(
	prev *Node,
	disputable *valprotocol.DisputableNode,
	kind valprotocol.ChildType,
	params valprotocol.ChainParams,
	currentTime *common.TimeBlocks,
	vmProtoData *valprotocol.VMProtoData,
) *Node

func NewRandomInvalidNodeFromValidPrev

func NewRandomInvalidNodeFromValidPrev(prev *Node, stub *valprotocol.ExecutionAssertionStub, kind valprotocol.ChildType, params valprotocol.ChainParams) *Node

func NewRandomNodeFromValidPrev

func NewRandomNodeFromValidPrev(prev *Node, inboxStack *MessageStack, messageCount uint64) *Node

func NewValidNodeFromPrev

func NewValidNodeFromPrev(
	prev *Node,
	disputable *valprotocol.DisputableNode,
	params valprotocol.ChainParams,
	currentTime *common.TimeBlocks,
) *Node

func (*Node) AddStaker

func (node *Node) AddStaker()

func (*Node) Assertion

func (node *Node) Assertion() *protocol.ExecutionAssertion

func (*Node) ChallengeNodeData

func (node *Node) ChallengeNodeData(params valprotocol.ChainParams) (common.Hash, common.TimeTicks)

func (*Node) ClearPrev

func (node *Node) ClearPrev()

func (*Node) Deadline

func (node *Node) Deadline() common.TimeTicks

func (*Node) Depth

func (node *Node) Depth() uint64

func (*Node) Disputable

func (node *Node) Disputable() *valprotocol.DisputableNode

func (*Node) Equals

func (node *Node) Equals(node2 *Node) bool

func (*Node) EqualsFull

func (node *Node) EqualsFull(n2 *Node) bool

func (*Node) HasAncestor

func (node *Node) HasAncestor() bool

func (*Node) Hash

func (node *Node) Hash() common.Hash

func (*Node) LinkSuccessor

func (node *Node) LinkSuccessor(successor *Node) error

func (*Node) LinkType

func (node *Node) LinkType() valprotocol.ChildType

func (*Node) Machine

func (node *Node) Machine() machine.Machine

func (*Node) MarshalForCheckpoint

func (node *Node) MarshalForCheckpoint(ctx *ckptcontext.CheckpointContext, includeMachine bool) *NodeBuf

func (*Node) NodeDataHash

func (node *Node) NodeDataHash() common.Hash

func (*Node) NumStakers

func (node *Node) NumStakers() uint64

func (*Node) Prev

func (node *Node) Prev() *Node

func (*Node) PrevHash

func (node *Node) PrevHash() common.Hash

func (*Node) RemoveStaker

func (node *Node) RemoveStaker()

func (*Node) String

func (node *Node) String() string

func (*Node) SuccessorHashes

func (node *Node) SuccessorHashes() [valprotocol.MaxChildType + 1]common.Hash

func (*Node) UnlinkPrev

func (node *Node) UnlinkPrev() bool

func (*Node) UpdateInvalidOpinion

func (node *Node) UpdateInvalidOpinion() error

func (*Node) UpdateValidOpinion

func (node *Node) UpdateValidOpinion(machine machine.Machine, assertion *protocol.ExecutionAssertion) error

func (*Node) VMProtoData

func (node *Node) VMProtoData() *valprotocol.VMProtoData

type NodeBuf

type NodeBuf struct {
	PrevHash       *common.HashBuf                `protobuf:"bytes,1,opt,name=prevHash,proto3" json:"prevHash,omitempty"`
	Deadline       *common.TimeTicksBuf           `protobuf:"bytes,2,opt,name=deadline,proto3" json:"deadline,omitempty"`
	DisputableNode *valprotocol.DisputableNodeBuf `protobuf:"bytes,3,opt,name=disputableNode,proto3" json:"disputableNode,omitempty"`
	LinkType       uint32                         `protobuf:"varint,4,opt,name=linkType,proto3" json:"linkType,omitempty"`
	VmProtoData    *valprotocol.VMProtoDataBuf    `protobuf:"bytes,5,opt,name=vmProtoData,proto3" json:"vmProtoData,omitempty"`
	MachineHash    *common.HashBuf                `protobuf:"bytes,6,opt,name=machineHash,proto3" json:"machineHash,omitempty"`
	Assertion      *protocol.ExecutionAssertion   `protobuf:"bytes,7,opt,name=assertion,proto3" json:"assertion,omitempty"`
	Depth          uint64                         `protobuf:"varint,8,opt,name=depth,proto3" json:"depth,omitempty"`
	NodeDataHash   *common.HashBuf                `protobuf:"bytes,9,opt,name=nodeDataHash,proto3" json:"nodeDataHash,omitempty"`
	InnerHash      *common.HashBuf                `protobuf:"bytes,10,opt,name=innerHash,proto3" json:"innerHash,omitempty"`
	Hash           *common.HashBuf                `protobuf:"bytes,11,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeBuf) Descriptor deprecated

func (*NodeBuf) Descriptor() ([]byte, []int)

Deprecated: Use NodeBuf.ProtoReflect.Descriptor instead.

func (*NodeBuf) GetAssertion

func (x *NodeBuf) GetAssertion() *protocol.ExecutionAssertion

func (*NodeBuf) GetDeadline

func (x *NodeBuf) GetDeadline() *common.TimeTicksBuf

func (*NodeBuf) GetDepth

func (x *NodeBuf) GetDepth() uint64

func (*NodeBuf) GetDisputableNode

func (x *NodeBuf) GetDisputableNode() *valprotocol.DisputableNodeBuf

func (*NodeBuf) GetHash

func (x *NodeBuf) GetHash() *common.HashBuf

func (*NodeBuf) GetInnerHash

func (x *NodeBuf) GetInnerHash() *common.HashBuf

func (*NodeBuf) GetLinkType

func (x *NodeBuf) GetLinkType() uint32

func (*NodeBuf) GetMachineHash

func (x *NodeBuf) GetMachineHash() *common.HashBuf

func (*NodeBuf) GetNodeDataHash

func (x *NodeBuf) GetNodeDataHash() *common.HashBuf

func (*NodeBuf) GetPrevHash

func (x *NodeBuf) GetPrevHash() *common.HashBuf

func (*NodeBuf) GetVmProtoData

func (x *NodeBuf) GetVmProtoData() *valprotocol.VMProtoDataBuf

func (*NodeBuf) ProtoMessage

func (*NodeBuf) ProtoMessage()

func (*NodeBuf) ProtoReflect

func (x *NodeBuf) ProtoReflect() protoreflect.Message

func (*NodeBuf) Reset

func (x *NodeBuf) Reset()

func (*NodeBuf) String

func (x *NodeBuf) String() string

func (*NodeBuf) UnmarshalFromCheckpoint

func (x *NodeBuf) UnmarshalFromCheckpoint(ctx ckptcontext.RestoreContext) (*Node, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL