ethvalidator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateVMHash

func CreateVMHash(data *CreateVMValidatorRequest) [32]byte

func LogProof

func LogProof(a *protocol.Assertion, index int) ([][32]byte, error)

func UnanimousAssertHash

func UnanimousAssertHash(
	vmId [32]byte,
	sequenceNum uint64,
	beforeHash [32]byte,
	timeBounds protocol.TimeBounds,
	newInboxHash [32]byte,
	originalInboxHash [32]byte,
	assertion *protocol.Assertion,
) ([32]byte, error)

Types

type ArbAddresses

type ArbAddresses struct {
	TrackerAddress        string `json:"vmTracker"`
	ChallengeAddress      string `json:"ChallengeManager"`
	OneStepAddress        string `json:"OneStepProof"`
	BalanceTrackerAddress string `json:"balanceTracker"`
}

type Client

type Client struct {
	ToClient   chan *ValidatorRequest
	FromClient chan *FollowerResponse

	Address common.Address
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cm *ClientManager, conn *websocket.Conn, address common.Address) *Client

type ClientManager

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

func NewClientManager

func NewClientManager(key *ecdsa.PrivateKey, vmId [32]byte, validators map[common.Address]validatorInfo) *ClientManager

func (*ClientManager) Run

func (m *ClientManager) Run()

func (*ClientManager) RunServer

func (m *ClientManager) RunServer() error

func (*ClientManager) WaitForFollowers

func (m *ClientManager) WaitForFollowers(timeout time.Duration) bool

type CoordinatorCreateRequest

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

type CoordinatorDisputableRequest

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

type CoordinatorUnanimousRequest

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

type CreateVMFinalizedValidatorNotification

type CreateVMFinalizedValidatorNotification struct {
	Approved             bool     `protobuf:"varint,1,opt,name=approved,proto3" json:"approved,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CreateVMFinalizedValidatorNotification) Descriptor

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

func (*CreateVMFinalizedValidatorNotification) GetApproved

func (*CreateVMFinalizedValidatorNotification) ProtoMessage

func (*CreateVMFinalizedValidatorNotification) Reset

func (*CreateVMFinalizedValidatorNotification) String

func (*CreateVMFinalizedValidatorNotification) XXX_DiscardUnknown

func (m *CreateVMFinalizedValidatorNotification) XXX_DiscardUnknown()

func (*CreateVMFinalizedValidatorNotification) XXX_Marshal

func (m *CreateVMFinalizedValidatorNotification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateVMFinalizedValidatorNotification) XXX_Merge

func (*CreateVMFinalizedValidatorNotification) XXX_Size

func (*CreateVMFinalizedValidatorNotification) XXX_Unmarshal

func (m *CreateVMFinalizedValidatorNotification) XXX_Unmarshal(b []byte) error

type CreateVMFollowerResponse

type CreateVMFollowerResponse struct {
	Accepted             bool       `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
	Signature            *Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*CreateVMFollowerResponse) Descriptor

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

func (*CreateVMFollowerResponse) GetAccepted

func (m *CreateVMFollowerResponse) GetAccepted() bool

func (*CreateVMFollowerResponse) GetSignature

func (m *CreateVMFollowerResponse) GetSignature() *Signature

func (*CreateVMFollowerResponse) ProtoMessage

func (*CreateVMFollowerResponse) ProtoMessage()

func (*CreateVMFollowerResponse) Reset

func (m *CreateVMFollowerResponse) Reset()

func (*CreateVMFollowerResponse) String

func (m *CreateVMFollowerResponse) String() string

func (*CreateVMFollowerResponse) XXX_DiscardUnknown

func (m *CreateVMFollowerResponse) XXX_DiscardUnknown()

func (*CreateVMFollowerResponse) XXX_Marshal

func (m *CreateVMFollowerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateVMFollowerResponse) XXX_Merge

func (m *CreateVMFollowerResponse) XXX_Merge(src proto.Message)

