admission_control

package
v0.0.0-...-3e61de0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAdmissionControl = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAdmissionControl   = fmt.Errorf("proto: integer overflow")
)
View Source
var AdmissionControlStatusCode_name = map[int32]string{
	0: "Accepted",
	1: "Blacklisted",
	2: "Rejected",
}
View Source
var AdmissionControlStatusCode_value = map[string]int32{
	"Accepted":    0,
	"Blacklisted": 1,
	"Rejected":    2,
}

Functions

func RegisterAdmissionControlServer

func RegisterAdmissionControlServer(s *grpc.Server, srv AdmissionControlServer)

Types

type AdmissionControlClient

type AdmissionControlClient interface {
	// Public API to submit transaction to a validator.
	SubmitTransaction(ctx context.Context, in *SubmitTransactionRequest, opts ...grpc.CallOption) (*SubmitTransactionResponse, error)
	// This API is used to update the client to the latest ledger version and
	// optionally also request 1..n other pieces of data.  This allows for batch
	// queries.  All queries return proofs that a client should check to validate
	// the data. Note that if a client only wishes to update to the latest
	// LedgerInfo and receive the proof of this latest version, they can simply
	// omit the requested_items (or pass an empty list)
	UpdateToLatestLedger(ctx context.Context, in *types.UpdateToLatestLedgerRequest, opts ...grpc.CallOption) (*types.UpdateToLatestLedgerResponse, error)
}

AdmissionControlClient is the client API for AdmissionControl service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAdmissionControlClient

func NewAdmissionControlClient(cc *grpc.ClientConn) AdmissionControlClient

type AdmissionControlServer

type AdmissionControlServer interface {
	// Public API to submit transaction to a validator.
	SubmitTransaction(context.Context, *SubmitTransactionRequest) (*SubmitTransactionResponse, error)
	// This API is used to update the client to the latest ledger version and
	// optionally also request 1..n other pieces of data.  This allows for batch
	// queries.  All queries return proofs that a client should check to validate
	// the data. Note that if a client only wishes to update to the latest
	// LedgerInfo and receive the proof of this latest version, they can simply
	// omit the requested_items (or pass an empty list)
	UpdateToLatestLedger(context.Context, *types.UpdateToLatestLedgerRequest) (*types.UpdateToLatestLedgerResponse, error)
}

AdmissionControlServer is the server API for AdmissionControl service.

type AdmissionControlStatus

type AdmissionControlStatus struct {
	Code    AdmissionControlStatusCode `protobuf:"varint,1,opt,name=code,proto3,enum=admission_control.AdmissionControlStatusCode" json:"code,omitempty"`
	Message string                     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
}

AC response status containing code and optionally an error message.

func (*AdmissionControlStatus) Descriptor

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

func (*AdmissionControlStatus) Equal

func (this *AdmissionControlStatus) Equal(that interface{}) bool

func (*AdmissionControlStatus) GetCode

func (*AdmissionControlStatus) GetMessage

func (m *AdmissionControlStatus) GetMessage() string

func (*AdmissionControlStatus) GoString

func (this *AdmissionControlStatus) GoString() string

func (*AdmissionControlStatus) Marshal

func (m *AdmissionControlStatus) Marshal() (dAtA []byte, err error)

func (*AdmissionControlStatus) MarshalTo

func (m *AdmissionControlStatus) MarshalTo(dAtA []byte) (int, error)

func (*AdmissionControlStatus) ProtoMessage

func (*AdmissionControlStatus) ProtoMessage()

func (*AdmissionControlStatus) Reset

func (m *AdmissionControlStatus) Reset()

func (*AdmissionControlStatus) Size

func (m *AdmissionControlStatus) Size() (n int)

func (*AdmissionControlStatus) String

func (this *AdmissionControlStatus) String() string

func (*AdmissionControlStatus) Unmarshal

func (m *AdmissionControlStatus) Unmarshal(dAtA []byte) error

func (*AdmissionControlStatus) XXX_DiscardUnknown

func (m *AdmissionControlStatus) XXX_DiscardUnknown()

func (*AdmissionControlStatus) XXX_Marshal

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

func (*AdmissionControlStatus) XXX_Merge

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

func (*AdmissionControlStatus) XXX_Size

func (m *AdmissionControlStatus) XXX_Size() int

func (*AdmissionControlStatus) XXX_Unmarshal

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

type AdmissionControlStatusCode

type AdmissionControlStatusCode int32

Additional statuses that are possible from admission control in addition to VM statuses.

