diff --git a/pkg/core/common/accounts_test.go b/pkg/core/common/accounts_test.go index 0d8e3700..336aa767 100644 --- a/pkg/core/common/accounts_test.go +++ b/pkg/core/common/accounts_test.go @@ -18,8 +18,10 @@ func TestSignAndRecover(t *testing.T) { require.Nil(t, err) registerEvent := &core_proto.ValidatorRegistration{ - Endpoint: "http://road-to-uninode.audius.co", - CometAddress: "12345", + CometAddress: "12345", + DelegateWallet: "0xabcdef", + EthBlock: 20202, + Power: 10, } eventBytes, err := proto.Marshal(registerEvent) diff --git a/pkg/core/common/converters.go b/pkg/core/common/converters.go index 01f19d1a..8139d5b5 100644 --- a/pkg/core/common/converters.go +++ b/pkg/core/common/converters.go @@ -46,8 +46,18 @@ func SignedTxProtoIntoSignedTxOapi(tx *core_proto.SignedTransaction) *models.Pro Signer: innerTx.ManageEntity.Signer, Nonce: fmt.Sprint(innerTx.ManageEntity.Nonce), } + case *core_proto.SignedTransaction_Attestation: + oapiTx.Attestation = &models.ProtocolAttestation{ + Signatures: innerTx.Attestation.Signatures, + } + switch innerTx.Attestation.Body.(type) { + case *core_proto.Attestation_ValidatorRegistration: + oapiTx.Attestation.ValidatorRegistration = ValidatorRegistrationIntoOapi(innerTx.Attestation.GetValidatorRegistration()) + case *core_proto.Attestation_ValidatorDeregistration: + oapiTx.Attestation.ValidatorDeregistration = ValidatorDeregistrationIntoOapi(innerTx.Attestation.GetValidatorDeregistration()) + } case *core_proto.SignedTransaction_ValidatorRegistration: - oapiTx.ValidatorRegistration = &models.ProtocolValidatorRegistration{ + oapiTx.ValidatorRegistration = &models.ProtocolValidatorRegistrationLegacy{ CometAddress: innerTx.ValidatorRegistration.CometAddress, Endpoint: innerTx.ValidatorRegistration.Endpoint, EthBlock: innerTx.ValidatorRegistration.EthBlock, @@ -57,7 +67,7 @@ func SignedTxProtoIntoSignedTxOapi(tx *core_proto.SignedTransaction) *models.Pro PubKey: innerTx.ValidatorRegistration.PubKey, } case *core_proto.SignedTransaction_ValidatorDeregistration: - oapiTx.ValidatorDeregistration = &models.ProtocolValidatorDeregistration{ + oapiTx.ValidatorDeregistration = &models.ProtocolValidatorMisbehaviorDeregistration{ CometAddress: innerTx.ValidatorDeregistration.CometAddress, PubKey: innerTx.ValidatorDeregistration.PubKey, } @@ -78,3 +88,25 @@ func SignedTxProtoIntoSignedTxOapi(tx *core_proto.SignedTransaction) *models.Pro return oapiTx } + +func ValidatorRegistrationIntoOapi(vr *core_proto.ValidatorRegistration) *models.ProtocolValidatorRegistration { + return &models.ProtocolValidatorRegistration{ + DelegateWallet: vr.DelegateWallet, + Endpoint: vr.Endpoint, + NodeType: vr.NodeType, + EthBlock: fmt.Sprint(vr.EthBlock), + SpID: vr.SpId, + CometAddress: vr.CometAddress, + Power: fmt.Sprint(vr.Power), + PubKey: vr.PubKey, + Deadline: fmt.Sprint(vr.Deadline), + } +} + +func ValidatorDeregistrationIntoOapi(vr *core_proto.ValidatorDeregistration) *models.ProtocolValidatorDeregistration { + return &models.ProtocolValidatorDeregistration{ + CometAddress: vr.CometAddress, + PubKey: vr.PubKey, + Deadline: fmt.Sprint(vr.Deadline), + } +} diff --git a/pkg/core/common/rendezvous.go b/pkg/core/common/rendezvous.go new file mode 100644 index 00000000..abb0312a --- /dev/null +++ b/pkg/core/common/rendezvous.go @@ -0,0 +1,49 @@ +package common + +import ( + "bytes" + "crypto/sha256" + "io" + "sort" +) + +type NodeTuple struct { + addr string + score []byte +} + +type NodeTuples []NodeTuple + +func (s NodeTuples) Len() int { return len(s) } +func (s NodeTuples) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s NodeTuples) Less(i, j int) bool { + c := bytes.Compare(s[i].score, s[j].score) + if c == 0 { + return s[i].addr < s[j].addr + } + return c == -1 +} + +// Returns the first `size` number of addresses from a list of all validators sorted +// by a hashing function. The hashing is seeded according to the given key. +func GetAttestorRendezvous(validatorAddresses []string, key []byte, size int) map[string]bool { + tuples := make(NodeTuples, len(validatorAddresses)) + + hasher := sha256.New() + for i, addr := range validatorAddresses { + hasher.Reset() + io.WriteString(hasher, addr) + hasher.Write(key) + tuples[i] = NodeTuple{addr, hasher.Sum(nil)} + } + sort.Sort(tuples) + result := make(map[string]bool, len(validatorAddresses)) + bound := min(len(tuples), size) + for i, tup := range tuples { + if i >= bound { + break + } + result[tup.addr] = true + } + return result +} diff --git a/pkg/core/config/config.go b/pkg/core/config/config.go index 34d8d124..1315b294 100644 --- a/pkg/core/config/config.go +++ b/pkg/core/config/config.go @@ -117,6 +117,13 @@ type Config struct { CometModule bool PprofModule bool + /* Attestation Thresholds */ + AttRegistrationMin int // minimum number of attestations needed to register a new node + AttRegistrationRSize int // rendezvous size for registration attestations (should be >= to AttRegistrationMin) + AttDeregistrationMin int // minimum number of attestations needed to deregister a node + AttDeregistrationRSize int // rendezvous size for deregistration attestations (should be >= to AttDeregistrationMin) + LegacyRegistrationCutoff int64 // Blocks after this height cannot register using the legacy tx (remove after next chain rollover) + /* Feature Flags */ EnablePoS bool } @@ -146,6 +153,11 @@ func ReadConfig(logger *common.Logger) (*Config, error) { cfg.RetainHeight = int64(getEnvIntWithDefault("retainHeight", 604800)) cfg.Archive = GetEnvWithDefault("archive", "false") == "true" + cfg.AttRegistrationMin = 5 + cfg.AttRegistrationRSize = 10 + cfg.AttDeregistrationMin = 5 + cfg.AttDeregistrationRSize = 10 + // check if discovery specific key is set isDiscovery := os.Getenv("audius_delegate_private_key") != "" var delegatePrivateKey string @@ -196,6 +208,7 @@ func ReadConfig(logger *common.Logger) (*Config, error) { cfg.SlaRollupInterval = mainnetRollupInterval cfg.ValidatorVotingPower = mainnetValidatorVotingPower cfg.EnablePoS = true + cfg.LegacyRegistrationCutoff = 3000000 // delete after chain rollover case "stage", "staging", "testnet": cfg.PersistentPeers = GetEnvWithDefault("persistentPeers", moduloPersistentPeers(ethAddress, StagePersistentPeers, 3)) @@ -206,6 +219,7 @@ func ReadConfig(logger *common.Logger) (*Config, error) { cfg.SlaRollupInterval = testnetRollupInterval cfg.ValidatorVotingPower = testnetValidatorVotingPower cfg.EnablePoS = true + cfg.LegacyRegistrationCutoff = 5000000 // delete after chain rollover case "dev", "development", "devnet", "local", "sandbox": cfg.PersistentPeers = GetEnvWithDefault("persistentPeers", DevPersistentPeers) @@ -220,6 +234,7 @@ func ReadConfig(logger *common.Logger) (*Config, error) { cfg.SlaRollupInterval = devnetRollupInterval cfg.ValidatorVotingPower = devnetValidatorVotingPower cfg.EnablePoS = true + cfg.LegacyRegistrationCutoff = 0 } // Disable ssl for local postgres db connection diff --git a/pkg/core/db/reads.sql.go b/pkg/core/db/reads.sql.go index 6998d800..723ed8c0 100644 --- a/pkg/core/db/reads.sql.go +++ b/pkg/core/db/reads.sql.go @@ -11,6 +11,31 @@ import ( "github.com/jackc/pgx/v5/pgtype" ) +const getAllEthAddressesOfRegisteredNodes = `-- name: GetAllEthAddressesOfRegisteredNodes :many +select eth_address +from core_validators +` + +func (q *Queries) GetAllEthAddressesOfRegisteredNodes(ctx context.Context) ([]string, error) { + rows, err := q.db.Query(ctx, getAllEthAddressesOfRegisteredNodes) + if err != nil { + return nil, err + } + defer rows.Close() + var items []string + for rows.Next() { + var eth_address string + if err := rows.Scan(ð_address); err != nil { + return nil, err + } + items = append(items, eth_address) + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const getAllRegisteredNodes = `-- name: GetAllRegisteredNodes :many select rowid, pub_key, endpoint, eth_address, comet_address, eth_block, node_type, sp_id, comet_pub_key from core_validators diff --git a/pkg/core/db/sql/reads.sql b/pkg/core/db/sql/reads.sql index e94cca7d..fb34a19a 100644 --- a/pkg/core/db/sql/reads.sql +++ b/pkg/core/db/sql/reads.sql @@ -25,6 +25,10 @@ select * from core_validators order by comet_address; +-- name: GetAllEthAddressesOfRegisteredNodes :many +select eth_address +from core_validators; + -- name: GetNodeByEndpoint :one select * from core_validators diff --git a/pkg/core/gen/core_openapi/protocol/protocol_client.go b/pkg/core/gen/core_openapi/protocol/protocol_client.go index 501e4873..dddddd5a 100644 --- a/pkg/core/gen/core_openapi/protocol/protocol_client.go +++ b/pkg/core/gen/core_openapi/protocol/protocol_client.go @@ -58,8 +58,12 @@ type ClientService interface { ProtocolGetBlock(params *ProtocolGetBlockParams, opts ...ClientOption) (*ProtocolGetBlockOK, error) + ProtocolGetDeregistrationAttestation(params *ProtocolGetDeregistrationAttestationParams, opts ...ClientOption) (*ProtocolGetDeregistrationAttestationOK, error) + ProtocolGetNodeInfo(params *ProtocolGetNodeInfoParams, opts ...ClientOption) (*ProtocolGetNodeInfoOK, error) + ProtocolGetRegistrationAttestation(params *ProtocolGetRegistrationAttestationParams, opts ...ClientOption) (*ProtocolGetRegistrationAttestationOK, error) + ProtocolGetTransaction(params *ProtocolGetTransactionParams, opts ...ClientOption) (*ProtocolGetTransactionOK, error) ProtocolPing(params *ProtocolPingParams, opts ...ClientOption) (*ProtocolPingOK, error) @@ -143,6 +147,43 @@ func (a *Client) ProtocolGetBlock(params *ProtocolGetBlockParams, opts ...Client return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ProtocolGetDeregistrationAttestation protocol get deregistration attestation API +*/ +func (a *Client) ProtocolGetDeregistrationAttestation(params *ProtocolGetDeregistrationAttestationParams, opts ...ClientOption) (*ProtocolGetDeregistrationAttestationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProtocolGetDeregistrationAttestationParams() + } + op := &runtime.ClientOperation{ + ID: "Protocol_GetDeregistrationAttestation", + Method: "POST", + PathPattern: "/core/grpc/attest/deregistration", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProtocolGetDeregistrationAttestationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ProtocolGetDeregistrationAttestationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ProtocolGetDeregistrationAttestationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ProtocolGetNodeInfo protocol get node info API */ @@ -180,6 +221,43 @@ func (a *Client) ProtocolGetNodeInfo(params *ProtocolGetNodeInfoParams, opts ... return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) } +/* +ProtocolGetRegistrationAttestation protocol get registration attestation API +*/ +func (a *Client) ProtocolGetRegistrationAttestation(params *ProtocolGetRegistrationAttestationParams, opts ...ClientOption) (*ProtocolGetRegistrationAttestationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProtocolGetRegistrationAttestationParams() + } + op := &runtime.ClientOperation{ + ID: "Protocol_GetRegistrationAttestation", + Method: "POST", + PathPattern: "/core/grpc/attest/registration", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProtocolGetRegistrationAttestationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ProtocolGetRegistrationAttestationOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*ProtocolGetRegistrationAttestationDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + /* ProtocolGetTransaction protocol get transaction API */ diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_parameters.go b/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_parameters.go new file mode 100644 index 00000000..62f3b21d --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/AudiusProject/audiusd/pkg/core/gen/models" +) + +// NewProtocolGetDeregistrationAttestationParams creates a new ProtocolGetDeregistrationAttestationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProtocolGetDeregistrationAttestationParams() *ProtocolGetDeregistrationAttestationParams { + return &ProtocolGetDeregistrationAttestationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProtocolGetDeregistrationAttestationParamsWithTimeout creates a new ProtocolGetDeregistrationAttestationParams object +// with the ability to set a timeout on a request. +func NewProtocolGetDeregistrationAttestationParamsWithTimeout(timeout time.Duration) *ProtocolGetDeregistrationAttestationParams { + return &ProtocolGetDeregistrationAttestationParams{ + timeout: timeout, + } +} + +// NewProtocolGetDeregistrationAttestationParamsWithContext creates a new ProtocolGetDeregistrationAttestationParams object +// with the ability to set a context for a request. +func NewProtocolGetDeregistrationAttestationParamsWithContext(ctx context.Context) *ProtocolGetDeregistrationAttestationParams { + return &ProtocolGetDeregistrationAttestationParams{ + Context: ctx, + } +} + +// NewProtocolGetDeregistrationAttestationParamsWithHTTPClient creates a new ProtocolGetDeregistrationAttestationParams object +// with the ability to set a custom HTTPClient for a request. +func NewProtocolGetDeregistrationAttestationParamsWithHTTPClient(client *http.Client) *ProtocolGetDeregistrationAttestationParams { + return &ProtocolGetDeregistrationAttestationParams{ + HTTPClient: client, + } +} + +/* +ProtocolGetDeregistrationAttestationParams contains all the parameters to send to the API endpoint + + for the protocol get deregistration attestation operation. + + Typically these are written to a http.Request. +*/ +type ProtocolGetDeregistrationAttestationParams struct { + + // Deregistration. + Deregistration *models.ProtocolValidatorDeregistration + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the protocol get deregistration attestation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetDeregistrationAttestationParams) WithDefaults() *ProtocolGetDeregistrationAttestationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the protocol get deregistration attestation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetDeregistrationAttestationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) WithTimeout(timeout time.Duration) *ProtocolGetDeregistrationAttestationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) WithContext(ctx context.Context) *ProtocolGetDeregistrationAttestationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) WithHTTPClient(client *http.Client) *ProtocolGetDeregistrationAttestationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDeregistration adds the deregistration to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) WithDeregistration(deregistration *models.ProtocolValidatorDeregistration) *ProtocolGetDeregistrationAttestationParams { + o.SetDeregistration(deregistration) + return o +} + +// SetDeregistration adds the deregistration to the protocol get deregistration attestation params +func (o *ProtocolGetDeregistrationAttestationParams) SetDeregistration(deregistration *models.ProtocolValidatorDeregistration) { + o.Deregistration = deregistration +} + +// WriteToRequest writes these params to a swagger request +func (o *ProtocolGetDeregistrationAttestationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Deregistration != nil { + if err := r.SetBodyParam(o.Deregistration); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_responses.go b/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_responses.go new file mode 100644 index 00000000..efa1e4f0 --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_deregistration_attestation_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/AudiusProject/audiusd/pkg/core/gen/models" +) + +// ProtocolGetDeregistrationAttestationReader is a Reader for the ProtocolGetDeregistrationAttestation structure. +type ProtocolGetDeregistrationAttestationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProtocolGetDeregistrationAttestationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProtocolGetDeregistrationAttestationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewProtocolGetDeregistrationAttestationDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewProtocolGetDeregistrationAttestationOK creates a ProtocolGetDeregistrationAttestationOK with default headers values +func NewProtocolGetDeregistrationAttestationOK() *ProtocolGetDeregistrationAttestationOK { + return &ProtocolGetDeregistrationAttestationOK{} +} + +/* +ProtocolGetDeregistrationAttestationOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ProtocolGetDeregistrationAttestationOK struct { + Payload *models.ProtocolDeregistrationAttestationResponse +} + +// IsSuccess returns true when this protocol get deregistration attestation o k response has a 2xx status code +func (o *ProtocolGetDeregistrationAttestationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this protocol get deregistration attestation o k response has a 3xx status code +func (o *ProtocolGetDeregistrationAttestationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this protocol get deregistration attestation o k response has a 4xx status code +func (o *ProtocolGetDeregistrationAttestationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this protocol get deregistration attestation o k response has a 5xx status code +func (o *ProtocolGetDeregistrationAttestationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this protocol get deregistration attestation o k response a status code equal to that given +func (o *ProtocolGetDeregistrationAttestationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the protocol get deregistration attestation o k response +func (o *ProtocolGetDeregistrationAttestationOK) Code() int { + return 200 +} + +func (o *ProtocolGetDeregistrationAttestationOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/deregistration][%d] protocolGetDeregistrationAttestationOK %s", 200, payload) +} + +func (o *ProtocolGetDeregistrationAttestationOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/deregistration][%d] protocolGetDeregistrationAttestationOK %s", 200, payload) +} + +func (o *ProtocolGetDeregistrationAttestationOK) GetPayload() *models.ProtocolDeregistrationAttestationResponse { + return o.Payload +} + +func (o *ProtocolGetDeregistrationAttestationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ProtocolDeregistrationAttestationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProtocolGetDeregistrationAttestationDefault creates a ProtocolGetDeregistrationAttestationDefault with default headers values +func NewProtocolGetDeregistrationAttestationDefault(code int) *ProtocolGetDeregistrationAttestationDefault { + return &ProtocolGetDeregistrationAttestationDefault{ + _statusCode: code, + } +} + +/* +ProtocolGetDeregistrationAttestationDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ProtocolGetDeregistrationAttestationDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// IsSuccess returns true when this protocol get deregistration attestation default response has a 2xx status code +func (o *ProtocolGetDeregistrationAttestationDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this protocol get deregistration attestation default response has a 3xx status code +func (o *ProtocolGetDeregistrationAttestationDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this protocol get deregistration attestation default response has a 4xx status code +func (o *ProtocolGetDeregistrationAttestationDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this protocol get deregistration attestation default response has a 5xx status code +func (o *ProtocolGetDeregistrationAttestationDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this protocol get deregistration attestation default response a status code equal to that given +func (o *ProtocolGetDeregistrationAttestationDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the protocol get deregistration attestation default response +func (o *ProtocolGetDeregistrationAttestationDefault) Code() int { + return o._statusCode +} + +func (o *ProtocolGetDeregistrationAttestationDefault) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/deregistration][%d] Protocol_GetDeregistrationAttestation default %s", o._statusCode, payload) +} + +func (o *ProtocolGetDeregistrationAttestationDefault) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/deregistration][%d] Protocol_GetDeregistrationAttestation default %s", o._statusCode, payload) +} + +func (o *ProtocolGetDeregistrationAttestationDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *ProtocolGetDeregistrationAttestationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_height_parameters.go b/pkg/core/gen/core_openapi/protocol/protocol_get_height_parameters.go new file mode 100644 index 00000000..0f42dc65 --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_height_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewProtocolGetHeightParams creates a new ProtocolGetHeightParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProtocolGetHeightParams() *ProtocolGetHeightParams { + return &ProtocolGetHeightParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProtocolGetHeightParamsWithTimeout creates a new ProtocolGetHeightParams object +// with the ability to set a timeout on a request. +func NewProtocolGetHeightParamsWithTimeout(timeout time.Duration) *ProtocolGetHeightParams { + return &ProtocolGetHeightParams{ + timeout: timeout, + } +} + +// NewProtocolGetHeightParamsWithContext creates a new ProtocolGetHeightParams object +// with the ability to set a context for a request. +func NewProtocolGetHeightParamsWithContext(ctx context.Context) *ProtocolGetHeightParams { + return &ProtocolGetHeightParams{ + Context: ctx, + } +} + +// NewProtocolGetHeightParamsWithHTTPClient creates a new ProtocolGetHeightParams object +// with the ability to set a custom HTTPClient for a request. +func NewProtocolGetHeightParamsWithHTTPClient(client *http.Client) *ProtocolGetHeightParams { + return &ProtocolGetHeightParams{ + HTTPClient: client, + } +} + +/* +ProtocolGetHeightParams contains all the parameters to send to the API endpoint + + for the protocol get height operation. + + Typically these are written to a http.Request. +*/ +type ProtocolGetHeightParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the protocol get height params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetHeightParams) WithDefaults() *ProtocolGetHeightParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the protocol get height params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetHeightParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the protocol get height params +func (o *ProtocolGetHeightParams) WithTimeout(timeout time.Duration) *ProtocolGetHeightParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the protocol get height params +func (o *ProtocolGetHeightParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the protocol get height params +func (o *ProtocolGetHeightParams) WithContext(ctx context.Context) *ProtocolGetHeightParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the protocol get height params +func (o *ProtocolGetHeightParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the protocol get height params +func (o *ProtocolGetHeightParams) WithHTTPClient(client *http.Client) *ProtocolGetHeightParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the protocol get height params +func (o *ProtocolGetHeightParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ProtocolGetHeightParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_height_responses.go b/pkg/core/gen/core_openapi/protocol/protocol_get_height_responses.go new file mode 100644 index 00000000..458c8b50 --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_height_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/AudiusProject/audiusd/pkg/core/gen/models" +) + +// ProtocolGetHeightReader is a Reader for the ProtocolGetHeight structure. +type ProtocolGetHeightReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProtocolGetHeightReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProtocolGetHeightOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewProtocolGetHeightDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewProtocolGetHeightOK creates a ProtocolGetHeightOK with default headers values +func NewProtocolGetHeightOK() *ProtocolGetHeightOK { + return &ProtocolGetHeightOK{} +} + +/* +ProtocolGetHeightOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ProtocolGetHeightOK struct { + Payload *models.ProtocolHeightResponse +} + +// IsSuccess returns true when this protocol get height o k response has a 2xx status code +func (o *ProtocolGetHeightOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this protocol get height o k response has a 3xx status code +func (o *ProtocolGetHeightOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this protocol get height o k response has a 4xx status code +func (o *ProtocolGetHeightOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this protocol get height o k response has a 5xx status code +func (o *ProtocolGetHeightOK) IsServerError() bool { + return false +} + +// IsCode returns true when this protocol get height o k response a status code equal to that given +func (o *ProtocolGetHeightOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the protocol get height o k response +func (o *ProtocolGetHeightOK) Code() int { + return 200 +} + +func (o *ProtocolGetHeightOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /core/grpc/height][%d] protocolGetHeightOK %s", 200, payload) +} + +func (o *ProtocolGetHeightOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /core/grpc/height][%d] protocolGetHeightOK %s", 200, payload) +} + +func (o *ProtocolGetHeightOK) GetPayload() *models.ProtocolHeightResponse { + return o.Payload +} + +func (o *ProtocolGetHeightOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ProtocolHeightResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProtocolGetHeightDefault creates a ProtocolGetHeightDefault with default headers values +func NewProtocolGetHeightDefault(code int) *ProtocolGetHeightDefault { + return &ProtocolGetHeightDefault{ + _statusCode: code, + } +} + +/* +ProtocolGetHeightDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ProtocolGetHeightDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// IsSuccess returns true when this protocol get height default response has a 2xx status code +func (o *ProtocolGetHeightDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this protocol get height default response has a 3xx status code +func (o *ProtocolGetHeightDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this protocol get height default response has a 4xx status code +func (o *ProtocolGetHeightDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this protocol get height default response has a 5xx status code +func (o *ProtocolGetHeightDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this protocol get height default response a status code equal to that given +func (o *ProtocolGetHeightDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the protocol get height default response +func (o *ProtocolGetHeightDefault) Code() int { + return o._statusCode +} + +func (o *ProtocolGetHeightDefault) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /core/grpc/height][%d] Protocol_GetHeight default %s", o._statusCode, payload) +} + +func (o *ProtocolGetHeightDefault) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /core/grpc/height][%d] Protocol_GetHeight default %s", o._statusCode, payload) +} + +func (o *ProtocolGetHeightDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *ProtocolGetHeightDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_parameters.go b/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_parameters.go new file mode 100644 index 00000000..af97046d --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/AudiusProject/audiusd/pkg/core/gen/models" +) + +// NewProtocolGetRegistrationAttestationParams creates a new ProtocolGetRegistrationAttestationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProtocolGetRegistrationAttestationParams() *ProtocolGetRegistrationAttestationParams { + return &ProtocolGetRegistrationAttestationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProtocolGetRegistrationAttestationParamsWithTimeout creates a new ProtocolGetRegistrationAttestationParams object +// with the ability to set a timeout on a request. +func NewProtocolGetRegistrationAttestationParamsWithTimeout(timeout time.Duration) *ProtocolGetRegistrationAttestationParams { + return &ProtocolGetRegistrationAttestationParams{ + timeout: timeout, + } +} + +// NewProtocolGetRegistrationAttestationParamsWithContext creates a new ProtocolGetRegistrationAttestationParams object +// with the ability to set a context for a request. +func NewProtocolGetRegistrationAttestationParamsWithContext(ctx context.Context) *ProtocolGetRegistrationAttestationParams { + return &ProtocolGetRegistrationAttestationParams{ + Context: ctx, + } +} + +// NewProtocolGetRegistrationAttestationParamsWithHTTPClient creates a new ProtocolGetRegistrationAttestationParams object +// with the ability to set a custom HTTPClient for a request. +func NewProtocolGetRegistrationAttestationParamsWithHTTPClient(client *http.Client) *ProtocolGetRegistrationAttestationParams { + return &ProtocolGetRegistrationAttestationParams{ + HTTPClient: client, + } +} + +/* +ProtocolGetRegistrationAttestationParams contains all the parameters to send to the API endpoint + + for the protocol get registration attestation operation. + + Typically these are written to a http.Request. +*/ +type ProtocolGetRegistrationAttestationParams struct { + + // Registration. + Registration *models.ProtocolValidatorRegistration + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the protocol get registration attestation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetRegistrationAttestationParams) WithDefaults() *ProtocolGetRegistrationAttestationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the protocol get registration attestation params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProtocolGetRegistrationAttestationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) WithTimeout(timeout time.Duration) *ProtocolGetRegistrationAttestationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) WithContext(ctx context.Context) *ProtocolGetRegistrationAttestationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) WithHTTPClient(client *http.Client) *ProtocolGetRegistrationAttestationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithRegistration adds the registration to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) WithRegistration(registration *models.ProtocolValidatorRegistration) *ProtocolGetRegistrationAttestationParams { + o.SetRegistration(registration) + return o +} + +// SetRegistration adds the registration to the protocol get registration attestation params +func (o *ProtocolGetRegistrationAttestationParams) SetRegistration(registration *models.ProtocolValidatorRegistration) { + o.Registration = registration +} + +// WriteToRequest writes these params to a swagger request +func (o *ProtocolGetRegistrationAttestationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Registration != nil { + if err := r.SetBodyParam(o.Registration); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_responses.go b/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_responses.go new file mode 100644 index 00000000..3557d688 --- /dev/null +++ b/pkg/core/gen/core_openapi/protocol/protocol_get_registration_attestation_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package protocol + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/AudiusProject/audiusd/pkg/core/gen/models" +) + +// ProtocolGetRegistrationAttestationReader is a Reader for the ProtocolGetRegistrationAttestation structure. +type ProtocolGetRegistrationAttestationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProtocolGetRegistrationAttestationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProtocolGetRegistrationAttestationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewProtocolGetRegistrationAttestationDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewProtocolGetRegistrationAttestationOK creates a ProtocolGetRegistrationAttestationOK with default headers values +func NewProtocolGetRegistrationAttestationOK() *ProtocolGetRegistrationAttestationOK { + return &ProtocolGetRegistrationAttestationOK{} +} + +/* +ProtocolGetRegistrationAttestationOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type ProtocolGetRegistrationAttestationOK struct { + Payload *models.ProtocolRegistrationAttestationResponse +} + +// IsSuccess returns true when this protocol get registration attestation o k response has a 2xx status code +func (o *ProtocolGetRegistrationAttestationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this protocol get registration attestation o k response has a 3xx status code +func (o *ProtocolGetRegistrationAttestationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this protocol get registration attestation o k response has a 4xx status code +func (o *ProtocolGetRegistrationAttestationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this protocol get registration attestation o k response has a 5xx status code +func (o *ProtocolGetRegistrationAttestationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this protocol get registration attestation o k response a status code equal to that given +func (o *ProtocolGetRegistrationAttestationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the protocol get registration attestation o k response +func (o *ProtocolGetRegistrationAttestationOK) Code() int { + return 200 +} + +func (o *ProtocolGetRegistrationAttestationOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/registration][%d] protocolGetRegistrationAttestationOK %s", 200, payload) +} + +func (o *ProtocolGetRegistrationAttestationOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/registration][%d] protocolGetRegistrationAttestationOK %s", 200, payload) +} + +func (o *ProtocolGetRegistrationAttestationOK) GetPayload() *models.ProtocolRegistrationAttestationResponse { + return o.Payload +} + +func (o *ProtocolGetRegistrationAttestationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ProtocolRegistrationAttestationResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProtocolGetRegistrationAttestationDefault creates a ProtocolGetRegistrationAttestationDefault with default headers values +func NewProtocolGetRegistrationAttestationDefault(code int) *ProtocolGetRegistrationAttestationDefault { + return &ProtocolGetRegistrationAttestationDefault{ + _statusCode: code, + } +} + +/* +ProtocolGetRegistrationAttestationDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type ProtocolGetRegistrationAttestationDefault struct { + _statusCode int + + Payload *models.RPCStatus +} + +// IsSuccess returns true when this protocol get registration attestation default response has a 2xx status code +func (o *ProtocolGetRegistrationAttestationDefault) IsSuccess() bool { + return o._statusCode/100 == 2 +} + +// IsRedirect returns true when this protocol get registration attestation default response has a 3xx status code +func (o *ProtocolGetRegistrationAttestationDefault) IsRedirect() bool { + return o._statusCode/100 == 3 +} + +// IsClientError returns true when this protocol get registration attestation default response has a 4xx status code +func (o *ProtocolGetRegistrationAttestationDefault) IsClientError() bool { + return o._statusCode/100 == 4 +} + +// IsServerError returns true when this protocol get registration attestation default response has a 5xx status code +func (o *ProtocolGetRegistrationAttestationDefault) IsServerError() bool { + return o._statusCode/100 == 5 +} + +// IsCode returns true when this protocol get registration attestation default response a status code equal to that given +func (o *ProtocolGetRegistrationAttestationDefault) IsCode(code int) bool { + return o._statusCode == code +} + +// Code gets the status code for the protocol get registration attestation default response +func (o *ProtocolGetRegistrationAttestationDefault) Code() int { + return o._statusCode +} + +func (o *ProtocolGetRegistrationAttestationDefault) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/registration][%d] Protocol_GetRegistrationAttestation default %s", o._statusCode, payload) +} + +func (o *ProtocolGetRegistrationAttestationDefault) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /core/grpc/attest/registration][%d] Protocol_GetRegistrationAttestation default %s", o._statusCode, payload) +} + +func (o *ProtocolGetRegistrationAttestationDefault) GetPayload() *models.RPCStatus { + return o.Payload +} + +func (o *ProtocolGetRegistrationAttestationDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RPCStatus) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/core/gen/core_proto/protocol.pb.go b/pkg/core/gen/core_proto/protocol.pb.go index 0b6a59f5..1aab0eac 100644 --- a/pkg/core/gen/core_proto/protocol.pb.go +++ b/pkg/core/gen/core_proto/protocol.pb.go @@ -38,6 +38,7 @@ type SignedTransaction struct { // *SignedTransaction_ValidatorDeregistration // *SignedTransaction_StorageProof // *SignedTransaction_StorageProofVerification + // *SignedTransaction_Attestation Transaction isSignedTransaction_Transaction `protobuf_oneof:"transaction"` } @@ -101,7 +102,7 @@ func (x *SignedTransaction) GetPlays() *TrackPlays { return nil } -func (x *SignedTransaction) GetValidatorRegistration() *ValidatorRegistration { +func (x *SignedTransaction) GetValidatorRegistration() *ValidatorRegistrationLegacy { if x, ok := x.GetTransaction().(*SignedTransaction_ValidatorRegistration); ok { return x.ValidatorRegistration } @@ -122,7 +123,7 @@ func (x *SignedTransaction) GetManageEntity() *ManageEntityLegacy { return nil } -func (x *SignedTransaction) GetValidatorDeregistration() *ValidatorDeregistration { +func (x *SignedTransaction) GetValidatorDeregistration() *ValidatorMisbehaviorDeregistration { if x, ok := x.GetTransaction().(*SignedTransaction_ValidatorDeregistration); ok { return x.ValidatorDeregistration } @@ -143,6 +144,13 @@ func (x *SignedTransaction) GetStorageProofVerification() *StorageProofVerificat return nil } +func (x *SignedTransaction) GetAttestation() *Attestation { + if x, ok := x.GetTransaction().(*SignedTransaction_Attestation); ok { + return x.Attestation + } + return nil +} + type isSignedTransaction_Transaction interface { isSignedTransaction_Transaction() } @@ -152,7 +160,7 @@ type SignedTransaction_Plays struct { } type SignedTransaction_ValidatorRegistration struct { - ValidatorRegistration *ValidatorRegistration `protobuf:"bytes,1001,opt,name=validator_registration,json=validatorRegistration,proto3,oneof"` + ValidatorRegistration *ValidatorRegistrationLegacy `protobuf:"bytes,1001,opt,name=validator_registration,json=validatorRegistration,proto3,oneof"` } type SignedTransaction_SlaRollup struct { @@ -164,7 +172,7 @@ type SignedTransaction_ManageEntity struct { } type SignedTransaction_ValidatorDeregistration struct { - ValidatorDeregistration *ValidatorDeregistration `protobuf:"bytes,1004,opt,name=validator_deregistration,json=validatorDeregistration,proto3,oneof"` + ValidatorDeregistration *ValidatorMisbehaviorDeregistration `protobuf:"bytes,1004,opt,name=validator_deregistration,json=validatorDeregistration,proto3,oneof"` } type SignedTransaction_StorageProof struct { @@ -175,6 +183,10 @@ type SignedTransaction_StorageProofVerification struct { StorageProofVerification *StorageProofVerification `protobuf:"bytes,1006,opt,name=storage_proof_verification,json=storageProofVerification,proto3,oneof"` } +type SignedTransaction_Attestation struct { + Attestation *Attestation `protobuf:"bytes,1007,opt,name=attestation,proto3,oneof"` +} + func (*SignedTransaction_Plays) isSignedTransaction_Transaction() {} func (*SignedTransaction_ValidatorRegistration) isSignedTransaction_Transaction() {} @@ -189,6 +201,8 @@ func (*SignedTransaction_StorageProof) isSignedTransaction_Transaction() {} func (*SignedTransaction_StorageProofVerification) isSignedTransaction_Transaction() {} +func (*SignedTransaction_Attestation) isSignedTransaction_Transaction() {} + type SendTransactionRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -762,7 +776,7 @@ func (x *TrackPlays) GetPlays() []*TrackPlay { return nil } -type ValidatorRegistration struct { +type ValidatorRegistrationLegacy struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -776,8 +790,8 @@ type ValidatorRegistration struct { Power int64 `protobuf:"varint,7,opt,name=power,proto3" json:"power,omitempty"` } -func (x *ValidatorRegistration) Reset() { - *x = ValidatorRegistration{} +func (x *ValidatorRegistrationLegacy) Reset() { + *x = ValidatorRegistrationLegacy{} if protoimpl.UnsafeEnabled { mi := &file_protocol_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -785,13 +799,13 @@ func (x *ValidatorRegistration) Reset() { } } -func (x *ValidatorRegistration) String() string { +func (x *ValidatorRegistrationLegacy) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ValidatorRegistration) ProtoMessage() {} +func (*ValidatorRegistrationLegacy) ProtoMessage() {} -func (x *ValidatorRegistration) ProtoReflect() protoreflect.Message { +func (x *ValidatorRegistrationLegacy) ProtoReflect() protoreflect.Message { mi := &file_protocol_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -803,32 +817,122 @@ func (x *ValidatorRegistration) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ValidatorRegistration.ProtoReflect.Descriptor instead. -func (*ValidatorRegistration) Descriptor() ([]byte, []int) { +// Deprecated: Use ValidatorRegistrationLegacy.ProtoReflect.Descriptor instead. +func (*ValidatorRegistrationLegacy) Descriptor() ([]byte, []int) { return file_protocol_proto_rawDescGZIP(), []int{11} } -func (x *ValidatorRegistration) GetEndpoint() string { +func (x *ValidatorRegistrationLegacy) GetEndpoint() string { if x != nil { return x.Endpoint } return "" } -func (x *ValidatorRegistration) GetCometAddress() string { +func (x *ValidatorRegistrationLegacy) GetCometAddress() string { if x != nil { return x.CometAddress } return "" } -func (x *ValidatorRegistration) GetEthBlock() string { +func (x *ValidatorRegistrationLegacy) GetEthBlock() string { if x != nil { return x.EthBlock } return "" } +func (x *ValidatorRegistrationLegacy) GetNodeType() string { + if x != nil { + return x.NodeType + } + return "" +} + +func (x *ValidatorRegistrationLegacy) GetSpId() string { + if x != nil { + return x.SpId + } + return "" +} + +func (x *ValidatorRegistrationLegacy) GetPubKey() []byte { + if x != nil { + return x.PubKey + } + return nil +} + +func (x *ValidatorRegistrationLegacy) GetPower() int64 { + if x != nil { + return x.Power + } + return 0 +} + +type ValidatorRegistration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DelegateWallet string `protobuf:"bytes,1,opt,name=delegate_wallet,json=delegateWallet,proto3" json:"delegate_wallet,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + NodeType string `protobuf:"bytes,3,opt,name=node_type,json=nodeType,proto3" json:"node_type,omitempty"` + SpId string `protobuf:"bytes,4,opt,name=sp_id,json=spId,proto3" json:"sp_id,omitempty"` + EthBlock int64 `protobuf:"varint,5,opt,name=eth_block,json=ethBlock,proto3" json:"eth_block,omitempty"` + CometAddress string `protobuf:"bytes,6,opt,name=comet_address,json=cometAddress,proto3" json:"comet_address,omitempty"` + PubKey []byte `protobuf:"bytes,7,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Power int64 `protobuf:"varint,8,opt,name=power,proto3" json:"power,omitempty"` + Deadline int64 `protobuf:"varint,9,opt,name=deadline,proto3" json:"deadline,omitempty"` +} + +func (x *ValidatorRegistration) Reset() { + *x = ValidatorRegistration{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorRegistration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorRegistration) ProtoMessage() {} + +func (x *ValidatorRegistration) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidatorRegistration.ProtoReflect.Descriptor instead. +func (*ValidatorRegistration) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{12} +} + +func (x *ValidatorRegistration) GetDelegateWallet() string { + if x != nil { + return x.DelegateWallet + } + return "" +} + +func (x *ValidatorRegistration) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + func (x *ValidatorRegistration) GetNodeType() string { if x != nil { return x.NodeType @@ -843,6 +947,20 @@ func (x *ValidatorRegistration) GetSpId() string { return "" } +func (x *ValidatorRegistration) GetEthBlock() int64 { + if x != nil { + return x.EthBlock + } + return 0 +} + +func (x *ValidatorRegistration) GetCometAddress() string { + if x != nil { + return x.CometAddress + } + return "" +} + func (x *ValidatorRegistration) GetPubKey() []byte { if x != nil { return x.PubKey @@ -857,6 +975,68 @@ func (x *ValidatorRegistration) GetPower() int64 { return 0 } +func (x *ValidatorRegistration) GetDeadline() int64 { + if x != nil { + return x.Deadline + } + return 0 +} + +type ValidatorMisbehaviorDeregistration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CometAddress string `protobuf:"bytes,1,opt,name=comet_address,json=cometAddress,proto3" json:"comet_address,omitempty"` + PubKey []byte `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` +} + +func (x *ValidatorMisbehaviorDeregistration) Reset() { + *x = ValidatorMisbehaviorDeregistration{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ValidatorMisbehaviorDeregistration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ValidatorMisbehaviorDeregistration) ProtoMessage() {} + +func (x *ValidatorMisbehaviorDeregistration) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ValidatorMisbehaviorDeregistration.ProtoReflect.Descriptor instead. +func (*ValidatorMisbehaviorDeregistration) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{13} +} + +func (x *ValidatorMisbehaviorDeregistration) GetCometAddress() string { + if x != nil { + return x.CometAddress + } + return "" +} + +func (x *ValidatorMisbehaviorDeregistration) GetPubKey() []byte { + if x != nil { + return x.PubKey + } + return nil +} + type ValidatorDeregistration struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -864,12 +1044,13 @@ type ValidatorDeregistration struct { CometAddress string `protobuf:"bytes,1,opt,name=comet_address,json=cometAddress,proto3" json:"comet_address,omitempty"` PubKey []byte `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Deadline int64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` } func (x *ValidatorDeregistration) Reset() { *x = ValidatorDeregistration{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[12] + mi := &file_protocol_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -882,7 +1063,7 @@ func (x *ValidatorDeregistration) String() string { func (*ValidatorDeregistration) ProtoMessage() {} func (x *ValidatorDeregistration) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[12] + mi := &file_protocol_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -895,7 +1076,7 @@ func (x *ValidatorDeregistration) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidatorDeregistration.ProtoReflect.Descriptor instead. func (*ValidatorDeregistration) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{12} + return file_protocol_proto_rawDescGZIP(), []int{14} } func (x *ValidatorDeregistration) GetCometAddress() string { @@ -912,6 +1093,13 @@ func (x *ValidatorDeregistration) GetPubKey() []byte { return nil } +func (x *ValidatorDeregistration) GetDeadline() int64 { + if x != nil { + return x.Deadline + } + return 0 +} + type TrackPlay struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -929,7 +1117,7 @@ type TrackPlay struct { func (x *TrackPlay) Reset() { *x = TrackPlay{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[13] + mi := &file_protocol_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -942,7 +1130,7 @@ func (x *TrackPlay) String() string { func (*TrackPlay) ProtoMessage() {} func (x *TrackPlay) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[13] + mi := &file_protocol_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -955,7 +1143,7 @@ func (x *TrackPlay) ProtoReflect() protoreflect.Message { // Deprecated: Use TrackPlay.ProtoReflect.Descriptor instead. func (*TrackPlay) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{13} + return file_protocol_proto_rawDescGZIP(), []int{15} } func (x *TrackPlay) GetUserId() string { @@ -1016,7 +1204,7 @@ type PingRequest struct { func (x *PingRequest) Reset() { *x = PingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[14] + mi := &file_protocol_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1029,7 +1217,7 @@ func (x *PingRequest) String() string { func (*PingRequest) ProtoMessage() {} func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[14] + mi := &file_protocol_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1042,7 +1230,7 @@ func (x *PingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. func (*PingRequest) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{14} + return file_protocol_proto_rawDescGZIP(), []int{16} } type PingResponse struct { @@ -1056,7 +1244,7 @@ type PingResponse struct { func (x *PingResponse) Reset() { *x = PingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[15] + mi := &file_protocol_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1069,7 +1257,7 @@ func (x *PingResponse) String() string { func (*PingResponse) ProtoMessage() {} func (x *PingResponse) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[15] + mi := &file_protocol_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1082,7 +1270,7 @@ func (x *PingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. func (*PingResponse) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{15} + return file_protocol_proto_rawDescGZIP(), []int{17} } func (x *PingResponse) GetMessage() string { @@ -1106,7 +1294,7 @@ type SlaRollup struct { func (x *SlaRollup) Reset() { *x = SlaRollup{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[16] + mi := &file_protocol_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1119,7 +1307,7 @@ func (x *SlaRollup) String() string { func (*SlaRollup) ProtoMessage() {} func (x *SlaRollup) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[16] + mi := &file_protocol_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1132,7 +1320,7 @@ func (x *SlaRollup) ProtoReflect() protoreflect.Message { // Deprecated: Use SlaRollup.ProtoReflect.Descriptor instead. func (*SlaRollup) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{16} + return file_protocol_proto_rawDescGZIP(), []int{18} } func (x *SlaRollup) GetTimestamp() *timestamppb.Timestamp { @@ -1175,7 +1363,7 @@ type SlaNodeReport struct { func (x *SlaNodeReport) Reset() { *x = SlaNodeReport{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[17] + mi := &file_protocol_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1188,7 +1376,7 @@ func (x *SlaNodeReport) String() string { func (*SlaNodeReport) ProtoMessage() {} func (x *SlaNodeReport) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[17] + mi := &file_protocol_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1201,7 +1389,7 @@ func (x *SlaNodeReport) ProtoReflect() protoreflect.Message { // Deprecated: Use SlaNodeReport.ProtoReflect.Descriptor instead. func (*SlaNodeReport) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{17} + return file_protocol_proto_rawDescGZIP(), []int{19} } func (x *SlaNodeReport) GetAddress() string { @@ -1233,7 +1421,7 @@ type StorageProof struct { func (x *StorageProof) Reset() { *x = StorageProof{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[18] + mi := &file_protocol_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1246,7 +1434,7 @@ func (x *StorageProof) String() string { func (*StorageProof) ProtoMessage() {} func (x *StorageProof) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[18] + mi := &file_protocol_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1259,7 +1447,7 @@ func (x *StorageProof) ProtoReflect() protoreflect.Message { // Deprecated: Use StorageProof.ProtoReflect.Descriptor instead. func (*StorageProof) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{18} + return file_protocol_proto_rawDescGZIP(), []int{20} } func (x *StorageProof) GetHeight() int64 { @@ -1309,7 +1497,7 @@ type StorageProofVerification struct { func (x *StorageProofVerification) Reset() { *x = StorageProofVerification{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[19] + mi := &file_protocol_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1322,7 +1510,7 @@ func (x *StorageProofVerification) String() string { func (*StorageProofVerification) ProtoMessage() {} func (x *StorageProofVerification) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[19] + mi := &file_protocol_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1335,7 +1523,7 @@ func (x *StorageProofVerification) ProtoReflect() protoreflect.Message { // Deprecated: Use StorageProofVerification.ProtoReflect.Descriptor instead. func (*StorageProofVerification) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{19} + return file_protocol_proto_rawDescGZIP(), []int{21} } func (x *StorageProofVerification) GetHeight() int64 { @@ -1370,7 +1558,7 @@ type ManageEntityLegacy struct { func (x *ManageEntityLegacy) Reset() { *x = ManageEntityLegacy{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_proto_msgTypes[20] + mi := &file_protocol_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1383,7 +1571,7 @@ func (x *ManageEntityLegacy) String() string { func (*ManageEntityLegacy) ProtoMessage() {} func (x *ManageEntityLegacy) ProtoReflect() protoreflect.Message { - mi := &file_protocol_proto_msgTypes[20] + mi := &file_protocol_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1396,7 +1584,7 @@ func (x *ManageEntityLegacy) ProtoReflect() protoreflect.Message { // Deprecated: Use ManageEntityLegacy.ProtoReflect.Descriptor instead. func (*ManageEntityLegacy) Descriptor() ([]byte, []int) { - return file_protocol_proto_rawDescGZIP(), []int{20} + return file_protocol_proto_rawDescGZIP(), []int{22} } func (x *ManageEntityLegacy) GetUserId() int64 { @@ -1455,6 +1643,299 @@ func (x *ManageEntityLegacy) GetNonce() string { return "" } +type RegistrationAttestationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Registration *ValidatorRegistration `protobuf:"bytes,1,opt,name=registration,proto3" json:"registration,omitempty"` +} + +func (x *RegistrationAttestationRequest) Reset() { + *x = RegistrationAttestationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegistrationAttestationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegistrationAttestationRequest) ProtoMessage() {} + +func (x *RegistrationAttestationRequest) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegistrationAttestationRequest.ProtoReflect.Descriptor instead. +func (*RegistrationAttestationRequest) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{23} +} + +func (x *RegistrationAttestationRequest) GetRegistration() *ValidatorRegistration { + if x != nil { + return x.Registration + } + return nil +} + +type RegistrationAttestationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + Registration *ValidatorRegistration `protobuf:"bytes,2,opt,name=registration,proto3" json:"registration,omitempty"` +} + +func (x *RegistrationAttestationResponse) Reset() { + *x = RegistrationAttestationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RegistrationAttestationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RegistrationAttestationResponse) ProtoMessage() {} + +func (x *RegistrationAttestationResponse) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RegistrationAttestationResponse.ProtoReflect.Descriptor instead. +func (*RegistrationAttestationResponse) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{24} +} + +func (x *RegistrationAttestationResponse) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +func (x *RegistrationAttestationResponse) GetRegistration() *ValidatorRegistration { + if x != nil { + return x.Registration + } + return nil +} + +type DeregistrationAttestationRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deregistration *ValidatorDeregistration `protobuf:"bytes,1,opt,name=deregistration,proto3" json:"deregistration,omitempty"` +} + +func (x *DeregistrationAttestationRequest) Reset() { + *x = DeregistrationAttestationRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeregistrationAttestationRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeregistrationAttestationRequest) ProtoMessage() {} + +func (x *DeregistrationAttestationRequest) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeregistrationAttestationRequest.ProtoReflect.Descriptor instead. +func (*DeregistrationAttestationRequest) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{25} +} + +func (x *DeregistrationAttestationRequest) GetDeregistration() *ValidatorDeregistration { + if x != nil { + return x.Deregistration + } + return nil +} + +type DeregistrationAttestationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signature string `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"` + Deregistration *ValidatorDeregistration `protobuf:"bytes,2,opt,name=deregistration,proto3" json:"deregistration,omitempty"` +} + +func (x *DeregistrationAttestationResponse) Reset() { + *x = DeregistrationAttestationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeregistrationAttestationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeregistrationAttestationResponse) ProtoMessage() {} + +func (x *DeregistrationAttestationResponse) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeregistrationAttestationResponse.ProtoReflect.Descriptor instead. +func (*DeregistrationAttestationResponse) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{26} +} + +func (x *DeregistrationAttestationResponse) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +func (x *DeregistrationAttestationResponse) GetDeregistration() *ValidatorDeregistration { + if x != nil { + return x.Deregistration + } + return nil +} + +type Attestation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signatures []string `protobuf:"bytes,1,rep,name=signatures,proto3" json:"signatures,omitempty"` + // Types that are assignable to Body: + // + // *Attestation_ValidatorRegistration + // *Attestation_ValidatorDeregistration + Body isAttestation_Body `protobuf_oneof:"body"` +} + +func (x *Attestation) Reset() { + *x = Attestation{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Attestation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Attestation) ProtoMessage() {} + +func (x *Attestation) ProtoReflect() protoreflect.Message { + mi := &file_protocol_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Attestation.ProtoReflect.Descriptor instead. +func (*Attestation) Descriptor() ([]byte, []int) { + return file_protocol_proto_rawDescGZIP(), []int{27} +} + +func (x *Attestation) GetSignatures() []string { + if x != nil { + return x.Signatures + } + return nil +} + +func (m *Attestation) GetBody() isAttestation_Body { + if m != nil { + return m.Body + } + return nil +} + +func (x *Attestation) GetValidatorRegistration() *ValidatorRegistration { + if x, ok := x.GetBody().(*Attestation_ValidatorRegistration); ok { + return x.ValidatorRegistration + } + return nil +} + +func (x *Attestation) GetValidatorDeregistration() *ValidatorDeregistration { + if x, ok := x.GetBody().(*Attestation_ValidatorDeregistration); ok { + return x.ValidatorDeregistration + } + return nil +} + +type isAttestation_Body interface { + isAttestation_Body() +} + +type Attestation_ValidatorRegistration struct { + ValidatorRegistration *ValidatorRegistration `protobuf:"bytes,1000,opt,name=validator_registration,json=validatorRegistration,proto3,oneof"` +} + +type Attestation_ValidatorDeregistration struct { + ValidatorDeregistration *ValidatorDeregistration `protobuf:"bytes,1001,opt,name=validator_deregistration,json=validatorDeregistration,proto3,oneof"` +} + +func (*Attestation_ValidatorRegistration) isAttestation_Body() {} + +func (*Attestation_ValidatorDeregistration) isAttestation_Body() {} + var File_protocol_proto protoreflect.FileDescriptor var file_protocol_proto_rawDesc = []byte{ @@ -1463,7 +1944,7 @@ var file_protocol_proto_rawDesc = []byte{ 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xec, 0x04, 0x0a, 0x11, 0x53, 0x69, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x05, 0x0a, 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1d, 0x0a, @@ -1471,239 +1952,338 @@ var file_protocol_proto_rawDesc = []byte{ 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x6c, 0x61, - 0x79, 0x73, 0x48, 0x00, 0x52, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x59, 0x0a, 0x16, 0x76, + 0x79, 0x73, 0x48, 0x00, 0x52, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x5f, 0x0a, 0x16, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x48, 0x00, 0x52, 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0a, + 0x73, 0x6c, 0x61, 0x5f, 0x72, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6c, 0x61, + 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x48, 0x00, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x52, 0x6f, 0x6c, + 0x6c, 0x75, 0x70, 0x12, 0x44, 0x0a, 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x18, 0xeb, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x6a, 0x0a, 0x18, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, - 0x15, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0a, 0x73, 0x6c, 0x61, 0x5f, 0x72, 0x6f, - 0x6c, 0x6c, 0x75, 0x70, 0x18, 0xea, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6c, 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, - 0x48, 0x00, 0x52, 0x09, 0x73, 0x6c, 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x12, 0x44, 0x0a, - 0x0d, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0xeb, - 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x67, - 0x61, 0x63, 0x79, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x12, 0x5f, 0x0a, 0x18, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x5f, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0xec, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x17, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0xed, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x63, 0x0a, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0xee, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, - 0x18, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x57, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x72, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x17, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0xed, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x63, 0x0a, 0x1a, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0xee, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, + 0x52, 0x18, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x56, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xef, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x65, 0x73, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x57, 0x0a, 0x16, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3d, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x78, + 0x0a, 0x19, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x22, 0xae, 0x01, 0x0a, 0x13, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x12, 0x3d, 0x0a, 0x0b, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x1c, 0x0a, 0x1a, 0x46, 0x6f, + 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x22, 0xf1, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, + 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x78, 0x0a, 0x19, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x3d, 0x0a, 0x0b, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x15, 0x47, - 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x22, 0xae, 0x01, 0x0a, - 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x12, 0x3d, 0x0a, 0x0b, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x1c, 0x0a, - 0x1a, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x52, 0x0a, 0x15, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x14, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb1, 0x01, + 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x79, + 0x6e, 0x63, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, + 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x74, 0x68, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, + 0x74, 0x22, 0x37, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x6c, 0x61, 0x79, 0x73, 0x12, + 0x29, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, + 0x6c, 0x61, 0x79, 0x52, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xdc, 0x01, 0x0a, 0x1b, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, + 0x6f, 0x6d, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x65, + 0x74, 0x68, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x74, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x73, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, + 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, + 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x9b, 0x02, 0x0a, 0x15, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, + 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, + 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x73, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x70, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x74, + 0x68, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, + 0x74, 0x68, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, + 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, + 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, + 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, + 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x62, 0x0a, 0x22, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x69, 0x73, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x44, + 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, + 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, 0x73, 0x0a, 0x17, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, + 0x6f, 0x6d, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, + 0x75, 0x62, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, + 0x62, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, + 0x22, 0xdd, 0x01, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x6c, 0x61, 0x79, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x6b, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x6b, + 0x49, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, + 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x28, 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x53, 0x6c, + 0x61, 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x64, 0x12, + 0x31, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6c, 0x61, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x22, 0x59, 0x0a, 0x0d, 0x53, 0x6c, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2e, 0x0a, + 0x13, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6e, 0x75, 0x6d, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x22, 0xa6, 0x01, + 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xf1, 0x02, 0x0a, 0x0d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x12, 0x3f, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x38, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x52, 0x0a, 0x15, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, - 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x14, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0xb1, 0x01, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x73, 0x79, 0x6e, 0x63, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, - 0x65, 0x74, 0x68, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, - 0x0e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x22, 0x37, 0x0a, 0x0a, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x6c, 0x61, - 0x79, 0x73, 0x12, 0x29, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, - 0x63, 0x6b, 0x50, 0x6c, 0x61, 0x79, 0x52, 0x05, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x22, 0xd6, 0x01, - 0x0a, 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x65, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x74, 0x68, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x74, 0x68, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x13, 0x0a, 0x05, 0x73, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x70, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x22, 0x57, 0x0a, 0x17, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x65, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x22, - 0xdd, 0x01, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x6c, 0x61, 0x79, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x49, - 0x64, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x74, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, - 0x0d, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x28, - 0x0a, 0x0c, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x53, 0x6c, 0x61, - 0x52, 0x6f, 0x6c, 0x6c, 0x75, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x64, 0x12, 0x31, - 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x6c, 0x61, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x22, 0x59, 0x0a, 0x0d, 0x53, 0x6c, 0x61, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x2e, 0x0a, 0x13, - 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6e, 0x75, 0x6d, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x22, 0xa6, 0x01, 0x0a, - 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x16, 0x0a, - 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x65, - 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x48, 0x0a, 0x18, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, - 0xeb, 0x01, 0x0a, 0x12, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, + 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x63, + 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x48, 0x0a, 0x18, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, + 0x22, 0xeb, 0x01, 0x0a, 0x12, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x1f, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x22, 0x65, + 0x0a, 0x1e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x43, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x84, 0x01, 0x0a, 0x1f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x6d, 0x0a, 0x20, + 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x49, 0x0a, 0x0e, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x65, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8c, 0x01, 0x0a, 0x21, + 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x32, 0xb7, 0x05, - 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x7f, 0x0a, 0x0f, 0x53, 0x65, - 0x6e, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0x16, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x94, 0x01, 0x0a, 0x12, - 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x6f, - 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x1e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x12, 0x61, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, - 0x12, 0x65, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x16, 0x12, 0x14, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4e, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, - 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x0a, 0x0e, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x64, 0x65, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x59, 0x0a, 0x16, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe8, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x15, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5f, 0x0a, 0x18, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0xe9, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x17, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x32, 0x95, + 0x08, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x7f, 0x0a, 0x0f, 0x53, + 0x65, 0x6e, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x16, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x94, 0x01, 0x0a, + 0x12, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x46, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x2e, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x22, 0x1e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x66, 0x6f, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, 0x1f, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x74, 0x78, 0x68, 0x61, 0x73, 0x68, 0x7d, 0x12, 0x61, + 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, + 0x70, 0x63, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x7d, 0x12, 0x65, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x47, 0x65, 0x74, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x16, 0x12, 0x14, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6e, + 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4e, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, + 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x12, 0xa7, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x34, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x1e, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0xb1, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, + 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x32, 0x3a, 0x0e, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x20, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x67, 0x72, 0x70, 0x63, + 0x2f, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x64, 0x65, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x19, 0x5a, 0x17, 0x2e, 0x2f, 0x63, 0x6f, 0x72, 0x65, + 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1718,66 +2298,84 @@ func file_protocol_proto_rawDescGZIP() []byte { return file_protocol_proto_rawDescData } -var file_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_protocol_proto_goTypes = []interface{}{ - (*SignedTransaction)(nil), // 0: protocol.SignedTransaction - (*SendTransactionRequest)(nil), // 1: protocol.SendTransactionRequest - (*ForwardTransactionRequest)(nil), // 2: protocol.ForwardTransactionRequest - (*GetTransactionRequest)(nil), // 3: protocol.GetTransactionRequest - (*TransactionResponse)(nil), // 4: protocol.TransactionResponse - (*ForwardTransactionResponse)(nil), // 5: protocol.ForwardTransactionResponse - (*GetBlockRequest)(nil), // 6: protocol.GetBlockRequest - (*BlockResponse)(nil), // 7: protocol.BlockResponse - (*GetNodeInfoRequest)(nil), // 8: protocol.GetNodeInfoRequest - (*NodeInfoResponse)(nil), // 9: protocol.NodeInfoResponse - (*TrackPlays)(nil), // 10: protocol.TrackPlays - (*ValidatorRegistration)(nil), // 11: protocol.ValidatorRegistration - (*ValidatorDeregistration)(nil), // 12: protocol.ValidatorDeregistration - (*TrackPlay)(nil), // 13: protocol.TrackPlay - (*PingRequest)(nil), // 14: protocol.PingRequest - (*PingResponse)(nil), // 15: protocol.PingResponse - (*SlaRollup)(nil), // 16: protocol.SlaRollup - (*SlaNodeReport)(nil), // 17: protocol.SlaNodeReport - (*StorageProof)(nil), // 18: protocol.StorageProof - (*StorageProofVerification)(nil), // 19: protocol.StorageProofVerification - (*ManageEntityLegacy)(nil), // 20: protocol.ManageEntityLegacy - (*timestamppb.Timestamp)(nil), // 21: google.protobuf.Timestamp + (*SignedTransaction)(nil), // 0: protocol.SignedTransaction + (*SendTransactionRequest)(nil), // 1: protocol.SendTransactionRequest + (*ForwardTransactionRequest)(nil), // 2: protocol.ForwardTransactionRequest + (*GetTransactionRequest)(nil), // 3: protocol.GetTransactionRequest + (*TransactionResponse)(nil), // 4: protocol.TransactionResponse + (*ForwardTransactionResponse)(nil), // 5: protocol.ForwardTransactionResponse + (*GetBlockRequest)(nil), // 6: protocol.GetBlockRequest + (*BlockResponse)(nil), // 7: protocol.BlockResponse + (*GetNodeInfoRequest)(nil), // 8: protocol.GetNodeInfoRequest + (*NodeInfoResponse)(nil), // 9: protocol.NodeInfoResponse + (*TrackPlays)(nil), // 10: protocol.TrackPlays + (*ValidatorRegistrationLegacy)(nil), // 11: protocol.ValidatorRegistrationLegacy + (*ValidatorRegistration)(nil), // 12: protocol.ValidatorRegistration + (*ValidatorMisbehaviorDeregistration)(nil), // 13: protocol.ValidatorMisbehaviorDeregistration + (*ValidatorDeregistration)(nil), // 14: protocol.ValidatorDeregistration + (*TrackPlay)(nil), // 15: protocol.TrackPlay + (*PingRequest)(nil), // 16: protocol.PingRequest + (*PingResponse)(nil), // 17: protocol.PingResponse + (*SlaRollup)(nil), // 18: protocol.SlaRollup + (*SlaNodeReport)(nil), // 19: protocol.SlaNodeReport + (*StorageProof)(nil), // 20: protocol.StorageProof + (*StorageProofVerification)(nil), // 21: protocol.StorageProofVerification + (*ManageEntityLegacy)(nil), // 22: protocol.ManageEntityLegacy + (*RegistrationAttestationRequest)(nil), // 23: protocol.RegistrationAttestationRequest + (*RegistrationAttestationResponse)(nil), // 24: protocol.RegistrationAttestationResponse + (*DeregistrationAttestationRequest)(nil), // 25: protocol.DeregistrationAttestationRequest + (*DeregistrationAttestationResponse)(nil), // 26: protocol.DeregistrationAttestationResponse + (*Attestation)(nil), // 27: protocol.Attestation + (*timestamppb.Timestamp)(nil), // 28: google.protobuf.Timestamp } var file_protocol_proto_depIdxs = []int32{ 10, // 0: protocol.SignedTransaction.plays:type_name -> protocol.TrackPlays - 11, // 1: protocol.SignedTransaction.validator_registration:type_name -> protocol.ValidatorRegistration - 16, // 2: protocol.SignedTransaction.sla_rollup:type_name -> protocol.SlaRollup - 20, // 3: protocol.SignedTransaction.manage_entity:type_name -> protocol.ManageEntityLegacy - 12, // 4: protocol.SignedTransaction.validator_deregistration:type_name -> protocol.ValidatorDeregistration - 18, // 5: protocol.SignedTransaction.storage_proof:type_name -> protocol.StorageProof - 19, // 6: protocol.SignedTransaction.storage_proof_verification:type_name -> protocol.StorageProofVerification - 0, // 7: protocol.SendTransactionRequest.transaction:type_name -> protocol.SignedTransaction - 0, // 8: protocol.ForwardTransactionRequest.transaction:type_name -> protocol.SignedTransaction - 0, // 9: protocol.TransactionResponse.transaction:type_name -> protocol.SignedTransaction - 0, // 10: protocol.BlockResponse.transactions:type_name -> protocol.SignedTransaction - 21, // 11: protocol.BlockResponse.timestamp:type_name -> google.protobuf.Timestamp - 4, // 12: protocol.BlockResponse.transaction_responses:type_name -> protocol.TransactionResponse - 13, // 13: protocol.TrackPlays.plays:type_name -> protocol.TrackPlay - 21, // 14: protocol.TrackPlay.timestamp:type_name -> google.protobuf.Timestamp - 21, // 15: protocol.SlaRollup.timestamp:type_name -> google.protobuf.Timestamp - 17, // 16: protocol.SlaRollup.reports:type_name -> protocol.SlaNodeReport - 1, // 17: protocol.Protocol.SendTransaction:input_type -> protocol.SendTransactionRequest - 2, // 18: protocol.Protocol.ForwardTransaction:input_type -> protocol.ForwardTransactionRequest - 3, // 19: protocol.Protocol.GetTransaction:input_type -> protocol.GetTransactionRequest - 6, // 20: protocol.Protocol.GetBlock:input_type -> protocol.GetBlockRequest - 8, // 21: protocol.Protocol.GetNodeInfo:input_type -> protocol.GetNodeInfoRequest - 14, // 22: protocol.Protocol.Ping:input_type -> protocol.PingRequest - 4, // 23: protocol.Protocol.SendTransaction:output_type -> protocol.TransactionResponse - 5, // 24: protocol.Protocol.ForwardTransaction:output_type -> protocol.ForwardTransactionResponse - 4, // 25: protocol.Protocol.GetTransaction:output_type -> protocol.TransactionResponse - 7, // 26: protocol.Protocol.GetBlock:output_type -> protocol.BlockResponse - 9, // 27: protocol.Protocol.GetNodeInfo:output_type -> protocol.NodeInfoResponse - 15, // 28: protocol.Protocol.Ping:output_type -> protocol.PingResponse - 23, // [23:29] is the sub-list for method output_type - 17, // [17:23] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 11, // 1: protocol.SignedTransaction.validator_registration:type_name -> protocol.ValidatorRegistrationLegacy + 18, // 2: protocol.SignedTransaction.sla_rollup:type_name -> protocol.SlaRollup + 22, // 3: protocol.SignedTransaction.manage_entity:type_name -> protocol.ManageEntityLegacy + 13, // 4: protocol.SignedTransaction.validator_deregistration:type_name -> protocol.ValidatorMisbehaviorDeregistration + 20, // 5: protocol.SignedTransaction.storage_proof:type_name -> protocol.StorageProof + 21, // 6: protocol.SignedTransaction.storage_proof_verification:type_name -> protocol.StorageProofVerification + 27, // 7: protocol.SignedTransaction.attestation:type_name -> protocol.Attestation + 0, // 8: protocol.SendTransactionRequest.transaction:type_name -> protocol.SignedTransaction + 0, // 9: protocol.ForwardTransactionRequest.transaction:type_name -> protocol.SignedTransaction + 0, // 10: protocol.TransactionResponse.transaction:type_name -> protocol.SignedTransaction + 0, // 11: protocol.BlockResponse.transactions:type_name -> protocol.SignedTransaction + 28, // 12: protocol.BlockResponse.timestamp:type_name -> google.protobuf.Timestamp + 4, // 13: protocol.BlockResponse.transaction_responses:type_name -> protocol.TransactionResponse + 15, // 14: protocol.TrackPlays.plays:type_name -> protocol.TrackPlay + 28, // 15: protocol.TrackPlay.timestamp:type_name -> google.protobuf.Timestamp + 28, // 16: protocol.SlaRollup.timestamp:type_name -> google.protobuf.Timestamp + 19, // 17: protocol.SlaRollup.reports:type_name -> protocol.SlaNodeReport + 12, // 18: protocol.RegistrationAttestationRequest.registration:type_name -> protocol.ValidatorRegistration + 12, // 19: protocol.RegistrationAttestationResponse.registration:type_name -> protocol.ValidatorRegistration + 14, // 20: protocol.DeregistrationAttestationRequest.deregistration:type_name -> protocol.ValidatorDeregistration + 14, // 21: protocol.DeregistrationAttestationResponse.deregistration:type_name -> protocol.ValidatorDeregistration + 12, // 22: protocol.Attestation.validator_registration:type_name -> protocol.ValidatorRegistration + 14, // 23: protocol.Attestation.validator_deregistration:type_name -> protocol.ValidatorDeregistration + 1, // 24: protocol.Protocol.SendTransaction:input_type -> protocol.SendTransactionRequest + 2, // 25: protocol.Protocol.ForwardTransaction:input_type -> protocol.ForwardTransactionRequest + 3, // 26: protocol.Protocol.GetTransaction:input_type -> protocol.GetTransactionRequest + 6, // 27: protocol.Protocol.GetBlock:input_type -> protocol.GetBlockRequest + 8, // 28: protocol.Protocol.GetNodeInfo:input_type -> protocol.GetNodeInfoRequest + 16, // 29: protocol.Protocol.Ping:input_type -> protocol.PingRequest + 23, // 30: protocol.Protocol.GetRegistrationAttestation:input_type -> protocol.RegistrationAttestationRequest + 25, // 31: protocol.Protocol.GetDeregistrationAttestation:input_type -> protocol.DeregistrationAttestationRequest + 4, // 32: protocol.Protocol.SendTransaction:output_type -> protocol.TransactionResponse + 5, // 33: protocol.Protocol.ForwardTransaction:output_type -> protocol.ForwardTransactionResponse + 4, // 34: protocol.Protocol.GetTransaction:output_type -> protocol.TransactionResponse + 7, // 35: protocol.Protocol.GetBlock:output_type -> protocol.BlockResponse + 9, // 36: protocol.Protocol.GetNodeInfo:output_type -> protocol.NodeInfoResponse + 17, // 37: protocol.Protocol.Ping:output_type -> protocol.PingResponse + 24, // 38: protocol.Protocol.GetRegistrationAttestation:output_type -> protocol.RegistrationAttestationResponse + 26, // 39: protocol.Protocol.GetDeregistrationAttestation:output_type -> protocol.DeregistrationAttestationResponse + 32, // [32:40] is the sub-list for method output_type + 24, // [24:32] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_protocol_proto_init() } @@ -1919,7 +2517,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorRegistration); i { + switch v := v.(*ValidatorRegistrationLegacy); i { case 0: return &v.state case 1: @@ -1931,7 +2529,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorDeregistration); i { + switch v := v.(*ValidatorRegistration); i { case 0: return &v.state case 1: @@ -1943,7 +2541,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrackPlay); i { + switch v := v.(*ValidatorMisbehaviorDeregistration); i { case 0: return &v.state case 1: @@ -1955,7 +2553,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingRequest); i { + switch v := v.(*ValidatorDeregistration); i { case 0: return &v.state case 1: @@ -1967,7 +2565,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingResponse); i { + switch v := v.(*TrackPlay); i { case 0: return &v.state case 1: @@ -1979,7 +2577,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SlaRollup); i { + switch v := v.(*PingRequest); i { case 0: return &v.state case 1: @@ -1991,7 +2589,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SlaNodeReport); i { + switch v := v.(*PingResponse); i { case 0: return &v.state case 1: @@ -2003,7 +2601,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StorageProof); i { + switch v := v.(*SlaRollup); i { case 0: return &v.state case 1: @@ -2015,7 +2613,7 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StorageProofVerification); i { + switch v := v.(*SlaNodeReport); i { case 0: return &v.state case 1: @@ -2027,6 +2625,30 @@ func file_protocol_proto_init() { } } file_protocol_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageProof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageProofVerification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ManageEntityLegacy); i { case 0: return &v.state @@ -2038,6 +2660,66 @@ func file_protocol_proto_init() { return nil } } + file_protocol_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegistrationAttestationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RegistrationAttestationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeregistrationAttestationRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeregistrationAttestationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Attestation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_protocol_proto_msgTypes[0].OneofWrappers = []interface{}{ (*SignedTransaction_Plays)(nil), @@ -2047,6 +2729,11 @@ func file_protocol_proto_init() { (*SignedTransaction_ValidatorDeregistration)(nil), (*SignedTransaction_StorageProof)(nil), (*SignedTransaction_StorageProofVerification)(nil), + (*SignedTransaction_Attestation)(nil), + } + file_protocol_proto_msgTypes[27].OneofWrappers = []interface{}{ + (*Attestation_ValidatorRegistration)(nil), + (*Attestation_ValidatorDeregistration)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -2054,7 +2741,7 @@ func file_protocol_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protocol_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/core/gen/core_proto/protocol.pb.gw.go b/pkg/core/gen/core_proto/protocol.pb.gw.go index 9cb02bb5..79d0b3f9 100644 --- a/pkg/core/gen/core_proto/protocol.pb.gw.go +++ b/pkg/core/gen/core_proto/protocol.pb.gw.go @@ -257,6 +257,74 @@ func local_request_Protocol_Ping_0(ctx context.Context, marshaler runtime.Marsha } +func request_Protocol_GetRegistrationAttestation_0(ctx context.Context, marshaler runtime.Marshaler, client ProtocolClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegistrationAttestationRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Registration); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRegistrationAttestation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Protocol_GetRegistrationAttestation_0(ctx context.Context, marshaler runtime.Marshaler, server ProtocolServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RegistrationAttestationRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Registration); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRegistrationAttestation(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Protocol_GetDeregistrationAttestation_0(ctx context.Context, marshaler runtime.Marshaler, client ProtocolClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeregistrationAttestationRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Deregistration); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetDeregistrationAttestation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Protocol_GetDeregistrationAttestation_0(ctx context.Context, marshaler runtime.Marshaler, server ProtocolServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeregistrationAttestationRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Deregistration); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetDeregistrationAttestation(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterProtocolHandlerServer registers the http handlers for service Protocol to "mux". // UnaryRPC :call ProtocolServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -413,6 +481,56 @@ func RegisterProtocolHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) + mux.Handle("POST", pattern_Protocol_GetRegistrationAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/protocol.Protocol/GetRegistrationAttestation", runtime.WithHTTPPathPattern("/core/grpc/attest/registration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Protocol_GetRegistrationAttestation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Protocol_GetRegistrationAttestation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Protocol_GetDeregistrationAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/protocol.Protocol/GetDeregistrationAttestation", runtime.WithHTTPPathPattern("/core/grpc/attest/deregistration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Protocol_GetDeregistrationAttestation_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Protocol_GetDeregistrationAttestation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -586,6 +704,50 @@ func RegisterProtocolHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) + mux.Handle("POST", pattern_Protocol_GetRegistrationAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/protocol.Protocol/GetRegistrationAttestation", runtime.WithHTTPPathPattern("/core/grpc/attest/registration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Protocol_GetRegistrationAttestation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Protocol_GetRegistrationAttestation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_Protocol_GetDeregistrationAttestation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/protocol.Protocol/GetDeregistrationAttestation", runtime.WithHTTPPathPattern("/core/grpc/attest/deregistration")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Protocol_GetDeregistrationAttestation_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Protocol_GetDeregistrationAttestation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -601,6 +763,10 @@ var ( pattern_Protocol_GetNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"core", "grpc", "node_info"}, "")) pattern_Protocol_Ping_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"core", "grpc", "ping"}, "")) + + pattern_Protocol_GetRegistrationAttestation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"core", "grpc", "attest", "registration"}, "")) + + pattern_Protocol_GetDeregistrationAttestation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"core", "grpc", "attest", "deregistration"}, "")) ) var ( @@ -615,4 +781,8 @@ var ( forward_Protocol_GetNodeInfo_0 = runtime.ForwardResponseMessage forward_Protocol_Ping_0 = runtime.ForwardResponseMessage + + forward_Protocol_GetRegistrationAttestation_0 = runtime.ForwardResponseMessage + + forward_Protocol_GetDeregistrationAttestation_0 = runtime.ForwardResponseMessage ) diff --git a/pkg/core/gen/core_proto/protocol.swagger.json b/pkg/core/gen/core_proto/protocol.swagger.json index 11961295..97f79fa3 100644 --- a/pkg/core/gen/core_proto/protocol.swagger.json +++ b/pkg/core/gen/core_proto/protocol.swagger.json @@ -16,6 +16,70 @@ "application/json" ], "paths": { + "/core/grpc/attest/deregistration": { + "post": { + "operationId": "Protocol_GetDeregistrationAttestation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/protocolDeregistrationAttestationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "deregistration", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/protocolValidatorDeregistration" + } + } + ], + "tags": [ + "Protocol" + ] + } + }, + "/core/grpc/attest/registration": { + "post": { + "operationId": "Protocol_GetRegistrationAttestation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/protocolRegistrationAttestationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "registration", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/protocolValidatorRegistration" + } + } + ], + "tags": [ + "Protocol" + ] + } + }, "/core/grpc/block/{height}": { "get": { "operationId": "Protocol_GetBlock", @@ -202,6 +266,23 @@ }, "additionalProperties": {} }, + "protocolAttestation": { + "type": "object", + "properties": { + "signatures": { + "type": "array", + "items": { + "type": "string" + } + }, + "validatorRegistration": { + "$ref": "#/definitions/protocolValidatorRegistration" + }, + "validatorDeregistration": { + "$ref": "#/definitions/protocolValidatorDeregistration" + } + } + }, "protocolBlockResponse": { "type": "object", "properties": { @@ -243,6 +324,17 @@ } } }, + "protocolDeregistrationAttestationResponse": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "deregistration": { + "$ref": "#/definitions/protocolValidatorDeregistration" + } + } + }, "protocolForwardTransactionResponse": { "type": "object" }, @@ -306,6 +398,17 @@ } } }, + "protocolRegistrationAttestationResponse": { + "type": "object", + "properties": { + "signature": { + "type": "string" + }, + "registration": { + "$ref": "#/definitions/protocolValidatorRegistration" + } + } + }, "protocolSignedTransaction": { "type": "object", "properties": { @@ -319,7 +422,7 @@ "$ref": "#/definitions/protocolTrackPlays" }, "validatorRegistration": { - "$ref": "#/definitions/protocolValidatorRegistration" + "$ref": "#/definitions/protocolValidatorRegistrationLegacy" }, "slaRollup": { "$ref": "#/definitions/protocolSlaRollup" @@ -328,13 +431,16 @@ "$ref": "#/definitions/protocolManageEntityLegacy" }, "validatorDeregistration": { - "$ref": "#/definitions/protocolValidatorDeregistration" + "$ref": "#/definitions/protocolValidatorMisbehaviorDeregistration" }, "storageProof": { "$ref": "#/definitions/protocolStorageProof" }, "storageProofVerification": { "$ref": "#/definitions/protocolStorageProofVerification" + }, + "attestation": { + "$ref": "#/definitions/protocolAttestation" } } }, @@ -470,6 +576,22 @@ } }, "protocolValidatorDeregistration": { + "type": "object", + "properties": { + "cometAddress": { + "type": "string" + }, + "pubKey": { + "type": "string", + "format": "byte" + }, + "deadline": { + "type": "string", + "format": "int64" + } + } + }, + "protocolValidatorMisbehaviorDeregistration": { "type": "object", "properties": { "cometAddress": { @@ -482,6 +604,42 @@ } }, "protocolValidatorRegistration": { + "type": "object", + "properties": { + "delegateWallet": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "nodeType": { + "type": "string" + }, + "spId": { + "type": "string" + }, + "ethBlock": { + "type": "string", + "format": "int64" + }, + "cometAddress": { + "type": "string" + }, + "pubKey": { + "type": "string", + "format": "byte" + }, + "power": { + "type": "string", + "format": "int64" + }, + "deadline": { + "type": "string", + "format": "int64" + } + } + }, + "protocolValidatorRegistrationLegacy": { "type": "object", "properties": { "endpoint": { diff --git a/pkg/core/gen/core_proto/protocol_grpc.pb.go b/pkg/core/gen/core_proto/protocol_grpc.pb.go index a53f13c7..2b33fe1b 100644 --- a/pkg/core/gen/core_proto/protocol_grpc.pb.go +++ b/pkg/core/gen/core_proto/protocol_grpc.pb.go @@ -19,12 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Protocol_SendTransaction_FullMethodName = "/protocol.Protocol/SendTransaction" - Protocol_ForwardTransaction_FullMethodName = "/protocol.Protocol/ForwardTransaction" - Protocol_GetTransaction_FullMethodName = "/protocol.Protocol/GetTransaction" - Protocol_GetBlock_FullMethodName = "/protocol.Protocol/GetBlock" - Protocol_GetNodeInfo_FullMethodName = "/protocol.Protocol/GetNodeInfo" - Protocol_Ping_FullMethodName = "/protocol.Protocol/Ping" + Protocol_SendTransaction_FullMethodName = "/protocol.Protocol/SendTransaction" + Protocol_ForwardTransaction_FullMethodName = "/protocol.Protocol/ForwardTransaction" + Protocol_GetTransaction_FullMethodName = "/protocol.Protocol/GetTransaction" + Protocol_GetBlock_FullMethodName = "/protocol.Protocol/GetBlock" + Protocol_GetNodeInfo_FullMethodName = "/protocol.Protocol/GetNodeInfo" + Protocol_Ping_FullMethodName = "/protocol.Protocol/Ping" + Protocol_GetRegistrationAttestation_FullMethodName = "/protocol.Protocol/GetRegistrationAttestation" + Protocol_GetDeregistrationAttestation_FullMethodName = "/protocol.Protocol/GetDeregistrationAttestation" ) // ProtocolClient is the client API for Protocol service. @@ -37,6 +39,8 @@ type ProtocolClient interface { GetBlock(ctx context.Context, in *GetBlockRequest, opts ...grpc.CallOption) (*BlockResponse, error) GetNodeInfo(ctx context.Context, in *GetNodeInfoRequest, opts ...grpc.CallOption) (*NodeInfoResponse, error) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) + GetRegistrationAttestation(ctx context.Context, in *RegistrationAttestationRequest, opts ...grpc.CallOption) (*RegistrationAttestationResponse, error) + GetDeregistrationAttestation(ctx context.Context, in *DeregistrationAttestationRequest, opts ...grpc.CallOption) (*DeregistrationAttestationResponse, error) } type protocolClient struct { @@ -101,6 +105,24 @@ func (c *protocolClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc return out, nil } +func (c *protocolClient) GetRegistrationAttestation(ctx context.Context, in *RegistrationAttestationRequest, opts ...grpc.CallOption) (*RegistrationAttestationResponse, error) { + out := new(RegistrationAttestationResponse) + err := c.cc.Invoke(ctx, Protocol_GetRegistrationAttestation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *protocolClient) GetDeregistrationAttestation(ctx context.Context, in *DeregistrationAttestationRequest, opts ...grpc.CallOption) (*DeregistrationAttestationResponse, error) { + out := new(DeregistrationAttestationResponse) + err := c.cc.Invoke(ctx, Protocol_GetDeregistrationAttestation_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ProtocolServer is the server API for Protocol service. // All implementations must embed UnimplementedProtocolServer // for forward compatibility @@ -111,6 +133,8 @@ type ProtocolServer interface { GetBlock(context.Context, *GetBlockRequest) (*BlockResponse, error) GetNodeInfo(context.Context, *GetNodeInfoRequest) (*NodeInfoResponse, error) Ping(context.Context, *PingRequest) (*PingResponse, error) + GetRegistrationAttestation(context.Context, *RegistrationAttestationRequest) (*RegistrationAttestationResponse, error) + GetDeregistrationAttestation(context.Context, *DeregistrationAttestationRequest) (*DeregistrationAttestationResponse, error) mustEmbedUnimplementedProtocolServer() } @@ -136,6 +160,12 @@ func (UnimplementedProtocolServer) GetNodeInfo(context.Context, *GetNodeInfoRequ func (UnimplementedProtocolServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } +func (UnimplementedProtocolServer) GetRegistrationAttestation(context.Context, *RegistrationAttestationRequest) (*RegistrationAttestationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRegistrationAttestation not implemented") +} +func (UnimplementedProtocolServer) GetDeregistrationAttestation(context.Context, *DeregistrationAttestationRequest) (*DeregistrationAttestationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeregistrationAttestation not implemented") +} func (UnimplementedProtocolServer) mustEmbedUnimplementedProtocolServer() {} // UnsafeProtocolServer may be embedded to opt out of forward compatibility for this service. @@ -257,6 +287,42 @@ func _Protocol_Ping_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Protocol_GetRegistrationAttestation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RegistrationAttestationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProtocolServer).GetRegistrationAttestation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Protocol_GetRegistrationAttestation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProtocolServer).GetRegistrationAttestation(ctx, req.(*RegistrationAttestationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Protocol_GetDeregistrationAttestation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeregistrationAttestationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProtocolServer).GetDeregistrationAttestation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Protocol_GetDeregistrationAttestation_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProtocolServer).GetDeregistrationAttestation(ctx, req.(*DeregistrationAttestationRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Protocol_ServiceDesc is the grpc.ServiceDesc for Protocol service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -288,6 +354,14 @@ var Protocol_ServiceDesc = grpc.ServiceDesc{ MethodName: "Ping", Handler: _Protocol_Ping_Handler, }, + { + MethodName: "GetRegistrationAttestation", + Handler: _Protocol_GetRegistrationAttestation_Handler, + }, + { + MethodName: "GetDeregistrationAttestation", + Handler: _Protocol_GetDeregistrationAttestation_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "protocol.proto", diff --git a/pkg/core/gen/models/protocol_attestation.go b/pkg/core/gen/models/protocol_attestation.go new file mode 100644 index 00000000..621502e4 --- /dev/null +++ b/pkg/core/gen/models/protocol_attestation.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolAttestation protocol attestation +// +// swagger:model protocolAttestation +type ProtocolAttestation struct { + + // signatures + Signatures []string `json:"signatures"` + + // validator deregistration + ValidatorDeregistration *ProtocolValidatorDeregistration `json:"validatorDeregistration,omitempty"` + + // validator registration + ValidatorRegistration *ProtocolValidatorRegistration `json:"validatorRegistration,omitempty"` +} + +// Validate validates this protocol attestation +func (m *ProtocolAttestation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateValidatorDeregistration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValidatorRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolAttestation) validateValidatorDeregistration(formats strfmt.Registry) error { + if swag.IsZero(m.ValidatorDeregistration) { // not required + return nil + } + + if m.ValidatorDeregistration != nil { + if err := m.ValidatorDeregistration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validatorDeregistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validatorDeregistration") + } + return err + } + } + + return nil +} + +func (m *ProtocolAttestation) validateValidatorRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.ValidatorRegistration) { // not required + return nil + } + + if m.ValidatorRegistration != nil { + if err := m.ValidatorRegistration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validatorRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validatorRegistration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this protocol attestation based on the context it is used +func (m *ProtocolAttestation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateValidatorDeregistration(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateValidatorRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolAttestation) contextValidateValidatorDeregistration(ctx context.Context, formats strfmt.Registry) error { + + if m.ValidatorDeregistration != nil { + + if swag.IsZero(m.ValidatorDeregistration) { // not required + return nil + } + + if err := m.ValidatorDeregistration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validatorDeregistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validatorDeregistration") + } + return err + } + } + + return nil +} + +func (m *ProtocolAttestation) contextValidateValidatorRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.ValidatorRegistration != nil { + + if swag.IsZero(m.ValidatorRegistration) { // not required + return nil + } + + if err := m.ValidatorRegistration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("validatorRegistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("validatorRegistration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolAttestation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolAttestation) UnmarshalBinary(b []byte) error { + var res ProtocolAttestation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_deregistration_attestation_response.go b/pkg/core/gen/models/protocol_deregistration_attestation_response.go new file mode 100644 index 00000000..57f72f08 --- /dev/null +++ b/pkg/core/gen/models/protocol_deregistration_attestation_response.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolDeregistrationAttestationResponse protocol deregistration attestation response +// +// swagger:model protocolDeregistrationAttestationResponse +type ProtocolDeregistrationAttestationResponse struct { + + // deregistration + Deregistration *ProtocolValidatorDeregistration `json:"deregistration,omitempty"` + + // signature + Signature string `json:"signature,omitempty"` +} + +// Validate validates this protocol deregistration attestation response +func (m *ProtocolDeregistrationAttestationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeregistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolDeregistrationAttestationResponse) validateDeregistration(formats strfmt.Registry) error { + if swag.IsZero(m.Deregistration) { // not required + return nil + } + + if m.Deregistration != nil { + if err := m.Deregistration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deregistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deregistration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this protocol deregistration attestation response based on the context it is used +func (m *ProtocolDeregistrationAttestationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDeregistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolDeregistrationAttestationResponse) contextValidateDeregistration(ctx context.Context, formats strfmt.Registry) error { + + if m.Deregistration != nil { + + if swag.IsZero(m.Deregistration) { // not required + return nil + } + + if err := m.Deregistration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deregistration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deregistration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolDeregistrationAttestationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolDeregistrationAttestationResponse) UnmarshalBinary(b []byte) error { + var res ProtocolDeregistrationAttestationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_eth_registration.go b/pkg/core/gen/models/protocol_eth_registration.go new file mode 100644 index 00000000..0bbeaad0 --- /dev/null +++ b/pkg/core/gen/models/protocol_eth_registration.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolEthRegistration protocol eth registration +// +// swagger:model protocolEthRegistration +type ProtocolEthRegistration struct { + + // delegate wallet + DelegateWallet string `json:"delegateWallet,omitempty"` + + // endpoint + Endpoint string `json:"endpoint,omitempty"` + + // eth block + EthBlock string `json:"ethBlock,omitempty"` + + // node type + NodeType string `json:"nodeType,omitempty"` + + // sp Id + SpID string `json:"spId,omitempty"` +} + +// Validate validates this protocol eth registration +func (m *ProtocolEthRegistration) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protocol eth registration based on context it is used +func (m *ProtocolEthRegistration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolEthRegistration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolEthRegistration) UnmarshalBinary(b []byte) error { + var res ProtocolEthRegistration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_height_response.go b/pkg/core/gen/models/protocol_height_response.go new file mode 100644 index 00000000..ccea8363 --- /dev/null +++ b/pkg/core/gen/models/protocol_height_response.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolHeightResponse protocol height response +// +// swagger:model protocolHeightResponse +type ProtocolHeightResponse struct { + + // height + Height string `json:"height,omitempty"` +} + +// Validate validates this protocol height response +func (m *ProtocolHeightResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protocol height response based on context it is used +func (m *ProtocolHeightResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolHeightResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolHeightResponse) UnmarshalBinary(b []byte) error { + var res ProtocolHeightResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_registration_attestation_request.go b/pkg/core/gen/models/protocol_registration_attestation_request.go new file mode 100644 index 00000000..09c46dfc --- /dev/null +++ b/pkg/core/gen/models/protocol_registration_attestation_request.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolRegistrationAttestationRequest protocol registration attestation request +// +// swagger:model protocolRegistrationAttestationRequest +type ProtocolRegistrationAttestationRequest struct { + + // registration + Registration *ProtocolEthRegistration `json:"registration,omitempty"` +} + +// Validate validates this protocol registration attestation request +func (m *ProtocolRegistrationAttestationRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolRegistrationAttestationRequest) validateRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.Registration) { // not required + return nil + } + + if m.Registration != nil { + if err := m.Registration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this protocol registration attestation request based on the context it is used +func (m *ProtocolRegistrationAttestationRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolRegistrationAttestationRequest) contextValidateRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.Registration != nil { + + if swag.IsZero(m.Registration) { // not required + return nil + } + + if err := m.Registration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolRegistrationAttestationRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolRegistrationAttestationRequest) UnmarshalBinary(b []byte) error { + var res ProtocolRegistrationAttestationRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_registration_attestation_response.go b/pkg/core/gen/models/protocol_registration_attestation_response.go new file mode 100644 index 00000000..8f5aa940 --- /dev/null +++ b/pkg/core/gen/models/protocol_registration_attestation_response.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolRegistrationAttestationResponse protocol registration attestation response +// +// swagger:model protocolRegistrationAttestationResponse +type ProtocolRegistrationAttestationResponse struct { + + // registration + Registration *ProtocolValidatorRegistration `json:"registration,omitempty"` + + // signature + Signature string `json:"signature,omitempty"` +} + +// Validate validates this protocol registration attestation response +func (m *ProtocolRegistrationAttestationResponse) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRegistration(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolRegistrationAttestationResponse) validateRegistration(formats strfmt.Registry) error { + if swag.IsZero(m.Registration) { // not required + return nil + } + + if m.Registration != nil { + if err := m.Registration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// ContextValidate validate this protocol registration attestation response based on the context it is used +func (m *ProtocolRegistrationAttestationResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRegistration(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProtocolRegistrationAttestationResponse) contextValidateRegistration(ctx context.Context, formats strfmt.Registry) error { + + if m.Registration != nil { + + if swag.IsZero(m.Registration) { // not required + return nil + } + + if err := m.Registration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("registration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("registration") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolRegistrationAttestationResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolRegistrationAttestationResponse) UnmarshalBinary(b []byte) error { + var res ProtocolRegistrationAttestationResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_signed_transaction.go b/pkg/core/gen/models/protocol_signed_transaction.go index 58404da4..13d1917c 100644 --- a/pkg/core/gen/models/protocol_signed_transaction.go +++ b/pkg/core/gen/models/protocol_signed_transaction.go @@ -18,6 +18,9 @@ import ( // swagger:model protocolSignedTransaction type ProtocolSignedTransaction struct { + // attestation + Attestation *ProtocolAttestation `json:"attestation,omitempty"` + // manage entity ManageEntity *ProtocolManageEntityLegacy `json:"manageEntity,omitempty"` @@ -40,16 +43,20 @@ type ProtocolSignedTransaction struct { StorageProofVerification *ProtocolStorageProofVerification `json:"storageProofVerification,omitempty"` // validator deregistration - ValidatorDeregistration *ProtocolValidatorDeregistration `json:"validatorDeregistration,omitempty"` + ValidatorDeregistration *ProtocolValidatorMisbehaviorDeregistration `json:"validatorDeregistration,omitempty"` // validator registration - ValidatorRegistration *ProtocolValidatorRegistration `json:"validatorRegistration,omitempty"` + ValidatorRegistration *ProtocolValidatorRegistrationLegacy `json:"validatorRegistration,omitempty"` } // Validate validates this protocol signed transaction func (m *ProtocolSignedTransaction) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAttestation(formats); err != nil { + res = append(res, err) + } + if err := m.validateManageEntity(formats); err != nil { res = append(res, err) } @@ -84,6 +91,25 @@ func (m *ProtocolSignedTransaction) Validate(formats strfmt.Registry) error { return nil } +func (m *ProtocolSignedTransaction) validateAttestation(formats strfmt.Registry) error { + if swag.IsZero(m.Attestation) { // not required + return nil + } + + if m.Attestation != nil { + if err := m.Attestation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attestation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attestation") + } + return err + } + } + + return nil +} + func (m *ProtocolSignedTransaction) validateManageEntity(formats strfmt.Registry) error { if swag.IsZero(m.ManageEntity) { // not required return nil @@ -221,6 +247,10 @@ func (m *ProtocolSignedTransaction) validateValidatorRegistration(formats strfmt func (m *ProtocolSignedTransaction) ContextValidate(ctx context.Context, formats strfmt.Registry) error { var res []error + if err := m.contextValidateAttestation(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateManageEntity(ctx, formats); err != nil { res = append(res, err) } @@ -255,6 +285,27 @@ func (m *ProtocolSignedTransaction) ContextValidate(ctx context.Context, formats return nil } +func (m *ProtocolSignedTransaction) contextValidateAttestation(ctx context.Context, formats strfmt.Registry) error { + + if m.Attestation != nil { + + if swag.IsZero(m.Attestation) { // not required + return nil + } + + if err := m.Attestation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("attestation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("attestation") + } + return err + } + } + + return nil +} + func (m *ProtocolSignedTransaction) contextValidateManageEntity(ctx context.Context, formats strfmt.Registry) error { if m.ManageEntity != nil { diff --git a/pkg/core/gen/models/protocol_validator_deregistration.go b/pkg/core/gen/models/protocol_validator_deregistration.go index b508f181..898836ca 100644 --- a/pkg/core/gen/models/protocol_validator_deregistration.go +++ b/pkg/core/gen/models/protocol_validator_deregistration.go @@ -20,6 +20,9 @@ type ProtocolValidatorDeregistration struct { // comet address CometAddress string `json:"cometAddress,omitempty"` + // deadline + Deadline string `json:"deadline,omitempty"` + // pub key // Format: byte PubKey strfmt.Base64 `json:"pubKey,omitempty"` diff --git a/pkg/core/gen/models/protocol_validator_info.go b/pkg/core/gen/models/protocol_validator_info.go new file mode 100644 index 00000000..4713591f --- /dev/null +++ b/pkg/core/gen/models/protocol_validator_info.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolValidatorInfo protocol validator info +// +// swagger:model protocolValidatorInfo +type ProtocolValidatorInfo struct { + + // comet address + CometAddress string `json:"cometAddress,omitempty"` + + // pub key + // Format: byte + PubKey strfmt.Base64 `json:"pubKey,omitempty"` +} + +// Validate validates this protocol validator info +func (m *ProtocolValidatorInfo) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protocol validator info based on context it is used +func (m *ProtocolValidatorInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolValidatorInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolValidatorInfo) UnmarshalBinary(b []byte) error { + var res ProtocolValidatorInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_validator_misbehavior_deregistration.go b/pkg/core/gen/models/protocol_validator_misbehavior_deregistration.go new file mode 100644 index 00000000..45ecc430 --- /dev/null +++ b/pkg/core/gen/models/protocol_validator_misbehavior_deregistration.go @@ -0,0 +1,54 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolValidatorMisbehaviorDeregistration protocol validator misbehavior deregistration +// +// swagger:model protocolValidatorMisbehaviorDeregistration +type ProtocolValidatorMisbehaviorDeregistration struct { + + // comet address + CometAddress string `json:"cometAddress,omitempty"` + + // pub key + // Format: byte + PubKey strfmt.Base64 `json:"pubKey,omitempty"` +} + +// Validate validates this protocol validator misbehavior deregistration +func (m *ProtocolValidatorMisbehaviorDeregistration) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protocol validator misbehavior deregistration based on context it is used +func (m *ProtocolValidatorMisbehaviorDeregistration) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolValidatorMisbehaviorDeregistration) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolValidatorMisbehaviorDeregistration) UnmarshalBinary(b []byte) error { + var res ProtocolValidatorMisbehaviorDeregistration + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/gen/models/protocol_validator_registration.go b/pkg/core/gen/models/protocol_validator_registration.go index 78d307ac..70477a67 100644 --- a/pkg/core/gen/models/protocol_validator_registration.go +++ b/pkg/core/gen/models/protocol_validator_registration.go @@ -20,6 +20,12 @@ type ProtocolValidatorRegistration struct { // comet address CometAddress string `json:"cometAddress,omitempty"` + // deadline + Deadline string `json:"deadline,omitempty"` + + // delegate wallet + DelegateWallet string `json:"delegateWallet,omitempty"` + // endpoint Endpoint string `json:"endpoint,omitempty"` diff --git a/pkg/core/gen/models/protocol_validator_registration_legacy.go b/pkg/core/gen/models/protocol_validator_registration_legacy.go new file mode 100644 index 00000000..de82afd7 --- /dev/null +++ b/pkg/core/gen/models/protocol_validator_registration_legacy.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProtocolValidatorRegistrationLegacy protocol validator registration legacy +// +// swagger:model protocolValidatorRegistrationLegacy +type ProtocolValidatorRegistrationLegacy struct { + + // comet address + CometAddress string `json:"cometAddress,omitempty"` + + // endpoint + Endpoint string `json:"endpoint,omitempty"` + + // eth block + EthBlock string `json:"ethBlock,omitempty"` + + // node type + NodeType string `json:"nodeType,omitempty"` + + // power + Power string `json:"power,omitempty"` + + // pub key + // Format: byte + PubKey strfmt.Base64 `json:"pubKey,omitempty"` + + // sp Id + SpID string `json:"spId,omitempty"` +} + +// Validate validates this protocol validator registration legacy +func (m *ProtocolValidatorRegistrationLegacy) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this protocol validator registration legacy based on context it is used +func (m *ProtocolValidatorRegistrationLegacy) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ProtocolValidatorRegistrationLegacy) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProtocolValidatorRegistrationLegacy) UnmarshalBinary(b []byte) error { + var res ProtocolValidatorRegistrationLegacy + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/core/protocol/protocol.proto b/pkg/core/protocol/protocol.proto index 64c44418..cc46464e 100644 --- a/pkg/core/protocol/protocol.proto +++ b/pkg/core/protocol/protocol.proto @@ -32,6 +32,18 @@ service Protocol { rpc Ping(PingRequest) returns (PingResponse) { option (google.api.http) = {get: "/core/grpc/ping"}; } + rpc GetRegistrationAttestation(RegistrationAttestationRequest) returns (RegistrationAttestationResponse) { + option (google.api.http) = { + post: "/core/grpc/attest/registration" + body: "registration" + }; + } + rpc GetDeregistrationAttestation(DeregistrationAttestationRequest) returns (DeregistrationAttestationResponse) { + option (google.api.http) = { + post: "/core/grpc/attest/deregistration" + body: "deregistration" + }; + } } message SignedTransaction { @@ -39,12 +51,13 @@ message SignedTransaction { string request_id = 2; oneof transaction { TrackPlays plays = 1000; - ValidatorRegistration validator_registration = 1001; + ValidatorRegistrationLegacy validator_registration = 1001; SlaRollup sla_rollup = 1002; ManageEntityLegacy manage_entity = 1003; - ValidatorDeregistration validator_deregistration = 1004; + ValidatorMisbehaviorDeregistration validator_deregistration = 1004; StorageProof storage_proof = 1005; StorageProofVerification storage_proof_verification = 1006; + Attestation attestation = 1007; } } @@ -100,7 +113,7 @@ message TrackPlays { repeated TrackPlay plays = 1; } -message ValidatorRegistration { +message ValidatorRegistrationLegacy { string endpoint = 1; string comet_address = 2; string eth_block = 3; @@ -110,9 +123,27 @@ message ValidatorRegistration { int64 power = 7; } +message ValidatorRegistration { + string delegate_wallet = 1; + string endpoint = 2; + string node_type = 3; + string sp_id = 4; + int64 eth_block = 5; + string comet_address = 6; + bytes pub_key = 7; + int64 power = 8; + int64 deadline = 9; +} + +message ValidatorMisbehaviorDeregistration { + string comet_address = 1; + bytes pub_key = 2; +} + message ValidatorDeregistration { string comet_address = 1; bytes pub_key = 2; + int64 deadline = 3; } message TrackPlay { @@ -166,3 +197,29 @@ message ManageEntityLegacy { string signer = 7; string nonce = 8; } + +message RegistrationAttestationRequest { + ValidatorRegistration registration = 1; +} + +message RegistrationAttestationResponse { + string signature = 1; + ValidatorRegistration registration = 2; +} + +message DeregistrationAttestationRequest { + ValidatorDeregistration deregistration = 1; +} + +message DeregistrationAttestationResponse { + string signature = 1; + ValidatorDeregistration deregistration = 2; +} + +message Attestation { + repeated string signatures = 1; + oneof body { + ValidatorRegistration validator_registration = 1000; + ValidatorDeregistration validator_deregistration = 1001; + } +} diff --git a/pkg/core/server/abci.go b/pkg/core/server/abci.go index c074fbae..30fa4c21 100644 --- a/pkg/core/server/abci.go +++ b/pkg/core/server/abci.go @@ -228,7 +228,7 @@ func (s *Server) FinalizeBlock(ctx context.Context, req *abcitypes.FinalizeBlock if err != nil { s.logger.Errorf("error finalizing event: %v", err) txs[i] = &abcitypes.ExecTxResult{Code: 2} - } else if vr := signedTx.GetValidatorRegistration(); vr != nil { + } else if vr := signedTx.GetValidatorRegistration(); vr != nil { // TODO: delete legacy registration after chain rollover vrPubKey := ed25519.PubKey(vr.GetPubKey()) vrAddr := vrPubKey.Address().String() if _, ok := validatorUpdatesMap[vrAddr]; !ok { @@ -238,6 +238,27 @@ func (s *Server) FinalizeBlock(ctx context.Context, req *abcitypes.FinalizeBlock PubKeyType: "ed25519", } } + } else if att := signedTx.GetAttestation(); att != nil && att.GetValidatorRegistration() != nil { + vr := att.GetValidatorRegistration() + vrPubKey := ed25519.PubKey(vr.GetPubKey()) + vrAddr := vrPubKey.Address().String() + if _, ok := validatorUpdatesMap[vrAddr]; !ok { + validatorUpdatesMap[vrAddr] = abcitypes.ValidatorUpdate{ + Power: vr.Power, + PubKeyBytes: vr.PubKey, + PubKeyType: "ed25519", + } + } + } else if att := signedTx.GetAttestation(); att != nil && att.GetValidatorDeregistration() != nil { + vr := att.GetValidatorDeregistration() + vrPubKey := ed25519.PubKey(vr.GetPubKey()) + vrAddr := vrPubKey.Address().String() + // intentionally override any existing updates + validatorUpdatesMap[vrAddr] = abcitypes.ValidatorUpdate{ + Power: int64(0), + PubKeyBytes: vr.PubKey, + PubKeyType: "ed25519", + } } else if vd := signedTx.GetValidatorDeregistration(); vd != nil { vdPubKey := ed25519.PubKey(vd.GetPubKey()) vdAddr := vdPubKey.Address().String() @@ -454,13 +475,18 @@ func (s *Server) validateBlockTx(ctx context.Context, blockTime time.Time, block switch signedTx.Transaction.(type) { case *core_proto.SignedTransaction_Plays: + case *core_proto.SignedTransaction_Attestation: + if err := s.isValidAttestation(ctx, signedTx, blockHeight); err != nil { + s.logger.Error("Invalid block: invalid attestation tx", "error", err) + return false, nil + } case *core_proto.SignedTransaction_ValidatorRegistration: - if err := s.isValidRegisterNodeTx(signedTx); err != nil { + if err := s.isValidLegacyRegisterNodeTx(signedTx, blockHeight); err != nil { s.logger.Error("Invalid block: invalid register node tx", "error", err) return false, nil } case *core_proto.SignedTransaction_ValidatorDeregistration: - if err := s.isValidDeregisterNodeTx(signedTx, misbehavior); err != nil { + if err := s.isValidDeregisterMisbehavingNodeTx(signedTx, misbehavior); err != nil { s.logger.Error("Invalid block: invalid deregister node tx", "error", err) return false, nil } @@ -493,10 +519,12 @@ func (s *Server) finalizeTransaction(ctx context.Context, req *abcitypes.Finaliz return s.finalizePlayTransaction(ctx, msg) case *core_proto.SignedTransaction_ManageEntity: return s.finalizeManageEntity(ctx, msg) + case *core_proto.SignedTransaction_Attestation: + return s.finalizeAttestation(ctx, msg, req.Height) case *core_proto.SignedTransaction_ValidatorRegistration: - return s.finalizeRegisterNode(ctx, msg, req.Time) + return s.finalizeLegacyRegisterNode(ctx, msg, blockHeight) case *core_proto.SignedTransaction_ValidatorDeregistration: - return s.finalizeDeregisterNode(ctx, msg, misbehavior) + return s.finalizeDeregisterMisbehavingNode(ctx, msg, misbehavior) case *core_proto.SignedTransaction_SlaRollup: return s.finalizeSlaRollup(ctx, msg, txHash) case *core_proto.SignedTransaction_StorageProof: diff --git a/pkg/core/server/attestation.go b/pkg/core/server/attestation.go new file mode 100644 index 00000000..feb7203d --- /dev/null +++ b/pkg/core/server/attestation.go @@ -0,0 +1,112 @@ +package server + +import ( + "context" + "errors" + "fmt" + "sync" + + "github.com/AudiusProject/audiusd/pkg/core/common" + "github.com/AudiusProject/audiusd/pkg/core/gen/core_proto" + "github.com/jackc/pgx/v5" + "google.golang.org/protobuf/proto" +) + +func (s *Server) isValidAttestation(ctx context.Context, tx *core_proto.SignedTransaction, blockHeight int64) error { + att := tx.GetAttestation() + if att == nil { + return errors.New("empty attestation tx") + } + + bodyBytes, err := getAttestationBodyBytes(att) + if err != nil { + return fmt.Errorf("could not marshal attestation body into bytes: %v", err) + } + signerAddrs, err := recoverSigners(att.Signatures, bodyBytes) + if err != nil { + return fmt.Errorf("could not recover signers: %v", err) + } + + switch t := att.Body.(type) { + case *core_proto.Attestation_ValidatorRegistration: + return s.isValidRegisterNodeAttestation(ctx, tx, signerAddrs, blockHeight) + case *core_proto.Attestation_ValidatorDeregistration: + return s.isValidDeregisterNodeAttestation(ctx, tx, signerAddrs, blockHeight) + default: + return fmt.Errorf("unhandled attestation: %v %T", tx, t) + } +} + +func (s *Server) finalizeAttestation(ctx context.Context, tx *core_proto.SignedTransaction, blockHeight int64) (*core_proto.SignedTransaction, error) { + if err := s.isValidAttestation(ctx, tx, blockHeight); err != nil { + return nil, fmt.Errorf("invalid attestation during finalize step: %v", err) + } + + switch t := tx.GetAttestation().Body.(type) { + case *core_proto.Attestation_ValidatorRegistration: + return tx, s.finalizeRegisterNodeAttestation(ctx, tx, blockHeight) + default: + return nil, fmt.Errorf("unhandled attestation: %v %T", tx, t) + } +} + +func getAttestationBodyBytes(att *core_proto.Attestation) ([]byte, error) { + switch t := att.Body.(type) { + case *core_proto.Attestation_ValidatorRegistration: + return proto.Marshal(att.GetValidatorRegistration()) + default: + return nil, fmt.Errorf("unhandled attestation: %v %T", att, t) + } +} + +func recoverSigners(signatures []string, data []byte) ([]string, error) { + res := make([]string, len(signatures)) + type result struct { + index int + address string + err error + } + + ch := make(chan result, len(signatures)) + var wg sync.WaitGroup + for i, sig := range signatures { + wg.Add(1) + go func(i int, sig string) { + defer wg.Done() + _, address, err := common.EthRecover(sig, data) + ch <- result{i, address, err} + }(i, sig) + } + + wg.Wait() + close(ch) + + for r := range ch { + if r.err != nil { + return nil, fmt.Errorf("invalid signature provided to attestation tx: %v", r.err) + } + res[r.index] = r.address + } + + return res, nil +} + +func (s *Server) attestationHasEnoughSigners(ctx context.Context, signers []string, rendezvousKey []byte, rendezvousSize, signersNeeded int) (bool, error) { + addrs, err := s.db.GetAllEthAddressesOfRegisteredNodes(ctx) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return false, fmt.Errorf("failed to get core validators while validating registration: %v", err) + } + signersNeeded = min(len(addrs), signersNeeded) + rendezvous := common.GetAttestorRendezvous(addrs, rendezvousKey, rendezvousSize) + for _, address := range signers { + if rendezvous[address] { + signersNeeded-- + delete(rendezvous, address) + } + } + if signersNeeded > 0 { + s.logger.Infof("not enough attestations. Had: %d, needed: %d more", len(signers), signersNeeded) + return false, nil + } + return true, nil +} diff --git a/pkg/core/server/cache.go b/pkg/core/server/cache.go index da2db977..b96cc37e 100644 --- a/pkg/core/server/cache.go +++ b/pkg/core/server/cache.go @@ -12,11 +12,15 @@ import ( // a simple in memory cache of frequently queried things // maybe upgrade to something like bigcache later type Cache struct { - currentHeight int64 + currentHeight atomic.Int64 + catchingUp atomic.Bool } func NewCache() *Cache { - return &Cache{} + c := &Cache{} + c.currentHeight.Store(0) + c.catchingUp.Store(true) // assume syncing on startup + return c } // maybe put a separate errgroup in here for things that @@ -29,7 +33,7 @@ func (s *Server) startCache() error { return fmt.Errorf("could not get initial status: %v", err) } - atomic.StoreInt64(&s.cache.currentHeight, status.SyncInfo.LatestBlockHeight) + s.cache.currentHeight.Store(status.SyncInfo.LatestBlockHeight) node := s.node eb := node.EventBus() @@ -56,7 +60,7 @@ func (s *Server) startCache() error { case msg := <-subscription.Out(): blockEvent := msg.Data().(types.EventDataNewBlock) blockHeight := blockEvent.Block.Height - atomic.StoreInt64(&s.cache.currentHeight, blockHeight) + s.cache.currentHeight.Store(blockHeight) case err := <-subscription.Canceled(): s.logger.Errorf("Subscription cancelled: %v", err) return nil diff --git a/pkg/core/server/eth.go b/pkg/core/server/eth.go index 988c6f48..0708b02a 100644 --- a/pkg/core/server/eth.go +++ b/pkg/core/server/eth.go @@ -1,11 +1,16 @@ package server import ( + "bytes" "context" + "errors" "fmt" + "math/big" "time" "github.com/AudiusProject/audiusd/pkg/core/contracts" + "github.com/ethereum/go-ethereum/common" + "github.com/jackc/pgx/v5" "github.com/labstack/echo/v4" ) @@ -49,7 +54,8 @@ func (s *Server) startEthNodeManager() error { func (s *Server) gatherEthNodes() error { s.logger.Info("gathering ethereum nodes") - nodes, err := s.contracts.GetAllRegisteredNodes(context.Background()) + ctx := context.Background() + nodes, err := s.contracts.GetAllRegisteredNodes(ctx) if err != nil { return err } @@ -61,6 +67,7 @@ func (s *Server) gatherEthNodes() error { ethNodeMap := make(map[string]*contracts.Node, len(nodes)) duplicateEthNodeSet := make(map[string]*contracts.Node) + // identify duplicates for _, node := range nodes { ethaddr := node.DelegateOwnerWallet.String() if existingNode, ok := ethNodeMap[ethaddr]; ok { @@ -71,6 +78,18 @@ func (s *Server) gatherEthNodes() error { } } + // identify missing + missingEthNodeSet := make(map[string]bool) + existingValidators, err := s.db.GetAllRegisteredNodes(ctx) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return fmt.Errorf("could not get existing validators: %v", err) + } + for _, ev := range existingValidators { + if _, ok := ethNodeMap[ev.EthAddress]; !ok { + missingEthNodeSet[ev.EthAddress] = true + } + } + s.ethNodeMU.Lock() defer s.ethNodeMU.Unlock() @@ -81,6 +100,24 @@ func (s *Server) gatherEthNodes() error { } s.duplicateEthNodes = duplicateEthNodes + // handle deregistering nodes that have been missing for two cycles. + // (waiting for a second cycle ensures attestors will have noticed it missing too) + if !s.cache.catchingUp.Load() { + for _, addr := range s.missingEthNodes { + if missingEthNodeSet[addr] { + go s.deregisterMissingNode(ctx, addr) + } + } + } else { + s.logger.Info("skipping peer auto-deregistration while syncing") + } + + missingEthNodes := make([]string, 0, len(missingEthNodeSet)) + for addr, _ := range missingEthNodeSet { + missingEthNodes = append(missingEthNodes, addr) + } + s.missingEthNodes = missingEthNodes + return nil } @@ -90,9 +127,29 @@ func (s *Server) getEthNodesHandler(c echo.Context) error { res := struct { Nodes []*contracts.Node `json:"nodes"` DuplicateNodes []*contracts.Node `json:"duplicateNodes"` + MissingNodes []string `json:"missingNodes"` }{ Nodes: s.ethNodes, DuplicateNodes: s.duplicateEthNodes, + MissingNodes: s.missingEthNodes, } return c.JSON(200, res) } + +func (s *Server) isNodeRegisteredOnEthereum(delegateWallet common.Address, endpoint string, ethBlock *big.Int) bool { + s.ethNodeMU.RLock() + defer s.ethNodeMU.RUnlock() + for _, node := range s.ethNodes { + if !bytes.EqualFold(delegateWallet.Bytes(), node.DelegateOwnerWallet.Bytes()) { + continue + } + if endpoint != node.Endpoint { + continue + } + if node.BlockNumber.Cmp(ethBlock) != 0 { + continue + } + return true + } + return false +} diff --git a/pkg/core/server/grpc.go b/pkg/core/server/grpc.go index 4b26e442..8a1f046d 100644 --- a/pkg/core/server/grpc.go +++ b/pkg/core/server/grpc.go @@ -5,14 +5,15 @@ import ( "context" "errors" "fmt" + "math/big" "net" "reflect" "strings" - "sync/atomic" "time" "github.com/AudiusProject/audiusd/pkg/core/common" "github.com/AudiusProject/audiusd/pkg/core/gen/core_proto" + ethcommon "github.com/ethereum/go-ethereum/common" "github.com/iancoleman/strcase" "github.com/jackc/pgx/v5" "google.golang.org/protobuf/proto" @@ -158,7 +159,7 @@ func (s *Server) GetTransaction(ctx context.Context, req *core_proto.GetTransact } func (s *Server) GetBlock(ctx context.Context, req *core_proto.GetBlockRequest) (*core_proto.BlockResponse, error) { - currentHeight := atomic.LoadInt64(&s.cache.currentHeight) + currentHeight := s.cache.currentHeight.Load() if req.Height > currentHeight { return &core_proto.BlockResponse{ Chainid: s.config.GenesisFile.ChainID, @@ -256,7 +257,7 @@ func (s *Server) startGRPC() error { // Utilities func (s *Server) getBlockRpcFallback(ctx context.Context, height int64) (*core_proto.BlockResponse, error) { - currentHeight := s.cache.currentHeight + currentHeight := s.cache.currentHeight.Load() block, err := s.rpc.Block(ctx, &height) if err != nil { blockInFutureMsg := "must be less than or equal to the current blockchain height" @@ -294,3 +295,97 @@ func (s *Server) getBlockRpcFallback(ctx context.Context, height int64) (*core_p return res, nil } + +func (s *Server) GetRegistrationAttestation(ctx context.Context, req *core_proto.RegistrationAttestationRequest) (*core_proto.RegistrationAttestationResponse, error) { + reg := req.GetRegistration() + if reg == nil { + return nil, errors.New("empty registration attestation") + } + + if reg.Deadline < s.cache.currentHeight.Load() || reg.Deadline > s.cache.currentHeight.Load()+maxRegistrationAttestationValidity { + return nil, fmt.Errorf("Cannot sign registration request with deadline %d (current height is %d)", reg.Deadline, s.cache.currentHeight.Load()) + } + + if !s.isNodeRegisteredOnEthereum( + ethcommon.HexToAddress(reg.DelegateWallet), + reg.Endpoint, + big.NewInt(reg.EthBlock), + ) { + s.logger.Error( + "Could not attest to node eth registration", + "delegate", + reg.DelegateWallet, + "endpoint", + reg.Endpoint, + "eth block", + reg.EthBlock, + ) + return nil, errors.New("node is not registered on ethereum") + } + + regBytes, err := proto.Marshal(reg) + if err != nil { + s.logger.Error("could not marshal registration", "error", err) + return nil, err + } + sig, err := common.EthSign(s.config.EthereumKey, regBytes) + if err != nil { + s.logger.Error("could not sign registration", "error", err) + return nil, err + } + + return &core_proto.RegistrationAttestationResponse{ + Signature: sig, + Registration: reg, + }, nil +} + +func (s *Server) GetDeregistrationAttestation(ctx context.Context, req *core_proto.DeregistrationAttestationRequest) (*core_proto.DeregistrationAttestationResponse, error) { + dereg := req.GetDeregistration() + if dereg == nil { + return nil, errors.New("empty deregistration attestation") + } + + node, err := s.db.GetRegisteredNodeByCometAddress(ctx, dereg.CometAddress) + if err != nil { + return nil, fmt.Errorf("Could not attest deregistration for '%s': %v", dereg.CometAddress, err) + } + + ethBlock := new(big.Int) + ethBlock, ok := ethBlock.SetString(node.EthBlock, 10) + if !ok { + return nil, fmt.Errorf("Could not format eth block '%s' for node '%s'", node.EthBlock, node.Endpoint) + } + + if s.isNodeRegisteredOnEthereum( + ethcommon.HexToAddress(node.EthAddress), + node.Endpoint, + ethBlock, + ) { + s.logger.Error("Could not attest to node eth deregistration: node is still registered", + "cometAddress", + dereg.CometAddress, + "ethAddress", + node.EthAddress, + "endpoint", + node.Endpoint, + ) + return nil, errors.New("node is still registered on ethereum") + } + + deregBytes, err := proto.Marshal(dereg) + if err != nil { + s.logger.Error("could not marshal deregistration", "error", err) + return nil, err + } + sig, err := common.EthSign(s.config.EthereumKey, deregBytes) + if err != nil { + s.logger.Error("could not sign deregistration", "error", err) + return nil, err + } + + return &core_proto.DeregistrationAttestationResponse{ + Signature: sig, + Deregistration: dereg, + }, nil +} diff --git a/pkg/core/server/pos.go b/pkg/core/server/pos.go index 4c2be436..659d91d6 100644 --- a/pkg/core/server/pos.go +++ b/pkg/core/server/pos.go @@ -29,9 +29,8 @@ const ( // Called during FinalizeBlock. Keeps Proof of Storage subsystem up to date with current block. func (s *Server) syncPoS(_ context.Context, latestBlockHash []byte, latestBlockHeight int64) error { - if blockShouldTriggerNewPoSChallenge(latestBlockHash) { + if !s.cache.catchingUp.Load() && blockShouldTriggerNewPoSChallenge(latestBlockHash) { s.logger.Info("PoS Challenge triggered", "height", latestBlockHeight, "hash", hex.EncodeToString(latestBlockHash)) - // TODO: disable in block sync mode go s.sendPoSChallengeToStorage(latestBlockHash, latestBlockHeight) } return nil diff --git a/pkg/core/server/registration.go b/pkg/core/server/registration.go new file mode 100644 index 00000000..f973105c --- /dev/null +++ b/pkg/core/server/registration.go @@ -0,0 +1,261 @@ +package server + +import ( + "context" + "encoding/base64" + "encoding/binary" + "errors" + "fmt" + "strconv" + + "github.com/AudiusProject/audiusd/pkg/core/common" + "github.com/AudiusProject/audiusd/pkg/core/db" + "github.com/AudiusProject/audiusd/pkg/core/gen/core_proto" + abcitypes "github.com/cometbft/cometbft/abci/types" + cometcrypto "github.com/cometbft/cometbft/crypto" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cometbft/cometbft/types" + "github.com/google/uuid" + "github.com/jackc/pgx/v5" + "google.golang.org/protobuf/proto" +) + +const maxRegistrationAttestationValidity = 24 * 60 * 60 // Registration attestations are only valid for approx 24 hours +const maxDeregistrationAttestationValidity = 24 * 60 * 60 // Deregistration attestations are only valid for approx 24 hours + +func (s *Server) isValidRegisterNodeAttestation(ctx context.Context, tx *core_proto.SignedTransaction, signers []string, blockHeight int64) error { + vr := tx.GetAttestation().GetValidatorRegistration() + if vr == nil { + return fmt.Errorf("unknown tx fell into isValidRegisterNodeAttestation: %v", tx) + } + + // validate address from tx signature + sig := tx.GetSignature() + if sig == "" { + return fmt.Errorf("no signature provided for registration tx: %v", tx) + } + attBytes, err := proto.Marshal(tx.GetAttestation()) + if err != nil { + return fmt.Errorf("could not marshal registration tx: %v", err) + } + _, address, err := common.EthRecover(tx.GetSignature(), attBytes) + if err != nil { + return fmt.Errorf("could not recover msg sig: %v", err) + } + if address != vr.GetDelegateWallet() { + return fmt.Errorf("signature address '%s' does not match ethereum registration '%s'", address, vr.GetDelegateWallet()) + } + + // validate voting power + if vr.GetPower() != int64(s.config.ValidatorVotingPower) { + return fmt.Errorf("invalid voting power '%d'", vr.GetPower()) + } + + // validate pub key + if len(vr.GetPubKey()) == 0 { + return fmt.Errorf("public Key missing from %s registration tx", vr.GetEndpoint()) + } + vrPubKey := ed25519.PubKey(vr.GetPubKey()) + if vrPubKey.Address().String() != vr.GetCometAddress() { + return fmt.Errorf("address does not match public key: %s %s", vrPubKey.Address(), vr.GetCometAddress()) + } + + // ensure comet address is not already taken + if _, err := s.db.GetRegisteredNodeByCometAddress(context.Background(), vr.GetCometAddress()); !errors.Is(err, pgx.ErrNoRows) { + return fmt.Errorf("address '%s' is already registered on comet, node %s attempted to acquire it", vr.GetCometAddress(), vr.GetEndpoint()) + } + + // validate age of request + if vr.Deadline < blockHeight || vr.Deadline > blockHeight+maxRegistrationAttestationValidity { + return fmt.Errorf("Registration request for '%s' with deadline %d is too new/old (current height is %d)", vr.GetEndpoint(), vr.Deadline, blockHeight) + } + + // validate signers + keyBytes := make([]byte, 8) + binary.BigEndian.PutUint64(keyBytes, uint64(vr.GetEthBlock())) + enough, err := s.attestationHasEnoughSigners(ctx, signers, keyBytes, s.config.AttRegistrationRSize, s.config.AttRegistrationMin) + if err != nil { + return fmt.Errorf("Error checking attestors against validators: %v", err) + } else if !enough { + return fmt.Errorf("Not enough attestations provided to register validator at '%s'", vr.GetEndpoint()) + } + + return nil +} + +func (s *Server) finalizeRegisterNodeAttestation(ctx context.Context, tx *core_proto.SignedTransaction, blockHeight int64) error { + qtx := s.getDb() + vr := tx.GetAttestation().GetValidatorRegistration() + + txBytes, err := proto.Marshal(tx) + if err != nil { + return fmt.Errorf("could not unmarshal tx bytes: %v", err) + } + pubKey, _, err := common.EthRecover(tx.GetSignature(), txBytes) + if err != nil { + return fmt.Errorf("could not recover signer: %v", err) + } + + serializedPubKey, err := common.SerializePublicKey(pubKey) + if err != nil { + return fmt.Errorf("could not serialize pubkey: %v", err) + } + + // Do not reinsert duplicate registrations + if _, err = qtx.GetRegisteredNodeByEthAddress(ctx, vr.GetDelegateWallet()); errors.Is(err, pgx.ErrNoRows) { + err = qtx.InsertRegisteredNode(ctx, db.InsertRegisteredNodeParams{ + PubKey: serializedPubKey, + EthAddress: vr.GetDelegateWallet(), + Endpoint: vr.GetEndpoint(), + CometAddress: vr.GetCometAddress(), + CometPubKey: base64.StdEncoding.EncodeToString(vr.GetPubKey()), + EthBlock: strconv.FormatInt(vr.GetEthBlock(), 10), + NodeType: vr.GetNodeType(), + SpID: vr.GetSpId(), + }) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return fmt.Errorf("error inserting registered node: %v", err) + } + } + return nil +} + +func (s *Server) isValidDeregisterNodeAttestation(ctx context.Context, tx *core_proto.SignedTransaction, signers []string, blockHeight int64) error { + att := tx.GetAttestation() + if att == nil { + return fmt.Errorf("unknown attestation fell into isValidDeregisterNodeAttestation: %v", tx) + } + dereg := att.GetValidatorDeregistration() + if dereg == nil { + return fmt.Errorf("unknown attestation fell into isValidDeregisterNodeAttestation: %v", tx) + } + + addr := dereg.GetCometAddress() + + if len(dereg.GetPubKey()) == 0 { + return fmt.Errorf("public Key missing from deregistration attestation: %v", tx) + } + vdPubKey := ed25519.PubKey(dereg.GetPubKey()) + if vdPubKey.Address().String() != addr { + return fmt.Errorf("address does not match public key: %s %s", vdPubKey.Address(), addr) + } + + // validate age of request + if dereg.Deadline < blockHeight || dereg.Deadline > blockHeight+maxDeregistrationAttestationValidity { + return fmt.Errorf("Registration request for '%s' with deadline %d is too new/old (current height is %d)", addr, dereg.Deadline, blockHeight) + } + + // validate signers + enough, err := s.attestationHasEnoughSigners(ctx, signers, vdPubKey.Bytes(), s.config.AttDeregistrationRSize, s.config.AttDeregistrationMin) + if err != nil { + return fmt.Errorf("Error checking attestors against validators: %v", err) + } else if !enough { + return fmt.Errorf("Not enough attestations provided to deregister validator '%s'", addr) + } + + return nil +} + +func (s *Server) finalizeDeregisterValidatorAttestation(ctx context.Context, tx *core_proto.SignedTransaction, misbehavior []abcitypes.Misbehavior) error { + dereg := tx.GetAttestation().GetValidatorDeregistration() + if dereg == nil { + return fmt.Errorf("unknown attestation fell into isValidDeregisterNodeAttestation: %v", tx) + } + qtx := s.getDb() + err := qtx.DeleteRegisteredNode(ctx, dereg.GetCometAddress()) + if err != nil { + return fmt.Errorf("error deleting registered node: %v", err) + } + + return nil +} + +func (s *Server) isValidDeregisterMisbehavingNodeTx(tx *core_proto.SignedTransaction, misbehavior []abcitypes.Misbehavior) error { + sig := tx.GetSignature() + if sig == "" { + return fmt.Errorf("no signature provided for deregistration tx: %v", tx) + } + + vd := tx.GetValidatorDeregistration() + if vd == nil { + return fmt.Errorf("unknown tx fell into isValidDeregisterMisbehavingNodeTx: %v", tx) + } + + addr := vd.GetCometAddress() + + _, err := s.db.GetRegisteredNodeByCometAddress(context.Background(), addr) + if err != nil { + return fmt.Errorf("not able to find registered node: %v", err) + } + + if len(vd.GetPubKey()) == 0 { + return fmt.Errorf("public Key missing from deregistration tx: %v", tx) + } + vdPubKey := ed25519.PubKey(vd.GetPubKey()) + if vdPubKey.Address().String() != addr { + return fmt.Errorf("address does not match public key: %s %s", vdPubKey.Address(), addr) + } + + for _, mb := range misbehavior { + validator := mb.GetValidator() + if addr == cometcrypto.Address(validator.GetAddress()).String() { + return nil + } + } + + return fmt.Errorf("no misbehavior found matching deregistration tx: %v", tx) +} + +func (s *Server) finalizeDeregisterMisbehavingNode(ctx context.Context, tx *core_proto.SignedTransaction, misbehavior []abcitypes.Misbehavior) (*core_proto.ValidatorMisbehaviorDeregistration, error) { + if err := s.isValidDeregisterMisbehavingNodeTx(tx, misbehavior); err != nil { + return nil, fmt.Errorf("invalid deregister node tx: %v", err) + } + + vd := tx.GetValidatorDeregistration() + qtx := s.getDb() + err := qtx.DeleteRegisteredNode(ctx, vd.GetCometAddress()) + if err != nil { + return nil, fmt.Errorf("error deleting registered node: %v", err) + } + + return vd, nil +} + +func (s *Server) createDeregisterTransaction(address types.Address) ([]byte, error) { + node, err := s.db.GetRegisteredNodeByCometAddress(context.Background(), address.String()) + if err != nil { + return []byte{}, fmt.Errorf("not able to find registered node with address '%s': %v", address.String(), err) + } + pubkeyEnc, err := base64.StdEncoding.DecodeString(node.CometPubKey) + if err != nil { + return []byte{}, fmt.Errorf("could not decode public key '%s' as base64 encoded string: %v", node.CometPubKey, err) + } + deregistrationTx := &core_proto.ValidatorMisbehaviorDeregistration{ + PubKey: pubkeyEnc, + CometAddress: address.String(), + } + + txBytes, err := proto.Marshal(deregistrationTx) + if err != nil { + return []byte{}, fmt.Errorf("failure to marshal deregister tx: %v", err) + } + + sig, err := common.EthSign(s.config.EthereumKey, txBytes) + if err != nil { + return []byte{}, fmt.Errorf("could not sign deregister tx: %v", err) + } + + tx := core_proto.SignedTransaction{ + Signature: sig, + RequestId: uuid.NewString(), + Transaction: &core_proto.SignedTransaction_ValidatorDeregistration{ + ValidatorDeregistration: deregistrationTx, + }, + } + + signedTxBytes, err := proto.Marshal(&tx) + if err != nil { + return []byte{}, err + } + return signedTxBytes, nil +} diff --git a/pkg/core/server/registration_legacy.go b/pkg/core/server/registration_legacy.go new file mode 100644 index 00000000..8c558590 --- /dev/null +++ b/pkg/core/server/registration_legacy.go @@ -0,0 +1,72 @@ +package server + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + + "github.com/AudiusProject/audiusd/pkg/core/common" + "github.com/AudiusProject/audiusd/pkg/core/db" + "github.com/AudiusProject/audiusd/pkg/core/gen/core_proto" + "github.com/jackc/pgx/v5" + "google.golang.org/protobuf/proto" +) + +// checks if the register node tx is valid +// calls ethereum mainnet and validates signature to confirm node should be a validator +func (s *Server) isValidLegacyRegisterNodeTx(_ *core_proto.SignedTransaction, blockHeight int64) error { + // We only care if this attempted legacy registration is post-cutoff + if blockHeight > s.config.LegacyRegistrationCutoff { + return fmt.Errorf("Legacy registration is after cutoff.") + } + + return nil +} + +// persists the register node request should it pass validation +func (s *Server) finalizeLegacyRegisterNode(ctx context.Context, tx *core_proto.SignedTransaction, blockHeight int64) (*core_proto.ValidatorRegistrationLegacy, error) { + if err := s.isValidLegacyRegisterNodeTx(tx, blockHeight); err != nil { + return nil, fmt.Errorf("invalid register node tx: %v", err) + } + + qtx := s.getDb() + + vr := tx.GetValidatorRegistration() + sig := tx.GetSignature() + txBytes, err := proto.Marshal(vr) + if err != nil { + return nil, fmt.Errorf("could not unmarshal tx bytes: %v", err) + } + + pubKey, address, err := common.EthRecover(sig, txBytes) + if err != nil { + return nil, fmt.Errorf("could not recover signer: %v", err) + } + + serializedPubKey, err := common.SerializePublicKey(pubKey) + if err != nil { + return nil, fmt.Errorf("could not serialize pubkey: %v", err) + } + + registerNode := tx.GetValidatorRegistration() + + // Do not reinsert duplicate registrations + if _, err = qtx.GetRegisteredNodeByEthAddress(ctx, address); errors.Is(err, pgx.ErrNoRows) { + err = qtx.InsertRegisteredNode(ctx, db.InsertRegisteredNodeParams{ + PubKey: serializedPubKey, + EthAddress: address, + Endpoint: registerNode.GetEndpoint(), + CometAddress: registerNode.GetCometAddress(), + CometPubKey: base64.StdEncoding.EncodeToString(registerNode.GetPubKey()), + EthBlock: registerNode.GetEthBlock(), + NodeType: registerNode.GetNodeType(), + SpID: registerNode.GetSpId(), + }) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return nil, fmt.Errorf("error inserting registered node: %v", err) + } + } + + return vr, nil +} diff --git a/pkg/core/server/registry_bridge.go b/pkg/core/server/registry_bridge.go index 90c1dc97..bedd6d05 100644 --- a/pkg/core/server/registry_bridge.go +++ b/pkg/core/server/registry_bridge.go @@ -3,7 +3,7 @@ package server import ( "context" - "encoding/base64" + "encoding/binary" "errors" "fmt" "math/big" @@ -11,14 +11,11 @@ import ( "github.com/AudiusProject/audiusd/pkg/core/common" "github.com/AudiusProject/audiusd/pkg/core/contracts" - "github.com/AudiusProject/audiusd/pkg/core/db" + "github.com/AudiusProject/audiusd/pkg/core/gen/core_openapi/protocol" "github.com/AudiusProject/audiusd/pkg/core/gen/core_proto" "github.com/AudiusProject/audiusd/pkg/logger" - - abcitypes "github.com/cometbft/cometbft/abci/types" - cometcrypto "github.com/cometbft/cometbft/crypto" "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/cometbft/cometbft/types" + "github.com/ethereum/go-ethereum/accounts/abi/bind" geth "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -122,12 +119,10 @@ func (s *Server) RegisterSelf() error { return fmt.Errorf("node %s is claiming to be %s but that endpoint is owned by %s", nodeAddress.Hex(), nodeEndpoint, info.DelegateOwnerWallet.Hex()) } - ethBlock := info.BlockNumber.String() - nodeRecord, err := s.db.GetNodeByEndpoint(ctx, nodeEndpoint) if errors.Is(err, pgx.ErrNoRows) { s.logger.Infof("node %s not found on comet but found on eth, registering", nodeEndpoint) - if err := s.registerSelfOnComet(ethBlock, spID.String()); err != nil { + if err := s.registerSelfOnComet(ctx, info.DelegateOwnerWallet, info.BlockNumber, spID.String()); err != nil { return fmt.Errorf("could not register on comet: %v", err) } return nil @@ -143,12 +138,16 @@ func (s *Server) isDevEnvironment() bool { return s.config.Environment == "dev" || s.config.Environment == "sandbox" } -func (s *Server) registerSelfOnComet(ethBlock, spID string) error { +func (s *Server) registerSelfOnComet(ctx context.Context, delegateOwnerWallet geth.Address, ethBlock *big.Int, spID string) error { if err := s.isDuplicateDelegateOwnerWallet(s.config.WalletAddress); err != nil { s.logger.Errorf("node is a duplicate, not registering on comet: %s", s.config.WalletAddress) return nil } + if s.cache.catchingUp.Load() { + return errors.New("Aborting comet registration because node is still syncing.") + } + genValidators := s.config.GenesisFile.Validators isGenValidator := false for _, validator := range genValidators { @@ -170,17 +169,45 @@ func (s *Server) registerSelfOnComet(ethBlock, spID string) error { return fmt.Errorf("invalid node type: %v", err) } - registrationTx := &core_proto.ValidatorRegistration{ - Endpoint: s.config.NodeEndpoint, - CometAddress: s.config.ProposerAddress, - EthBlock: ethBlock, - NodeType: common.HexToUtf8(serviceType), - SpId: spID, - PubKey: s.config.CometKey.PubKey().Bytes(), - Power: int64(s.config.ValidatorVotingPower), + addrs, err := s.db.GetAllEthAddressesOfRegisteredNodes(ctx) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return fmt.Errorf("failed to get all registered nodes: %v", err) + } + keyBytes := make([]byte, 8) + binary.BigEndian.PutUint64(keyBytes, ethBlock.Uint64()) + rendezvous := common.GetAttestorRendezvous(addrs, keyBytes, s.config.AttRegistrationRSize) + + attestations := make([]string, 0, s.config.AttRegistrationRSize) + reg := &core_proto.ValidatorRegistration{ + CometAddress: s.config.ProposerAddress, + PubKey: s.config.CometKey.PubKey().Bytes(), + Power: int64(s.config.ValidatorVotingPower), + DelegateWallet: delegateOwnerWallet.Hex(), + Endpoint: s.config.NodeEndpoint, + NodeType: common.HexToUtf8(serviceType), + EthBlock: ethBlock.Int64(), + SpId: spID, + Deadline: s.cache.currentHeight.Load() + 120, + } + params := protocol.NewProtocolGetRegistrationAttestationParams() + params.SetRegistration(common.ValidatorRegistrationIntoOapi(reg)) + for addr, _ := range rendezvous { + if peer, ok := peers[addr]; ok { + resp, err := peer.ProtocolGetRegistrationAttestation(params) + if err != nil { + s.logger.Error("failed to get registration attestation from %s: %v", peer.OAPIEndpoint, err) + continue + } + attestations = append(attestations, resp.Payload.Signature) + } + } + + registrationAtt := &core_proto.Attestation{ + Signatures: attestations, + Body: &core_proto.Attestation_ValidatorRegistration{reg}, } - txBytes, err := proto.Marshal(registrationTx) + txBytes, err := proto.Marshal(registrationAtt) if err != nil { return fmt.Errorf("failure to marshal register tx: %v", err) } @@ -193,16 +220,16 @@ func (s *Server) registerSelfOnComet(ethBlock, spID string) error { tx := &core_proto.SignedTransaction{ Signature: sig, RequestId: uuid.NewString(), - Transaction: &core_proto.SignedTransaction_ValidatorRegistration{ - ValidatorRegistration: registrationTx, + Transaction: &core_proto.SignedTransaction_Attestation{ + Attestation: registrationAtt, }, } - req := &core_proto.SendTransactionRequest{ + txreq := &core_proto.SendTransactionRequest{ Transaction: tx, } - txhash, err := s.SendTransaction(context.Background(), req) + txhash, err := s.SendTransaction(context.Background(), txreq) if err != nil { return fmt.Errorf("send register tx failed: %v", err) } @@ -212,45 +239,6 @@ func (s *Server) registerSelfOnComet(ethBlock, spID string) error { return nil } -func (s *Server) createDeregisterTransaction(address types.Address) ([]byte, error) { - node, err := s.db.GetRegisteredNodeByCometAddress(context.Background(), address.String()) - if err != nil { - return []byte{}, fmt.Errorf("not able to find registered node with address '%s': %v", address.String(), err) - } - pubkeyEnc, err := base64.StdEncoding.DecodeString(node.CometPubKey) - if err != nil { - return []byte{}, fmt.Errorf("could not decode public key '%s' as base64 encoded string: %v", node.CometPubKey, err) - } - deregistrationTx := &core_proto.ValidatorDeregistration{ - PubKey: pubkeyEnc, - CometAddress: address.String(), - } - - txBytes, err := proto.Marshal(deregistrationTx) - if err != nil { - return []byte{}, fmt.Errorf("failure to marshal deregister tx: %v", err) - } - - sig, err := common.EthSign(s.config.EthereumKey, txBytes) - if err != nil { - return []byte{}, fmt.Errorf("could not sign deregister tx: %v", err) - } - - tx := core_proto.SignedTransaction{ - Signature: sig, - RequestId: uuid.NewString(), - Transaction: &core_proto.SignedTransaction_ValidatorDeregistration{ - ValidatorDeregistration: deregistrationTx, - }, - } - - signedTxBytes, err := proto.Marshal(&tx) - if err != nil { - return []byte{}, err - } - return signedTxBytes, nil -} - func (s *Server) awaitNodeCatchup(ctx context.Context) error { retries := 60 for tries := retries; tries >= 0; tries-- { @@ -382,113 +370,6 @@ func (s *Server) getRegisteredNode(endpoint string) (*contracts.Node, error) { return nil, fmt.Errorf("node not found: %s", endpoint) } -// checks if the register node tx is valid -// calls ethereum mainnet and validates signature to confirm node should be a validator -func (s *Server) isValidRegisterNodeTx(tx *core_proto.SignedTransaction) error { - sig := tx.GetSignature() - if sig == "" { - return fmt.Errorf("no signature provided for registration tx: %v", tx) - } - - vr := tx.GetValidatorRegistration() - if vr == nil { - return fmt.Errorf("unknown tx fell into isValidRegisterNodeTx: %v", tx) - } - - info, err := s.getRegisteredNode(vr.GetEndpoint()) - if err != nil { - return fmt.Errorf("not able to find registered node: %v", err) - } - - // compare on chain info to requested comet data - onChainOwnerWallet := info.DelegateOwnerWallet.Hex() - onChainBlockNumber := info.BlockNumber.String() - onChainEndpoint := info.Endpoint - - if err := s.isDuplicateDelegateOwnerWallet(onChainOwnerWallet); err != nil { - return err - } - - data, err := proto.Marshal(vr) - if err != nil { - return fmt.Errorf("could not marshal registration tx: %v", err) - } - - _, address, err := common.EthRecover(tx.GetSignature(), data) - if err != nil { - return fmt.Errorf("could not recover msg sig: %v", err) - } - - vrOwnerWallet := address - vrEndpoint := vr.GetEndpoint() - vrEthBlock := vr.GetEthBlock() - vrCometAddress := vr.GetCometAddress() - vrPower := int(vr.GetPower()) - - if len(vr.GetPubKey()) == 0 { - return fmt.Errorf("public Key missing from %s registration tx", vrEndpoint) - } - vrPubKey := ed25519.PubKey(vr.GetPubKey()) - - if onChainOwnerWallet != vrOwnerWallet { - return fmt.Errorf("wallet %s tried to register %s as %s", vrOwnerWallet, onChainOwnerWallet, vr.Endpoint) - } - - if onChainBlockNumber != vrEthBlock { - return fmt.Errorf("block number mismatch: %s %s", onChainBlockNumber, vrEthBlock) - } - - if onChainEndpoint != vrEndpoint { - return fmt.Errorf("endpoints don't match: %s %s", onChainEndpoint, vrEndpoint) - } - - if vrPubKey.Address().String() != vrCometAddress { - return fmt.Errorf("address does not match public key: %s %s", vrPubKey.Address(), vrCometAddress) - } - - if vrPower != s.config.ValidatorVotingPower { - return fmt.Errorf("invalid voting power '%d'", vrPower) - } - - return nil -} - -func (s *Server) isValidDeregisterNodeTx(tx *core_proto.SignedTransaction, misbehavior []abcitypes.Misbehavior) error { - sig := tx.GetSignature() - if sig == "" { - return fmt.Errorf("no signature provided for deregistration tx: %v", tx) - } - - vd := tx.GetValidatorDeregistration() - if vd == nil { - return fmt.Errorf("unknown tx fell into isValidDeregisterNodeTx: %v", tx) - } - - addr := vd.GetCometAddress() - - _, err := s.db.GetRegisteredNodeByCometAddress(context.Background(), addr) - if err != nil { - return fmt.Errorf("not able to find registered node: %v", err) - } - - if len(vd.GetPubKey()) == 0 { - return fmt.Errorf("public Key missing from deregistration tx: %v", tx) - } - vdPubKey := ed25519.PubKey(vd.GetPubKey()) - if vdPubKey.Address().String() != addr { - return fmt.Errorf("address does not match public key: %s %s", vdPubKey.Address(), addr) - } - - for _, mb := range misbehavior { - validator := mb.GetValidator() - if addr == cometcrypto.Address(validator.GetAddress()).String() { - return nil - } - } - - return fmt.Errorf("no misbehavior found matching deregistration tx: %v", tx) -} - func (s *Server) isDuplicateDelegateOwnerWallet(delegateOwnerWallet string) error { s.ethNodeMU.RLock() defer s.ethNodeMU.RUnlock() @@ -502,68 +383,75 @@ func (s *Server) isDuplicateDelegateOwnerWallet(delegateOwnerWallet string) erro return nil } -// persists the register node request should it pass validation -func (s *Server) finalizeRegisterNode(ctx context.Context, tx *core_proto.SignedTransaction, blockTime time.Time) (*core_proto.ValidatorRegistration, error) { - // TODO: remove logic after validator registration switches to attestations - oldBlock := time.Since(blockTime) >= week - if !oldBlock { - if err := s.isValidRegisterNodeTx(tx); err != nil { - return nil, fmt.Errorf("invalid register node tx: %v", err) - } +func (s *Server) deregisterMissingNode(ctx context.Context, ethAddress string) { + node, err := s.db.GetRegisteredNodeByEthAddress(ctx, ethAddress) + if err != nil { + s.logger.Error("could not deregister missing node", "address", ethAddress, "error", err) + return } - qtx := s.getDb() + addrs, err := s.db.GetAllEthAddressesOfRegisteredNodes(ctx) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + s.logger.Error("could not deregister node: failed to get currently registered nodes", "address", ethAddress, "error", err) + return + } + pubKey := ed25519.PubKey(node.CometPubKey) + rendezvous := common.GetAttestorRendezvous(addrs, pubKey.Bytes(), s.config.AttDeregistrationRSize) + attestations := make([]string, 0, s.config.AttRegistrationRSize) + dereg := &core_proto.ValidatorDeregistration{ + CometAddress: s.config.ProposerAddress, + PubKey: s.config.CometKey.PubKey().Bytes(), + Deadline: s.cache.currentHeight.Load() + 120, + } - vr := tx.GetValidatorRegistration() - sig := tx.GetSignature() - txBytes, err := proto.Marshal(vr) - if err != nil { - return nil, fmt.Errorf("could not unmarshal tx bytes: %v", err) + peers := s.GetPeers() + params := protocol.NewProtocolGetDeregistrationAttestationParams() + params.SetDeregistration(common.ValidatorDeregistrationIntoOapi(dereg)) + for addr, _ := range rendezvous { + if peer, ok := peers[addr]; ok { + resp, err := peer.ProtocolGetDeregistrationAttestation(params) + if err != nil { + s.logger.Error("failed to get deregistration attestation from %s: %v", peer.OAPIEndpoint, err) + continue + } + attestations = append(attestations, resp.Payload.Signature) + } + } + + deregistrationAtt := &core_proto.Attestation{ + Signatures: attestations, + Body: &core_proto.Attestation_ValidatorDeregistration{dereg}, } - pubKey, address, err := common.EthRecover(sig, txBytes) + txBytes, err := proto.Marshal(deregistrationAtt) if err != nil { - return nil, fmt.Errorf("could not recover signer: %v", err) + s.logger.Error("failure to marshal deregister tx", "error", err) + return } - serializedPubKey, err := common.SerializePublicKey(pubKey) + sig, err := common.EthSign(s.config.EthereumKey, txBytes) if err != nil { - return nil, fmt.Errorf("could not serialize pubkey: %v", err) - } - - registerNode := tx.GetValidatorRegistration() - - // Do not reinsert duplicate registrations - if _, err = qtx.GetRegisteredNodeByEthAddress(ctx, address); errors.Is(err, pgx.ErrNoRows) { - err = qtx.InsertRegisteredNode(ctx, db.InsertRegisteredNodeParams{ - PubKey: serializedPubKey, - EthAddress: address, - Endpoint: registerNode.GetEndpoint(), - CometAddress: registerNode.GetCometAddress(), - CometPubKey: base64.StdEncoding.EncodeToString(registerNode.GetPubKey()), - EthBlock: registerNode.GetEthBlock(), - NodeType: registerNode.GetNodeType(), - SpID: registerNode.GetSpId(), - }) - if err != nil && !errors.Is(err, pgx.ErrNoRows) { - return nil, fmt.Errorf("error inserting registered node: %v", err) - } + s.logger.Error("could not sign deregister tx", "error", err) + return } - return vr, nil -} + tx := &core_proto.SignedTransaction{ + Signature: sig, + RequestId: uuid.NewString(), + Transaction: &core_proto.SignedTransaction_Attestation{ + Attestation: deregistrationAtt, + }, + } -func (s *Server) finalizeDeregisterNode(ctx context.Context, tx *core_proto.SignedTransaction, misbehavior []abcitypes.Misbehavior) (*core_proto.ValidatorDeregistration, error) { - if err := s.isValidDeregisterNodeTx(tx, misbehavior); err != nil { - return nil, fmt.Errorf("invalid deregister node tx: %v", err) + txreq := &core_proto.SendTransactionRequest{ + Transaction: tx, } - vd := tx.GetValidatorDeregistration() - qtx := s.getDb() - err := qtx.DeleteRegisteredNode(ctx, vd.GetCometAddress()) + txhash, err := s.SendTransaction(context.Background(), txreq) if err != nil { - return nil, fmt.Errorf("error deleting registered node: %v", err) + s.logger.Error("send deregister tx failed", "error", err) + return } - return vd, nil + s.logger.Infof("deregistered node %s in tx %s", s.config.NodeEndpoint, txhash) } diff --git a/pkg/core/server/server.go b/pkg/core/server/server.go index 2ef4f5dd..84e73232 100644 --- a/pkg/core/server/server.go +++ b/pkg/core/server/server.go @@ -51,6 +51,7 @@ type Server struct { ethNodes []*contracts.Node duplicateEthNodes []*contracts.Node + missingEthNodes []string ethNodeMU sync.RWMutex awaitHttpServerReady chan struct{} @@ -100,6 +101,7 @@ func NewServer(config *config.Config, cconfig *cconfig.Config, logger *common.Lo ethNodes: ethNodes, duplicateEthNodes: duplicateEthNodes, + missingEthNodes: []string{}, awaitHttpServerReady: make(chan struct{}), awaitGrpcServerReady: make(chan struct{}), diff --git a/pkg/core/server/sync.go b/pkg/core/server/sync.go index 10201756..b1dd2f4b 100644 --- a/pkg/core/server/sync.go +++ b/pkg/core/server/sync.go @@ -39,7 +39,10 @@ func (s *Server) onSyncTick() error { } if status.SyncInfo.CatchingUp { + s.cache.catchingUp.Store(true) return ErrRpcNotSynced + } else { + s.cache.catchingUp.Store(false) } return nil