func (*CreateVMFollowerResponse) XXX_Size

func (m *CreateVMFollowerResponse) XXX_Size() int

func (*CreateVMFollowerResponse) XXX_Unmarshal

func (m *CreateVMFollowerResponse) XXX_Unmarshal(b []byte) error

type CreateVMValidatorRequest

type CreateVMValidatorRequest struct {
	Config               *valmessage.VMConfiguration `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	VmId                 *value.HashBuf              `protobuf:"bytes,2,opt,name=vm_id,json=vmId,proto3" json:"vm_id,omitempty"`
	VmState              *value.HashBuf              `protobuf:"bytes,3,opt,name=vm_state,json=vmState,proto3" json:"vm_state,omitempty"`
	ChallengeManagerNum  uint32                      `protobuf:"varint,4,opt,name=challengeManagerNum,proto3" json:"challengeManagerNum,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (*CreateVMValidatorRequest) Descriptor

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

func (*CreateVMValidatorRequest) GetChallengeManagerNum

func (m *CreateVMValidatorRequest) GetChallengeManagerNum() uint32

func (*CreateVMValidatorRequest) GetConfig

func (*CreateVMValidatorRequest) GetVmId

func (m *CreateVMValidatorRequest) GetVmId() *value.HashBuf

func (*CreateVMValidatorRequest) GetVmState

func (m *CreateVMValidatorRequest) GetVmState() *value.HashBuf

func (*CreateVMValidatorRequest) ProtoMessage

func (*CreateVMValidatorRequest) ProtoMessage()

func (*CreateVMValidatorRequest) Reset

func (m *CreateVMValidatorRequest) Reset()

func (*CreateVMValidatorRequest) String

func (m *CreateVMValidatorRequest) String() string

func (*CreateVMValidatorRequest) XXX_DiscardUnknown

func (m *CreateVMValidatorRequest) XXX_DiscardUnknown()

func (*CreateVMValidatorRequest) XXX_Marshal

func (m *CreateVMValidatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateVMValidatorRequest) XXX_Merge

func (m *CreateVMValidatorRequest) XXX_Merge(src proto.Message)

func (*CreateVMValidatorRequest) XXX_Size

func (m *CreateVMValidatorRequest) XXX_Size() int

func (*CreateVMValidatorRequest) XXX_Unmarshal

func (m *CreateVMValidatorRequest) XXX_Unmarshal(b []byte) error

type EthConnection

type EthConnection struct {
	Tracker        *verifierRPC.VMTracker
	Challenge      *challengeRPC.ChallengeManager
	OneStep        *challengeRPC.OneStepProof
	BalanceTracker *verifierRPC.ArbBalanceTracker
	// contains filtered or unexported fields
}

func NewEthConnection

func NewEthConnection(serverAddress string, a ArbAddresses) (*EthConnection, error)

func (*EthConnection) AsserterTimedOutChallenge

func (con *EthConnection) AsserterTimedOutChallenge(
	auth *bind.TransactOpts,
	vmId [32]byte,
	bisectionHash [32]byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthConnection) BisectChallenge

func (con *EthConnection) BisectChallenge(
	auth *bind.TransactOpts,
	vmId [32]byte,
	deadline uint64,
	precondition *protocol.Precondition,
	assertions []*protocol.Assertion,
) (*types.Transaction, error)

func (*EthConnection) ConfirmAsserted

func (con *EthConnection) ConfirmAsserted(
	auth *bind.TransactOpts,
	vmId [32]byte,
	precondition *protocol.Precondition,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthConnection) ConfirmUnanimousAsserted

func (con *EthConnection) ConfirmUnanimousAsserted(
	auth *bind.TransactOpts,
	vmId [32]byte,
	newInboxHash [32]byte,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthConnection) ContinueChallenge

func (con *EthConnection) ContinueChallenge(
	auth *bind.TransactOpts,
	vmId [32]byte,
	assertionToChallenge *big.Int,
	bisectionProof []byte,
	bisectionRoot [32]byte,
	bisectionHash [32]byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthConnection) CreateListeners

func (con *EthConnection) CreateListeners(vmId [32]byte) (chan interface{}, chan error, error)

func (*EthConnection) CreateVM

func (con *EthConnection) CreateVM(
	auth *bind.TransactOpts,
	data *CreateVMValidatorRequest,
	messageHash [32]byte,
	signatures []valmessage.Signature,
) (*types.Transaction, error)

func (*EthConnection) DepositFunds

func (con *EthConnection) DepositFunds(auth *bind.TransactOpts, amount *big.Int, dest [32]byte) (*types.Transaction, error)

func (*EthConnection) DisputableAssert

func (con *EthConnection) DisputableAssert(
	auth *bind.TransactOpts,
	vmId [32]byte,
	precondition *protocol.Precondition,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthConnection) InitiateChallenge

func (con *EthConnection) InitiateChallenge(
	auth *bind.TransactOpts,
	vmId [32]byte,
	precondition *protocol.Precondition,
	assertion *protocol.AssertionStub,
) (*types.Transaction, error)

func (*EthConnection) OneStepProof

func (con *EthConnection) OneStepProof(
	auth *bind.TransactOpts,
	vmId [32]byte,
	precondition *protocol.Precondition,
	assertion *protocol.AssertionStub,
	proof []byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthConnection) ProposeUnanimousAssert

func (con *EthConnection) ProposeUnanimousAssert(
	auth *bind.TransactOpts,
	vmId [32]byte,
	newInboxHash [32]byte,
	timeBounds protocol.TimeBounds,
	assertion *protocol.Assertion,
	sequenceNum uint64,
	signatures []valmessage.Signature,
) (*types.Transaction, error)

func (*EthConnection) SendEthMessage

func (con *EthConnection) SendEthMessage(
	auth *bind.TransactOpts,
	data value.Value,
	destination [32]byte,
	amount *big.Int,
) (*types.Transaction, error)

func (*EthConnection) SendMessage

func (con *EthConnection) SendMessage(
	auth *bind.TransactOpts,
	msg protocol.Message,
) (*types.Transaction, error)

func (*EthConnection) UnanimousAssert

func (con *EthConnection) UnanimousAssert(
	auth *bind.TransactOpts,
	vmId [32]byte,
	newInboxHash [32]byte,
	timeBounds protocol.TimeBounds,
	assertion *protocol.Assertion,
	signatures []valmessage.Signature,
) (*types.Transaction, error)

type EthValidator

type EthValidator struct {

	// Safe public interface
	VmId              [32]byte
	Validators        map[common.Address]validatorInfo
	Bot               *validator.Validator
	CompletedCallChan chan valmessage.FinalizedAssertion
	// contains filtered or unexported fields
}

func NewEthValidator

func NewEthValidator(
	name string,
	vmId [32]byte,
	machine *vm.Machine,
	key *ecdsa.PrivateKey,
	config *valmessage.VMConfiguration,
	challengeEverything bool,
	connectionInfo ArbAddresses,
	ethURL string,
) (*EthValidator, error)

func (*EthValidator) Address

func (val *EthValidator) Address() common.Address

func (*EthValidator) AdvanceBlockchain

func (man *EthValidator) AdvanceBlockchain(blockCount int) error

func (*EthValidator) AsserterTimedOutChallenge

func (man *EthValidator) AsserterTimedOutChallenge(
	bisectionHash [32]byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthValidator) BisectChallenge

func (man *EthValidator) BisectChallenge(
	deadline uint64,
	precondition *protocol.Precondition,
	assertions []*protocol.Assertion,
) (*types.Transaction, error)

func (*EthValidator) ChallengerTimedOut

func (man *EthValidator) ChallengerTimedOut(
	bisectionRoot [32]byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthValidator) ConfirmAsserted

func (man *EthValidator) ConfirmAsserted(
	precondition *protocol.Precondition,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthValidator) ConfirmUnanimousAsserted

func (man *EthValidator) ConfirmUnanimousAsserted(
	newInboxHash [32]byte,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthValidator) ContinueChallenge

func (man *EthValidator) ContinueChallenge(
	assertionToChallenge *big.Int,
	bisectionProof []byte,
	bisectionRoot [32]byte,
	bisectionHash [32]byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthValidator) CreateVM

func (man *EthValidator) CreateVM(createData *CreateVMValidatorRequest, signatures []valmessage.Signature) (*types.Transaction, error)

func (*EthValidator) DepositEth

func (man *EthValidator) DepositEth(amount *big.Int) (*types.Transaction, error)

func (*EthValidator) DisputableAssert

func (man *EthValidator) DisputableAssert(
	precondition *protocol.Precondition,
	assertion *protocol.Assertion,
) (*types.Transaction, error)

func (*EthValidator) InitiateChallenge

func (man *EthValidator) InitiateChallenge(
	precondition *protocol.Precondition,
	assertion *protocol.AssertionStub,
) (*types.Transaction, error)

func (*EthValidator) OneStepProof

func (man *EthValidator) OneStepProof(
	precondition *protocol.Precondition,
	assertion *protocol.AssertionStub,
	proof []byte,
	deadline uint64,
) (*types.Transaction, error)

func (*EthValidator) ProposeUnanimousAssert

func (man *EthValidator) ProposeUnanimousAssert(
	newInboxHash [32]byte,
	timeBounds protocol.TimeBounds,
	assertion *protocol.Assertion,
	sequenceNum uint64,
	signatures []valmessage.Signature,
) (*types.Transaction, error)

func (*EthValidator) SendEthMessage

func (man *EthValidator) SendEthMessage(
	data value.Value,
	amount *big.Int,
) (*types.Transaction, error)

func (*EthValidator) SendMessage

func (man *EthValidator) SendMessage(data value.Value, tokenType [21]byte, currency *big.Int) (*types.Transaction, error)

func (*EthValidator) Sign

func (man *EthValidator) Sign(msgHash [32]byte) (valmessage.Signature, error)

func (*EthValidator) StartListening

func (man *EthValidator) StartListening() error

func (*EthValidator) UnanimousAssert

func (man *EthValidator) UnanimousAssert(
	newInboxHash [32]byte,
	timeBounds protocol.TimeBounds,
	assertion *protocol.Assertion,
	signatures []valmessage.Signature,
) (*types.Transaction, error)

func (*EthValidator) UnanimousAssertHash

func (man *EthValidator) UnanimousAssertHash(
	sequenceNum uint64,
	beforeHash [32]byte,
	timeBounds protocol.TimeBounds,
	newInboxHash [32]byte,
	originalInboxHash [32]byte,
	assertion *protocol.Assertion,
) ([32]byte, error)

func (*EthValidator) ValidatorCount

func (val *EthValidator) ValidatorCount() int

type FollowerResponse

type FollowerResponse struct {
	RequestId *value.HashBuf `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Types that are valid to be assigned to Response:
	//	*FollowerResponse_Create
	//	*FollowerResponse_Unanimous
	Response             isFollowerResponse_Response `protobuf_oneof:"response"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (*FollowerResponse) Descriptor

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

func (*FollowerResponse) GetCreate

func (*FollowerResponse) GetRequestId

func (m *FollowerResponse) GetRequestId() *value.HashBuf

func (*FollowerResponse) GetResponse

func (m *FollowerResponse) GetResponse() isFollowerResponse_Response

func (*FollowerResponse) GetUnanimous

func (*FollowerResponse) ProtoMessage

func (*FollowerResponse) ProtoMessage()

func (*FollowerResponse) Reset

func (m *FollowerResponse) Reset()

func (*FollowerResponse) String

func (m *FollowerResponse) String() string

func (*FollowerResponse) XXX_DiscardUnknown

func (m *FollowerResponse) XXX_DiscardUnknown()

func (*FollowerResponse) XXX_Marshal

func (m *FollowerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FollowerResponse) XXX_Merge

func (m *FollowerResponse) XXX_Merge(src proto.Message)

func (*FollowerResponse) XXX_OneofWrappers

func (*FollowerResponse) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*FollowerResponse) XXX_Size

func (m *FollowerResponse) XXX_Size() int

func (*FollowerResponse) XXX_Unmarshal

func (m *FollowerResponse) XXX_Unmarshal(b []byte) error

type FollowerResponse_Create

type FollowerResponse_Create struct {
	Create *CreateVMFollowerResponse `protobuf:"bytes,2,opt,name=create,proto3,oneof"`
}

type FollowerResponse_Unanimous

type FollowerResponse_Unanimous struct {
	Unanimous *UnanimousAssertionFollowerResponse `protobuf:"bytes,3,opt,name=unanimous,proto3,oneof"`
}

type GatherSignatureRequest

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

type LabeledFollowerResponse

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

type MerkleTree

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

func NewMerkleTree

func NewMerkleTree(elements [][32]byte) *MerkleTree

func (*MerkleTree) GetNode

func (m *MerkleTree) GetNode(index int) [32]byte

func (*MerkleTree) GetProof

func (m *MerkleTree) GetProof(index int) [][32]byte

func (*MerkleTree) GetProofFlat

func (m *MerkleTree) GetProofFlat(index int) []byte

func (*MerkleTree) GetRoot

func (m *MerkleTree) GetRoot() [32]byte

type MessageProcessingQueue

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

func NewMessageProcessingQueue

func NewMessageProcessingQueue() *MessageProcessingQueue

func (*MessageProcessingQueue) Fetch

func (m *MessageProcessingQueue) Fetch() chan []OffchainMessage

func (*MessageProcessingQueue) HasMessages

func (m *MessageProcessingQueue) HasMessages() chan bool

func (*MessageProcessingQueue) Return

func (m *MessageProcessingQueue) Return(messages []OffchainMessage)

func (*MessageProcessingQueue) Send

func (m *MessageProcessingQueue) Send(message OffchainMessage)

type OffchainMessage

type OffchainMessage struct {
	Message   protocol.Message
	Signature []byte
}

type Signature

type Signature struct {
	R                    *value.HashBuf `protobuf:"bytes,1,opt,name=r,proto3" json:"r,omitempty"`
	S                    *value.HashBuf `protobuf:"bytes,2,opt,name=s,proto3" json:"s,omitempty"`
	V                    uint32         `protobuf:"varint,3,opt,name=v,proto3" json:"v,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*Signature) Descriptor

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

func (*Signature) GetR

func (m *Signature) GetR() *value.HashBuf

func (*Signature) GetS

func (m *Signature) GetS() *value.HashBuf

func (*Signature) GetV

func (m *Signature) GetV() uint32

func (*Signature) ProtoMessage

func (*Signature) ProtoMessage()

func (*Signature) Reset

func (m *Signature) Reset()

func (*Signature) String

func (m *Signature) String() string

func (*Signature) XXX_DiscardUnknown

func (m *Signature) XXX_DiscardUnknown()

func (*Signature) XXX_Marshal

func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Signature) XXX_Merge

func (m *Signature) XXX_Merge(src proto.Message)

func (*Signature) XXX_Size

func (m *Signature) XXX_Size() int

func (*Signature) XXX_Unmarshal

func (m *Signature) XXX_Unmarshal(b []byte) error

type SignedMessage

type SignedMessage struct {
	Message              *protocol.MessageBuf `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Signature            []byte               `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (*SignedMessage) Descriptor

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

func (*SignedMessage) GetMessage

func (m *SignedMessage) GetMessage() *protocol.MessageBuf

func (*SignedMessage) GetSignature

func (m *SignedMessage) GetSignature() []byte

func (*SignedMessage) ProtoMessage

func (*SignedMessage) ProtoMessage()

func (*SignedMessage) Reset

func (m *SignedMessage) Reset()

func (*SignedMessage) String

func (m *SignedMessage) String() string

func (*SignedMessage) XXX_DiscardUnknown

func (m *SignedMessage) XXX_DiscardUnknown()

func (*SignedMessage) XXX_Marshal

func (m *SignedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SignedMessage) XXX_Merge

func (m *SignedMessage) XXX_Merge(src proto.Message)

func (*SignedMessage) XXX_Size

func (m *SignedMessage) XXX_Size() int

func (*SignedMessage) XXX_Unmarshal

func (m *SignedMessage) XXX_Unmarshal(b []byte) error

type UnanimousAssertionFollowerResponse

type UnanimousAssertionFollowerResponse struct {
	Accepted             bool           `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
	Signature            *Signature     `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	AssertionHash        *value.HashBuf `protobuf:"bytes,3,opt,name=assertion_hash,json=assertionHash,proto3" json:"assertion_hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*UnanimousAssertionFollowerResponse) Descriptor

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

func (*UnanimousAssertionFollowerResponse) GetAccepted

func (m *UnanimousAssertionFollowerResponse) GetAccepted() bool

func (*UnanimousAssertionFollowerResponse) GetAssertionHash

func (m *UnanimousAssertionFollowerResponse) GetAssertionHash() *value.HashBuf

func (*UnanimousAssertionFollowerResponse) GetSignature

func (m *UnanimousAssertionFollowerResponse) GetSignature() *Signature

func (*UnanimousAssertionFollowerResponse) ProtoMessage

func (*UnanimousAssertionFollowerResponse) ProtoMessage()

func (*UnanimousAssertionFollowerResponse) Reset

func (*UnanimousAssertionFollowerResponse) String

func (*UnanimousAssertionFollowerResponse) XXX_DiscardUnknown

func (m *UnanimousAssertionFollowerResponse) XXX_DiscardUnknown()

func (*UnanimousAssertionFollowerResponse) XXX_Marshal

func (m *UnanimousAssertionFollowerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnanimousAssertionFollowerResponse) XXX_Merge

func (*UnanimousAssertionFollowerResponse) XXX_Size

func (*UnanimousAssertionFollowerResponse) XXX_Unmarshal

func (m *UnanimousAssertionFollowerResponse) XXX_Unmarshal(b []byte) error

type UnanimousAssertionRequest

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

type UnanimousAssertionValidatorNotification

type UnanimousAssertionValidatorNotification struct {
	Accepted             bool         `protobuf:"varint,1,opt,name=accepted,proto3" json:"accepted,omitempty"`
	Signatures           []*Signature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (*UnanimousAssertionValidatorNotification) Descriptor

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

func (*UnanimousAssertionValidatorNotification) GetAccepted

func (*UnanimousAssertionValidatorNotification) GetSignatures

func (m *UnanimousAssertionValidatorNotification) GetSignatures() []*Signature

func (*UnanimousAssertionValidatorNotification) ProtoMessage

func (*UnanimousAssertionValidatorNotification) Reset

func (*UnanimousAssertionValidatorNotification) String

func (*UnanimousAssertionValidatorNotification) XXX_DiscardUnknown

func (m *UnanimousAssertionValidatorNotification) XXX_DiscardUnknown()

func (*UnanimousAssertionValidatorNotification) XXX_Marshal

func (m *UnanimousAssertionValidatorNotification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnanimousAssertionValidatorNotification) XXX_Merge

func (*UnanimousAssertionValidatorNotification) XXX_Size

func (*UnanimousAssertionValidatorNotification) XXX_Unmarshal

func (m *UnanimousAssertionValidatorNotification) XXX_Unmarshal(b []byte) error

type UnanimousAssertionValidatorRequest

type UnanimousAssertionValidatorRequest struct {
	BeforeHash           *value.HashBuf          `protobuf:"bytes,1,opt,name=beforeHash,proto3" json:"beforeHash,omitempty"`
	BeforeInbox          *value.HashBuf          `protobuf:"bytes,2,opt,name=beforeInbox,proto3" json:"beforeInbox,omitempty"`
	SequenceNum          uint64                  `protobuf:"varint,3,opt,name=sequenceNum,proto3" json:"sequenceNum,omitempty"`
	TimeBounds           *protocol.TimeBoundsBuf `protobuf:"bytes,4,opt,name=timeBounds,proto3" json:"timeBounds,omitempty"`
	SignedMessages       []*SignedMessage        `protobuf:"bytes,5,rep,name=signedMessages,proto3" json:"signedMessages,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (*UnanimousAssertionValidatorRequest) Descriptor

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

func (*UnanimousAssertionValidatorRequest) GetBeforeHash

func (m *UnanimousAssertionValidatorRequest) GetBeforeHash() *value.HashBuf

func (*UnanimousAssertionValidatorRequest) GetBeforeInbox

func (m *UnanimousAssertionValidatorRequest) GetBeforeInbox() *value.HashBuf

func (*UnanimousAssertionValidatorRequest) GetSequenceNum

func (m *UnanimousAssertionValidatorRequest) GetSequenceNum() uint64

func (*UnanimousAssertionValidatorRequest) GetSignedMessages

func (m *UnanimousAssertionValidatorRequest) GetSignedMessages() []*SignedMessage

func (*UnanimousAssertionValidatorRequest) GetTimeBounds

func (*UnanimousAssertionValidatorRequest) ProtoMessage

func (*UnanimousAssertionValidatorRequest) ProtoMessage()

func (*UnanimousAssertionValidatorRequest) Reset

func (*UnanimousAssertionValidatorRequest) String

func (*UnanimousAssertionValidatorRequest) XXX_DiscardUnknown

func (m *UnanimousAssertionValidatorRequest) XXX_DiscardUnknown()

func (*UnanimousAssertionValidatorRequest) XXX_Marshal

func (m *UnanimousAssertionValidatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UnanimousAssertionValidatorRequest) XXX_Merge

func (*UnanimousAssertionValidatorRequest) XXX_Size

func (*UnanimousAssertionValidatorRequest) XXX_Unmarshal

func (m *UnanimousAssertionValidatorRequest) XXX_Unmarshal(b []byte) error

type VMResponse

type VMResponse struct {
	Message protocol.Message
	Result  value.Value
	Proof   [][32]byte
}

type ValidatorCoordinator

type ValidatorCoordinator struct {
	Val *EthValidator
	// contains filtered or unexported fields
}

func NewValidatorCoordinator

func NewValidatorCoordinator(
	name string,
	machine *vm.Machine,
	key *ecdsa.PrivateKey,
	config *valmessage.VMConfiguration,
	challengeEverything bool,
	connectionInfo ArbAddresses,
	ethURL string,
) (*ValidatorCoordinator, error)

func (*ValidatorCoordinator) CreateVM

func (m *ValidatorCoordinator) CreateVM(timeout time.Duration) (chan bool, chan error)

func (*ValidatorCoordinator) InitiateDisputableAssertion

func (m *ValidatorCoordinator) InitiateDisputableAssertion() chan bool

func (*ValidatorCoordinator) InitiateUnanimousAssertion

func (m *ValidatorCoordinator) InitiateUnanimousAssertion(final bool) (chan bool, chan error)

func (*ValidatorCoordinator) Run

func (m *ValidatorCoordinator) Run()

func (*ValidatorCoordinator) SendMessage

func (m *ValidatorCoordinator) SendMessage(msg OffchainMessage)

type ValidatorFollower

type ValidatorFollower struct {
	*EthValidator

	FromCoordinator chan *ValidatorRequest
	ToCoordinator   chan *FollowerResponse
	// contains filtered or unexported fields
}

func NewValidatorFollower

func NewValidatorFollower(
	name string,
	machine *vm.Machine,
	key *ecdsa.PrivateKey,
	config *valmessage.VMConfiguration,
	challengeEverything bool,
	connectionInfo ArbAddresses,
	ethURL string,
	coordinatorURL string,
) (*ValidatorFollower, error)

func (*ValidatorFollower) HandleCreateVM

func (m *ValidatorFollower) HandleCreateVM(request *CreateVMValidatorRequest)

func (*ValidatorFollower) HandleUnanimousRequest

func (m *ValidatorFollower) HandleUnanimousRequest(
	request *UnanimousAssertionValidatorRequest,
	requestId [32]byte,
)

func (*ValidatorFollower) Run

func (m *ValidatorFollower) Run() error

type ValidatorLeaderRequest

type ValidatorLeaderRequest interface {
}

type ValidatorRequest

type ValidatorRequest struct {
	RequestId *value.HashBuf `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Types that are valid to be assigned to Request:
	//	*ValidatorRequest_Unanimous
	//	*ValidatorRequest_UnanimousNotification
	//	*ValidatorRequest_Create
	//	*ValidatorRequest_CreateNotification
	Request              isValidatorRequest_Request `protobuf_oneof:"request"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

func (*ValidatorRequest) Descriptor

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

func (*ValidatorRequest) GetCreate

func (*ValidatorRequest) GetCreateNotification

func (m *ValidatorRequest) GetCreateNotification() *CreateVMFinalizedValidatorNotification

func (*ValidatorRequest) GetRequest

func (m *ValidatorRequest) GetRequest() isValidatorRequest_Request

func (*ValidatorRequest) GetRequestId

func (m *ValidatorRequest) GetRequestId() *value.HashBuf

func (*ValidatorRequest) GetUnanimous

func (*ValidatorRequest) GetUnanimousNotification

func (m *ValidatorRequest) GetUnanimousNotification() *UnanimousAssertionValidatorNotification

func (*ValidatorRequest) ProtoMessage

func (*ValidatorRequest) ProtoMessage()

func (*ValidatorRequest) Reset

func (m *ValidatorRequest) Reset()

func (*ValidatorRequest) String

func (m *ValidatorRequest) String() string

func (*ValidatorRequest) XXX_DiscardUnknown

func (m *ValidatorRequest) XXX_DiscardUnknown()

func (*ValidatorRequest) XXX_Marshal

func (m *ValidatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorRequest) XXX_Merge

func (m *ValidatorRequest) XXX_Merge(src proto.Message)

func (*ValidatorRequest) XXX_OneofWrappers

func (*ValidatorRequest) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*ValidatorRequest) XXX_Size

func (m *ValidatorRequest) XXX_Size() int

func (*ValidatorRequest) XXX_Unmarshal

func (m *ValidatorRequest) XXX_Unmarshal(b []byte) error

type ValidatorRequest_Create

type ValidatorRequest_Create struct {
	Create *CreateVMValidatorRequest `protobuf:"bytes,4,opt,name=create,proto3,oneof"`
}

type ValidatorRequest_CreateNotification

type ValidatorRequest_CreateNotification struct {
	CreateNotification *CreateVMFinalizedValidatorNotification `protobuf:"bytes,5,opt,name=createNotification,proto3,oneof"`
}

type ValidatorRequest_Unanimous

type ValidatorRequest_Unanimous struct {
	Unanimous *UnanimousAssertionValidatorRequest `protobuf:"bytes,2,opt,name=unanimous,proto3,oneof"`
}

type ValidatorRequest_UnanimousNotification

type ValidatorRequest_UnanimousNotification struct {
	UnanimousNotification *UnanimousAssertionValidatorNotification `protobuf:"bytes,3,opt,name=unanimousNotification,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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