const (
	// Validator accepted the transaction.
	Accepted AdmissionControlStatusCode = 0
	// The sender is blacklisted.
	Blacklisted AdmissionControlStatusCode = 1
	// The transaction is rejected, e.g. due to incorrect signature.
	Rejected AdmissionControlStatusCode = 2
)

func (AdmissionControlStatusCode) EnumDescriptor

func (AdmissionControlStatusCode) EnumDescriptor() ([]byte, []int)

func (AdmissionControlStatusCode) String

type SubmitTransactionRequest

type SubmitTransactionRequest struct {
	// Transaction signed by wallet.
	SignedTxn *types.SignedTransaction `protobuf:"bytes,1,opt,name=signed_txn,json=signedTxn,proto3" json:"signed_txn,omitempty"`
}

----------------------------------------------------------------------------- ---------------- Submit transaction ----------------------------------------------------------------------------- The request for transaction submission.

func (*SubmitTransactionRequest) Descriptor

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

func (*SubmitTransactionRequest) Equal

func (this *SubmitTransactionRequest) Equal(that interface{}) bool

func (*SubmitTransactionRequest) GetSignedTxn

func (*SubmitTransactionRequest) GoString

func (this *SubmitTransactionRequest) GoString() string

func (*SubmitTransactionRequest) Marshal

func (m *SubmitTransactionRequest) Marshal() (dAtA []byte, err error)

func (*SubmitTransactionRequest) MarshalTo

func (m *SubmitTransactionRequest) MarshalTo(dAtA []byte) (int, error)

func (*SubmitTransactionRequest) ProtoMessage

func (*SubmitTransactionRequest) ProtoMessage()

func (*SubmitTransactionRequest) Reset

func (m *SubmitTransactionRequest) Reset()

func (*SubmitTransactionRequest) Size

func (m *SubmitTransactionRequest) Size() (n int)

func (*SubmitTransactionRequest) String

func (this *SubmitTransactionRequest) String() string

func (*SubmitTransactionRequest) Unmarshal

func (m *SubmitTransactionRequest) Unmarshal(dAtA []byte) error

func (*SubmitTransactionRequest) XXX_DiscardUnknown

func (m *SubmitTransactionRequest) XXX_DiscardUnknown()

func (*SubmitTransactionRequest) XXX_Marshal

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

func (*SubmitTransactionRequest) XXX_Merge

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

func (*SubmitTransactionRequest) XXX_Size

func (m *SubmitTransactionRequest) XXX_Size() int

func (*SubmitTransactionRequest) XXX_Unmarshal

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

type SubmitTransactionResponse

type SubmitTransactionResponse struct {
	// The status of a transaction submission can either be a VM status, or
	// some other admission control/mempool specific status e.g. Blacklisted.
	//
	// Types that are valid to be assigned to Status:
	//	*SubmitTransactionResponse_VmStatus
	//	*SubmitTransactionResponse_AcStatus
	//	*SubmitTransactionResponse_MempoolStatus
	Status isSubmitTransactionResponse_Status `protobuf_oneof:"status"`
	// Public key(id) of the validator that processed this transaction
	ValidatorId []byte `protobuf:"bytes,4,opt,name=validator_id,json=validatorId,proto3" json:"validator_id,omitempty"`
}

The response for transaction submission.

How does a client know if their transaction was included? A response from the transaction submission only means that the transaction was successfully added to mempool, but not that it is guaranteed to be included in the chain. Each transaction should include an expiration time in the signed transaction. Let's call this T0. As a client, I submit my transaction to a validator. I now need to poll for the transaction I submitted. I can use the query that takes my account and sequence number. If I receive back that the transaction is completed, I will verify the proofs to ensure that this is the transaction I expected. If I receive a response that my transaction is not yet completed, I must check the latest timestamp in the ledgerInfo that I receive back from the query. If this time is greater than T0, I can be certain that my transaction will never be included. If this time is less than T0, I need to continue polling.

func (*SubmitTransactionResponse) Descriptor

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

func (*SubmitTransactionResponse) Equal

func (this *SubmitTransactionResponse) Equal(that interface{}) bool

func (*SubmitTransactionResponse) GetAcStatus

func (*SubmitTransactionResponse) GetMempoolStatus

func (*SubmitTransactionResponse) GetStatus

func (m *SubmitTransactionResponse) GetStatus() isSubmitTransactionResponse_Status

func (*SubmitTransactionResponse) GetValidatorId

func (m *SubmitTransactionResponse) GetValidatorId() []byte

func (*SubmitTransactionResponse) GetVmStatus

func (m *SubmitTransactionResponse) GetVmStatus() *types.VMStatus

func (*SubmitTransactionResponse) GoString

func (this *SubmitTransactionResponse) GoString() string

func (*SubmitTransactionResponse) Marshal

func (m *SubmitTransactionResponse) Marshal() (dAtA []byte, err error)

func (*SubmitTransactionResponse) MarshalTo

func (m *SubmitTransactionResponse) MarshalTo(dAtA []byte) (int, error)

func (*SubmitTransactionResponse) ProtoMessage

func (*SubmitTransactionResponse) ProtoMessage()

func (*SubmitTransactionResponse) Reset

func (m *SubmitTransactionResponse) Reset()

func (*SubmitTransactionResponse) Size

func (m *SubmitTransactionResponse) Size() (n int)

func (*SubmitTransactionResponse) String

func (this *SubmitTransactionResponse) String() string

func (*SubmitTransactionResponse) Unmarshal

func (m *SubmitTransactionResponse) Unmarshal(dAtA []byte) error

func (*SubmitTransactionResponse) XXX_DiscardUnknown

func (m *SubmitTransactionResponse) XXX_DiscardUnknown()

func (*SubmitTransactionResponse) XXX_Marshal

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

func (*SubmitTransactionResponse) XXX_Merge

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

func (*SubmitTransactionResponse) XXX_OneofFuncs

func (*SubmitTransactionResponse) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*SubmitTransactionResponse) XXX_Size

func (m *SubmitTransactionResponse) XXX_Size() int

func (*SubmitTransactionResponse) XXX_Unmarshal

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

type SubmitTransactionResponse_AcStatus

type SubmitTransactionResponse_AcStatus struct {
	AcStatus *AdmissionControlStatus `protobuf:"bytes,2,opt,name=ac_status,json=acStatus,proto3,oneof"`
}

func (*SubmitTransactionResponse_AcStatus) Equal

func (this *SubmitTransactionResponse_AcStatus) Equal(that interface{}) bool

func (*SubmitTransactionResponse_AcStatus) GoString

func (this *SubmitTransactionResponse_AcStatus) GoString() string

func (*SubmitTransactionResponse_AcStatus) MarshalTo

func (m *SubmitTransactionResponse_AcStatus) MarshalTo(dAtA []byte) (int, error)

func (*SubmitTransactionResponse_AcStatus) Size

func (*SubmitTransactionResponse_AcStatus) String

type SubmitTransactionResponse_MempoolStatus

type SubmitTransactionResponse_MempoolStatus struct {
	MempoolStatus *mempool.MempoolAddTransactionStatus `protobuf:"bytes,3,opt,name=mempool_status,json=mempoolStatus,proto3,oneof"`
}

func (*SubmitTransactionResponse_MempoolStatus) Equal

func (this *SubmitTransactionResponse_MempoolStatus) Equal(that interface{}) bool

func (*SubmitTransactionResponse_MempoolStatus) GoString

func (*SubmitTransactionResponse_MempoolStatus) MarshalTo

func (m *SubmitTransactionResponse_MempoolStatus) MarshalTo(dAtA []byte) (int, error)

func (*SubmitTransactionResponse_MempoolStatus) Size

func (*SubmitTransactionResponse_MempoolStatus) String

type SubmitTransactionResponse_VmStatus

type SubmitTransactionResponse_VmStatus struct {
	VmStatus *types.VMStatus `protobuf:"bytes,1,opt,name=vm_status,json=vmStatus,proto3,oneof"`
}

func (*SubmitTransactionResponse_VmStatus) Equal

func (this *SubmitTransactionResponse_VmStatus) Equal(that interface{}) bool

func (*SubmitTransactionResponse_VmStatus) GoString

func (this *SubmitTransactionResponse_VmStatus) GoString() string

func (*SubmitTransactionResponse_VmStatus) MarshalTo

func (m *SubmitTransactionResponse_VmStatus) MarshalTo(dAtA []byte) (int, error)

func (*SubmitTransactionResponse_VmStatus) Size

func (*SubmitTransactionResponse_VmStatus) String

type UnimplementedAdmissionControlServer

type UnimplementedAdmissionControlServer struct {
}

UnimplementedAdmissionControlServer can be embedded to have forward compatible implementations.

func (*UnimplementedAdmissionControlServer) SubmitTransaction

func (*UnimplementedAdmissionControlServer) UpdateToLatestLedger

Jump to

Keyboard shortcuts

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