mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Return headers first (#1806)
* Return headers first * Delete TestHandleRelayInvs * resolve virtual only after IBD * Fix ResolveVirtual * Fix comments and variable names
This commit is contained in:
parent
d207888b67
commit
f26a7fdedf
@ -34,7 +34,7 @@ const (
|
||||
CmdVerAck
|
||||
CmdRequestAddresses
|
||||
CmdAddresses
|
||||
CmdRequestIBDBlocks
|
||||
CmdRequestHeaders
|
||||
CmdBlock
|
||||
CmdTx
|
||||
CmdPing
|
||||
@ -45,17 +45,17 @@ const (
|
||||
CmdRequestRelayBlocks
|
||||
CmdInvTransaction
|
||||
CmdRequestTransactions
|
||||
CmdDoneIBDBlocks
|
||||
CmdDoneHeaders
|
||||
CmdTransactionNotFound
|
||||
CmdReject
|
||||
CmdRequestNextIBDBlocks
|
||||
CmdRequestNextHeaders
|
||||
CmdRequestPruningPointUTXOSet
|
||||
CmdPruningPointUTXOSetChunk
|
||||
CmdUnexpectedPruningPoint
|
||||
CmdIBDBlockLocator
|
||||
CmdIBDBlockLocatorHighestHash
|
||||
CmdIBDBlockLocatorHighestHashNotFound
|
||||
CmdIBDBlocks
|
||||
CmdBlockHeaders
|
||||
CmdRequestNextPruningPointUTXOSetChunk
|
||||
CmdDonePruningPointUTXOSetChunks
|
||||
CmdBlockBlueWork
|
||||
@ -63,6 +63,8 @@ const (
|
||||
CmdDoneBlocksWithTrustedData
|
||||
CmdRequestPruningPointAndItsAnticone
|
||||
CmdRequestBlockBlueWork
|
||||
CmdIBDBlock
|
||||
CmdRequestIBDBlocks
|
||||
|
||||
// rpc
|
||||
CmdGetCurrentNetworkRequestMessage
|
||||
@ -150,7 +152,7 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
||||
CmdVerAck: "VerAck",
|
||||
CmdRequestAddresses: "RequestAddresses",
|
||||
CmdAddresses: "Addresses",
|
||||
CmdRequestIBDBlocks: "CmdRequestIBDBlocks",
|
||||
CmdRequestHeaders: "CmdRequestHeaders",
|
||||
CmdBlock: "Block",
|
||||
CmdTx: "Tx",
|
||||
CmdPing: "Ping",
|
||||
@ -161,17 +163,17 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
||||
CmdRequestRelayBlocks: "RequestRelayBlocks",
|
||||
CmdInvTransaction: "InvTransaction",
|
||||
CmdRequestTransactions: "RequestTransactions",
|
||||
CmdDoneIBDBlocks: "DoneIBDBlocks",
|
||||
CmdDoneHeaders: "DoneHeaders",
|
||||
CmdTransactionNotFound: "TransactionNotFound",
|
||||
CmdReject: "Reject",
|
||||
CmdRequestNextIBDBlocks: "RequestNextIBDBlocks",
|
||||
CmdRequestNextHeaders: "RequestNextHeaders",
|
||||
CmdRequestPruningPointUTXOSet: "RequestPruningPointUTXOSet",
|
||||
CmdPruningPointUTXOSetChunk: "PruningPointUTXOSetChunk",
|
||||
CmdUnexpectedPruningPoint: "UnexpectedPruningPoint",
|
||||
CmdIBDBlockLocator: "IBDBlockLocator",
|
||||
CmdIBDBlockLocatorHighestHash: "IBDBlockLocatorHighestHash",
|
||||
CmdIBDBlockLocatorHighestHashNotFound: "IBDBlockLocatorHighestHashNotFound",
|
||||
CmdIBDBlocks: "IBDBlocks",
|
||||
CmdBlockHeaders: "BlockHeaders",
|
||||
CmdRequestNextPruningPointUTXOSetChunk: "RequestNextPruningPointUTXOSetChunk",
|
||||
CmdDonePruningPointUTXOSetChunks: "DonePruningPointUTXOSetChunks",
|
||||
CmdBlockBlueWork: "BlockBlueWork",
|
||||
@ -179,6 +181,8 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
||||
CmdDoneBlocksWithTrustedData: "DoneBlocksWithTrustedData",
|
||||
CmdRequestPruningPointAndItsAnticone: "RequestPruningPointAndItsAnticoneHeaders",
|
||||
CmdRequestBlockBlueWork: "RequestBlockBlueWork",
|
||||
CmdIBDBlock: "IBDBlock",
|
||||
CmdRequestIBDBlocks: "RequestIBDBlocks",
|
||||
}
|
||||
|
||||
// RPCMessageCommandToString maps all MessageCommands to their string representation
|
||||
|
19
app/appmessage/p2p_blockheaders.go
Normal file
19
app/appmessage/p2p_blockheaders.go
Normal file
@ -0,0 +1,19 @@
|
||||
package appmessage
|
||||
|
||||
// BlockHeadersMessage represents a kaspa BlockHeaders message
|
||||
type BlockHeadersMessage struct {
|
||||
baseMessage
|
||||
BlockHeaders []*MsgBlockHeader
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *BlockHeadersMessage) Command() MessageCommand {
|
||||
return CmdBlockHeaders
|
||||
}
|
||||
|
||||
// NewBlockHeadersMessage returns a new kaspa BlockHeaders message
|
||||
func NewBlockHeadersMessage(blockHeaders []*MsgBlockHeader) *BlockHeadersMessage {
|
||||
return &BlockHeadersMessage{
|
||||
BlockHeaders: blockHeaders,
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package appmessage
|
||||
|
||||
// IBDBlocksMessage represents a kaspa IBDBlocks message
|
||||
type IBDBlocksMessage struct {
|
||||
baseMessage
|
||||
Blocks []*MsgBlock
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *IBDBlocksMessage) Command() MessageCommand {
|
||||
return CmdIBDBlocks
|
||||
}
|
||||
|
||||
// NewIBDBlocksMessage returns a new kaspa IBDBlocks message
|
||||
func NewIBDBlocksMessage(blocks []*MsgBlock) *IBDBlocksMessage {
|
||||
return &IBDBlocksMessage{
|
||||
Blocks: blocks,
|
||||
}
|
||||
}
|
22
app/appmessage/p2p_msgdoneheaders.go
Normal file
22
app/appmessage/p2p_msgdoneheaders.go
Normal file
@ -0,0 +1,22 @@
|
||||
package appmessage
|
||||
|
||||
// MsgDoneHeaders implements the Message interface and represents a kaspa
|
||||
// DoneHeaders message. It is used to notify the IBD syncing peer that the
|
||||
// syncer sent all the requested headers.
|
||||
//
|
||||
// This message has no payload.
|
||||
type MsgDoneHeaders struct {
|
||||
baseMessage
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgDoneHeaders) Command() MessageCommand {
|
||||
return CmdDoneHeaders
|
||||
}
|
||||
|
||||
// NewMsgDoneHeaders returns a new kaspa DoneIBDBlocks message that conforms to the
|
||||
// Message interface.
|
||||
func NewMsgDoneHeaders() *MsgDoneHeaders {
|
||||
return &MsgDoneHeaders{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package appmessage
|
||||
|
||||
// MsgDoneIBDBlocks implements the Message interface and represents a kaspa
|
||||
// DoneIBDBlocks message. It is used to notify the IBD syncing peer that the
|
||||
// syncer sent all the requested IBD blocks.
|
||||
//
|
||||
// This message has no payload.
|
||||
type MsgDoneIBDBlocks struct {
|
||||
baseMessage
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgDoneIBDBlocks) Command() MessageCommand {
|
||||
return CmdDoneIBDBlocks
|
||||
}
|
||||
|
||||
// NewMsgDoneIBDBlocks returns a new kaspa DoneIBDBlocks message that conforms to the
|
||||
// Message interface.
|
||||
func NewMsgDoneIBDBlocks() *MsgDoneIBDBlocks {
|
||||
return &MsgDoneIBDBlocks{}
|
||||
}
|
31
app/appmessage/p2p_msgibdblock.go
Normal file
31
app/appmessage/p2p_msgibdblock.go
Normal file
@ -0,0 +1,31 @@
|
||||
// Copyright (c) 2013-2016 The btcsuite developers
|
||||
// Use of this source code is governed by an ISC
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package appmessage
|
||||
|
||||
// MsgIBDBlock implements the Message interface and represents a kaspa
|
||||
// ibdblock message. It is used to deliver block and transaction information in
|
||||
// response to a RequestIBDBlocks message (MsgRequestIBDBlocks).
|
||||
type MsgIBDBlock struct {
|
||||
baseMessage
|
||||
*MsgBlock
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgIBDBlock) Command() MessageCommand {
|
||||
return CmdIBDBlock
|
||||
}
|
||||
|
||||
// MaxPayloadLength returns the maximum length the payload can be for the
|
||||
// receiver. This is part of the Message interface implementation.
|
||||
func (msg *MsgIBDBlock) MaxPayloadLength(pver uint32) uint32 {
|
||||
return MaxMessagePayload
|
||||
}
|
||||
|
||||
// NewMsgIBDBlock returns a new kaspa ibdblock message that conforms to the
|
||||
// Message interface. See MsgIBDBlock for details.
|
||||
func NewMsgIBDBlock(msgBlock *MsgBlock) *MsgIBDBlock {
|
||||
return &MsgIBDBlock{MsgBlock: msgBlock}
|
||||
}
|
34
app/appmessage/p2p_msgrequestheaders.go
Normal file
34
app/appmessage/p2p_msgrequestheaders.go
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright (c) 2013-2016 The btcsuite developers
|
||||
// Use of this source code is governed by an ISC
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package appmessage
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
)
|
||||
|
||||
// MsgRequestHeaders implements the Message interface and represents a kaspa
|
||||
// RequestHeaders message. It is used to request a list of blocks starting after the
|
||||
// low hash and until the high hash.
|
||||
type MsgRequestHeaders struct {
|
||||
baseMessage
|
||||
LowHash *externalapi.DomainHash
|
||||
HighHash *externalapi.DomainHash
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgRequestHeaders) Command() MessageCommand {
|
||||
return CmdRequestHeaders
|
||||
}
|
||||
|
||||
// NewMsgRequstHeaders returns a new kaspa RequestHeaders message that conforms to the
|
||||
// Message interface using the passed parameters and defaults for the remaining
|
||||
// fields.
|
||||
func NewMsgRequstHeaders(lowHash, highHash *externalapi.DomainHash) *MsgRequestHeaders {
|
||||
return &MsgRequestHeaders{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
}
|
||||
}
|
@ -25,7 +25,7 @@ func TestRequstIBDBlocks(t *testing.T) {
|
||||
}
|
||||
|
||||
// Ensure we get the same data back out.
|
||||
msg := NewMsgRequstIBDBlocks(lowHash, highHash)
|
||||
msg := NewMsgRequstHeaders(lowHash, highHash)
|
||||
if !msg.HighHash.Equal(highHash) {
|
||||
t.Errorf("NewMsgRequstIBDBlocks: wrong high hash - got %v, want %v",
|
||||
msg.HighHash, highHash)
|
@ -1,7 +1,3 @@
|
||||
// Copyright (c) 2013-2016 The btcsuite developers
|
||||
// Use of this source code is governed by an ISC
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package appmessage
|
||||
|
||||
import (
|
||||
@ -9,12 +5,11 @@ import (
|
||||
)
|
||||
|
||||
// MsgRequestIBDBlocks implements the Message interface and represents a kaspa
|
||||
// RequestIBDBlocks message. It is used to request a list of blocks starting after the
|
||||
// low hash and until the high hash.
|
||||
// RequestIBDBlocks message. It is used to request blocks as part of the IBD
|
||||
// protocol.
|
||||
type MsgRequestIBDBlocks struct {
|
||||
baseMessage
|
||||
LowHash *externalapi.DomainHash
|
||||
HighHash *externalapi.DomainHash
|
||||
Hashes []*externalapi.DomainHash
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
@ -23,12 +18,9 @@ func (msg *MsgRequestIBDBlocks) Command() MessageCommand {
|
||||
return CmdRequestIBDBlocks
|
||||
}
|
||||
|
||||
// NewMsgRequstIBDBlocks returns a new kaspa RequestIBDBlocks message that conforms to the
|
||||
// Message interface using the passed parameters and defaults for the remaining
|
||||
// fields.
|
||||
func NewMsgRequstIBDBlocks(lowHash, highHash *externalapi.DomainHash) *MsgRequestIBDBlocks {
|
||||
// NewMsgRequestIBDBlocks returns a new MsgRequestIBDBlocks.
|
||||
func NewMsgRequestIBDBlocks(hashes []*externalapi.DomainHash) *MsgRequestIBDBlocks {
|
||||
return &MsgRequestIBDBlocks{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
Hashes: hashes,
|
||||
}
|
||||
}
|
||||
|
22
app/appmessage/p2p_msgrequestnextheaders.go
Normal file
22
app/appmessage/p2p_msgrequestnextheaders.go
Normal file
@ -0,0 +1,22 @@
|
||||
package appmessage
|
||||
|
||||
// MsgRequestNextHeaders implements the Message interface and represents a kaspa
|
||||
// RequestNextHeaders message. It is used to notify the IBD syncer peer to send
|
||||
// more headers.
|
||||
//
|
||||
// This message has no payload.
|
||||
type MsgRequestNextHeaders struct {
|
||||
baseMessage
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgRequestNextHeaders) Command() MessageCommand {
|
||||
return CmdRequestNextHeaders
|
||||
}
|
||||
|
||||
// NewMsgRequestNextHeaders returns a new kaspa RequestNextHeaders message that conforms to the
|
||||
// Message interface.
|
||||
func NewMsgRequestNextHeaders() *MsgRequestNextHeaders {
|
||||
return &MsgRequestNextHeaders{}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package appmessage
|
||||
|
||||
// MsgRequestNextIBDBlocks implements the Message interface and represents a kaspa
|
||||
// RequestNextIBDBlocks message. It is used to notify the IBD syncer peer to send
|
||||
// more IBD blocks.
|
||||
//
|
||||
// This message has no payload.
|
||||
type MsgRequestNextIBDBlocks struct {
|
||||
baseMessage
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message. This is part
|
||||
// of the Message interface implementation.
|
||||
func (msg *MsgRequestNextIBDBlocks) Command() MessageCommand {
|
||||
return CmdRequestNextIBDBlocks
|
||||
}
|
||||
|
||||
// NewMsgRequestNextIBDBlocks returns a new kaspa RequestNextIBDBlocks message that conforms to the
|
||||
// Message interface.
|
||||
func NewMsgRequestNextIBDBlocks() *MsgRequestNextIBDBlocks {
|
||||
return &MsgRequestNextIBDBlocks{}
|
||||
}
|
54
app/protocol/flows/blockrelay/handle_ibd_block_requests.go
Normal file
54
app/protocol/flows/blockrelay/handle_ibd_block_requests.go
Normal file
@ -0,0 +1,54 @@
|
||||
package blockrelay
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/app/protocol/protocolerrors"
|
||||
"github.com/kaspanet/kaspad/domain"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// HandleIBDBlockRequestsContext is the interface for the context needed for the HandleIBDBlockRequests flow.
|
||||
type HandleIBDBlockRequestsContext interface {
|
||||
Domain() domain.Domain
|
||||
}
|
||||
|
||||
// HandleIBDBlockRequests listens to appmessage.MsgRequestRelayBlocks messages and sends
|
||||
// their corresponding blocks to the requesting peer.
|
||||
func HandleIBDBlockRequests(context HandleIBDBlockRequestsContext, incomingRoute *router.Route,
|
||||
outgoingRoute *router.Route) error {
|
||||
|
||||
for {
|
||||
message, err := incomingRoute.Dequeue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
msgRequestIBDBlocks := message.(*appmessage.MsgRequestIBDBlocks)
|
||||
log.Debugf("Got request for %d ibd blocks", len(msgRequestIBDBlocks.Hashes))
|
||||
for i, hash := range msgRequestIBDBlocks.Hashes {
|
||||
// Fetch the block from the database.
|
||||
blockInfo, err := context.Domain().Consensus().GetBlockInfo(hash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !blockInfo.Exists || blockInfo.BlockStatus == externalapi.StatusHeaderOnly {
|
||||
return protocolerrors.Errorf(true, "block %s not found", hash)
|
||||
}
|
||||
block, err := context.Domain().Consensus().GetBlock(hash)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "unable to fetch requested block hash %s", hash)
|
||||
}
|
||||
|
||||
// TODO (Partial nodes): Convert block to partial block if needed
|
||||
|
||||
blockMessage := appmessage.DomainBlockToMsgBlock(block)
|
||||
ibdBlockMessage := appmessage.NewMsgIBDBlock(blockMessage)
|
||||
err = outgoingRoute.Enqueue(ibdBlockMessage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("sent %d out of %d", i+1, len(msgRequestIBDBlocks.Hashes))
|
||||
}
|
||||
}
|
||||
}
|
105
app/protocol/flows/blockrelay/handle_request_headers.go
Normal file
105
app/protocol/flows/blockrelay/handle_request_headers.go
Normal file
@ -0,0 +1,105 @@
|
||||
package blockrelay
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/protocol/peer"
|
||||
"github.com/kaspanet/kaspad/app/protocol/protocolerrors"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/domain"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
)
|
||||
|
||||
const ibdBatchSize = router.DefaultMaxMessages
|
||||
|
||||
// RequestHeadersContext is the interface for the context needed for the HandleRequestHeaders flow.
|
||||
type RequestHeadersContext interface {
|
||||
Domain() domain.Domain
|
||||
}
|
||||
|
||||
type handleRequestHeadersFlow struct {
|
||||
RequestHeadersContext
|
||||
incomingRoute, outgoingRoute *router.Route
|
||||
peer *peer.Peer
|
||||
}
|
||||
|
||||
// HandleRequestHeaders handles RequestHeaders messages
|
||||
func HandleRequestHeaders(context RequestHeadersContext, incomingRoute *router.Route,
|
||||
outgoingRoute *router.Route, peer *peer.Peer) error {
|
||||
|
||||
flow := &handleRequestHeadersFlow{
|
||||
RequestHeadersContext: context,
|
||||
incomingRoute: incomingRoute,
|
||||
outgoingRoute: outgoingRoute,
|
||||
peer: peer,
|
||||
}
|
||||
return flow.start()
|
||||
}
|
||||
|
||||
func (flow *handleRequestHeadersFlow) start() error {
|
||||
for {
|
||||
lowHash, highHash, err := receiveRequestHeaders(flow.incomingRoute)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("Recieved requestHeaders with lowHash: %s, highHash: %s", lowHash, highHash)
|
||||
|
||||
for !lowHash.Equal(highHash) {
|
||||
log.Debugf("Getting block headers between %s and %s to %s", lowHash, highHash, flow.peer)
|
||||
|
||||
// GetHashesBetween is a relatively heavy operation so we limit it
|
||||
// in order to avoid locking the consensus for too long
|
||||
// maxBlocks MUST be >= MergeSetSizeLimit + 1
|
||||
const maxBlocks = 1 << 10
|
||||
blockHashes, _, err := flow.Domain().Consensus().GetHashesBetween(lowHash, highHash, maxBlocks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("Got %d header hashes above lowHash %s", len(blockHashes), lowHash)
|
||||
|
||||
blockHeaders := make([]*appmessage.MsgBlockHeader, len(blockHashes))
|
||||
for i, blockHash := range blockHashes {
|
||||
blockHeader, err := flow.Domain().Consensus().GetBlockHeader(blockHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blockHeaders[i] = appmessage.DomainBlockHeaderToBlockHeader(blockHeader)
|
||||
}
|
||||
|
||||
blockHeadersMessage := appmessage.NewBlockHeadersMessage(blockHeaders)
|
||||
err = flow.outgoingRoute.Enqueue(blockHeadersMessage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
message, err := flow.incomingRoute.Dequeue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, ok := message.(*appmessage.MsgRequestNextHeaders); !ok {
|
||||
return protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||
"expected: %s, got: %s", appmessage.CmdRequestNextHeaders, message.Command())
|
||||
}
|
||||
|
||||
// The next lowHash is the last element in blockHashes
|
||||
lowHash = blockHashes[len(blockHashes)-1]
|
||||
}
|
||||
|
||||
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgDoneHeaders())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func receiveRequestHeaders(incomingRoute *router.Route) (lowHash *externalapi.DomainHash,
|
||||
highHash *externalapi.DomainHash, err error) {
|
||||
|
||||
message, err := incomingRoute.Dequeue()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
msgRequestIBDBlocks := message.(*appmessage.MsgRequestHeaders)
|
||||
|
||||
return msgRequestIBDBlocks.LowHash, msgRequestIBDBlocks.HighHash, nil
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
package blockrelay
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/protocol/peer"
|
||||
"github.com/kaspanet/kaspad/app/protocol/protocolerrors"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/domain"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
)
|
||||
|
||||
const ibdBatchSize = router.DefaultMaxMessages
|
||||
|
||||
// RequestIBDBlocksContext is the interface for the context needed for the HandleRequestIBDBlocks flow.
|
||||
type RequestIBDBlocksContext interface {
|
||||
Domain() domain.Domain
|
||||
}
|
||||
|
||||
type handleRequestIBDBlocksFlow struct {
|
||||
RequestIBDBlocksContext
|
||||
incomingRoute, outgoingRoute *router.Route
|
||||
peer *peer.Peer
|
||||
}
|
||||
|
||||
// HandleRequestIBDBlocks handles RequestIBDBlocks messages
|
||||
func HandleRequestIBDBlocks(context RequestIBDBlocksContext, incomingRoute *router.Route,
|
||||
outgoingRoute *router.Route, peer *peer.Peer) error {
|
||||
|
||||
flow := &handleRequestIBDBlocksFlow{
|
||||
RequestIBDBlocksContext: context,
|
||||
incomingRoute: incomingRoute,
|
||||
outgoingRoute: outgoingRoute,
|
||||
peer: peer,
|
||||
}
|
||||
return flow.start()
|
||||
}
|
||||
|
||||
func (flow *handleRequestIBDBlocksFlow) start() error {
|
||||
for {
|
||||
lowHash, highHash, err := receiveRequestIBDBlocks(flow.incomingRoute)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("Received requestIBDBlocks with lowHash: %s, highHash: %s", lowHash, highHash)
|
||||
|
||||
for !lowHash.Equal(highHash) {
|
||||
log.Debugf("Getting blocks between %s and %s to %s", lowHash, highHash, flow.peer)
|
||||
|
||||
// GetHashesBetween is a relatively heavy operation so we limit it
|
||||
// in order to avoid locking the consensus for too long
|
||||
// maxBlocks MUST be >= MergeSetSizeLimit + 1
|
||||
const maxBlocks = 1 << 10
|
||||
blockHashes, _, err := flow.Domain().Consensus().GetHashesBetween(lowHash, highHash, maxBlocks)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Debugf("Got %d hashes above lowHash %s", len(blockHashes), lowHash)
|
||||
|
||||
step := 100
|
||||
for i := 0; i < len(blockHashes); i += step {
|
||||
end := i + step
|
||||
if end > len(blockHashes) {
|
||||
end = len(blockHashes)
|
||||
}
|
||||
|
||||
batchHashes := blockHashes[i:end]
|
||||
blocks := make([]*appmessage.MsgBlock, len(batchHashes))
|
||||
for i, blockHash := range batchHashes {
|
||||
block, err := flow.Domain().Consensus().GetBlock(blockHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blocks[i] = appmessage.DomainBlockToMsgBlock(block)
|
||||
}
|
||||
|
||||
ibdBlocksMessage := appmessage.NewIBDBlocksMessage(blocks)
|
||||
err = flow.outgoingRoute.Enqueue(ibdBlocksMessage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
message, err := flow.incomingRoute.Dequeue()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := message.(*appmessage.MsgRequestNextIBDBlocks); !ok {
|
||||
return protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||
"expected: %s, got: %s", appmessage.CmdRequestNextIBDBlocks, message.Command())
|
||||
}
|
||||
}
|
||||
|
||||
// The next lowHash is the last element in blockHashes
|
||||
lowHash = blockHashes[len(blockHashes)-1]
|
||||
}
|
||||
|
||||
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgDoneIBDBlocks())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func receiveRequestIBDBlocks(incomingRoute *router.Route) (lowHash *externalapi.DomainHash,
|
||||
highHash *externalapi.DomainHash, err error) {
|
||||
|
||||
message, err := incomingRoute.Dequeue()
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
msgRequestIBDBlocks := message.(*appmessage.MsgRequestIBDBlocks)
|
||||
|
||||
return msgRequestIBDBlocks.LowHash, msgRequestIBDBlocks.HighHash, nil
|
||||
}
|
@ -54,12 +54,17 @@ func (flow *handleRelayInvsFlow) runIBDIfNotRunning(highHash *externalapi.Domain
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
err = flow.syncPruningPointFuture(flow.Domain().Consensus(), highestSharedBlockHash, highHash, true)
|
||||
err = flow.syncPruningPointFutureHeaders(flow.Domain().Consensus(), highestSharedBlockHash, highHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = flow.syncMissingBlockBodies(highHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
log.Debugf("Finished syncing blocks up to %s", highHash)
|
||||
isFinishedSuccessfully = true
|
||||
return nil
|
||||
@ -190,36 +195,36 @@ func (flow *handleRelayInvsFlow) fetchHighestHash(
|
||||
}
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Consensus, highestSharedBlockHash *externalapi.DomainHash,
|
||||
highHash *externalapi.DomainHash, callOnNewBlock bool) error {
|
||||
func (flow *handleRelayInvsFlow) syncPruningPointFutureHeaders(consensus externalapi.Consensus, highestSharedBlockHash *externalapi.DomainHash,
|
||||
highHash *externalapi.DomainHash) error {
|
||||
|
||||
log.Infof("Downloading IBD blocks from %s", flow.peer)
|
||||
log.Infof("Downloading headers from %s", flow.peer)
|
||||
|
||||
err := flow.sendRequestIBDBlocks(highestSharedBlockHash, highHash)
|
||||
err := flow.sendRequestHeaders(highestSharedBlockHash, highHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Keep a short queue of ibdBlocksMessages so that there's
|
||||
// Keep a short queue of BlockHeadersMessages so that there's
|
||||
// never a moment when the node is not validating and inserting
|
||||
// blocks
|
||||
ibdBlocksMessageChan := make(chan *appmessage.IBDBlocksMessage, 2)
|
||||
// headers
|
||||
blockHeadersMessageChan := make(chan *appmessage.BlockHeadersMessage, 2)
|
||||
errChan := make(chan error)
|
||||
spawn("handleRelayInvsFlow-syncPruningPointFuture", func() {
|
||||
spawn("handleRelayInvsFlow-syncPruningPointFutureHeaders", func() {
|
||||
for {
|
||||
ibdBlocksMessage, doneIBD, err := flow.receiveIBDBlocks()
|
||||
blockHeadersMessage, doneIBD, err := flow.receiveHeaders()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
if doneIBD {
|
||||
close(ibdBlocksMessageChan)
|
||||
close(blockHeadersMessageChan)
|
||||
return
|
||||
}
|
||||
|
||||
ibdBlocksMessageChan <- ibdBlocksMessage
|
||||
blockHeadersMessageChan <- blockHeadersMessage
|
||||
|
||||
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgRequestNextIBDBlocks())
|
||||
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgRequestNextHeaders())
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
@ -229,7 +234,7 @@ func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Co
|
||||
|
||||
for {
|
||||
select {
|
||||
case ibdBlocksMessage, ok := <-ibdBlocksMessageChan:
|
||||
case ibdBlocksMessage, ok := <-blockHeadersMessageChan:
|
||||
if !ok {
|
||||
// If the highHash has not been received, the peer is misbehaving
|
||||
highHashBlockInfo, err := consensus.GetBlockInfo(highHash)
|
||||
@ -242,8 +247,8 @@ func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Co
|
||||
}
|
||||
return nil
|
||||
}
|
||||
for _, block := range ibdBlocksMessage.Blocks {
|
||||
err = flow.processIBDBlock(consensus, block, callOnNewBlock)
|
||||
for _, block := range ibdBlocksMessage.BlockHeaders {
|
||||
err = flow.processHeader(consensus, block)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -254,62 +259,60 @@ func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Co
|
||||
}
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) sendRequestIBDBlocks(highestSharedBlockHash *externalapi.DomainHash,
|
||||
func (flow *handleRelayInvsFlow) sendRequestHeaders(highestSharedBlockHash *externalapi.DomainHash,
|
||||
peerSelectedTipHash *externalapi.DomainHash) error {
|
||||
|
||||
msgGetBlockInvs := appmessage.NewMsgRequstIBDBlocks(highestSharedBlockHash, peerSelectedTipHash)
|
||||
msgGetBlockInvs := appmessage.NewMsgRequstHeaders(highestSharedBlockHash, peerSelectedTipHash)
|
||||
return flow.outgoingRoute.Enqueue(msgGetBlockInvs)
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) receiveIBDBlocks() (msgIBDBlock *appmessage.IBDBlocksMessage, doneIBD bool, err error) {
|
||||
func (flow *handleRelayInvsFlow) receiveHeaders() (msgIBDBlock *appmessage.BlockHeadersMessage, doneHeaders bool, err error) {
|
||||
message, err := flow.dequeueIncomingMessageAndSkipInvs(common.DefaultTimeout)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
switch message := message.(type) {
|
||||
case *appmessage.IBDBlocksMessage:
|
||||
case *appmessage.BlockHeadersMessage:
|
||||
return message, false, nil
|
||||
case *appmessage.MsgDoneIBDBlocks:
|
||||
case *appmessage.MsgDoneHeaders:
|
||||
return nil, true, nil
|
||||
default:
|
||||
return nil, false,
|
||||
protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||
"expected: %s or %s, got: %s",
|
||||
appmessage.CmdIBDBlocks,
|
||||
appmessage.CmdDoneIBDBlocks,
|
||||
appmessage.CmdBlockHeaders,
|
||||
appmessage.CmdDoneHeaders,
|
||||
message.Command())
|
||||
}
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) processIBDBlock(consensus externalapi.Consensus, msgBlock *appmessage.MsgBlock, callOnNewBlock bool) error {
|
||||
block := appmessage.MsgBlockToDomainBlock(msgBlock)
|
||||
func (flow *handleRelayInvsFlow) processHeader(consensus externalapi.Consensus, msgBlockHeader *appmessage.MsgBlockHeader) error {
|
||||
header := appmessage.BlockHeaderToDomainBlockHeader(msgBlockHeader)
|
||||
block := &externalapi.DomainBlock{
|
||||
Header: header,
|
||||
Transactions: nil,
|
||||
}
|
||||
|
||||
blockHash := consensushashing.BlockHash(block)
|
||||
blockInfo, err := flow.Domain().Consensus().GetBlockInfo(blockHash)
|
||||
blockInfo, err := consensus.GetBlockInfo(blockHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if blockInfo.Exists {
|
||||
log.Debugf("Block %s is already in the DAG. Skipping...", blockHash)
|
||||
log.Debugf("Block header %s is already in the DAG. Skipping...", blockHash)
|
||||
return nil
|
||||
}
|
||||
blockInsertionResult, err := consensus.ValidateAndInsertBlock(block, false)
|
||||
_, err = consensus.ValidateAndInsertBlock(block, false)
|
||||
if err != nil {
|
||||
if !errors.As(err, &ruleerrors.RuleError{}) {
|
||||
return errors.Wrapf(err, "failed to process block %s during IBD", blockHash)
|
||||
return errors.Wrapf(err, "failed to process header %s during IBD", blockHash)
|
||||
}
|
||||
|
||||
if errors.Is(err, ruleerrors.ErrDuplicateBlock) {
|
||||
log.Debugf("Skipping block %s as it is a duplicate", blockHash)
|
||||
log.Debugf("Skipping block header %s as it is a duplicate", blockHash)
|
||||
} else {
|
||||
log.Infof("Rejected block %s from %s during IBD: %s", blockHash, flow.peer, err)
|
||||
return protocolerrors.Wrapf(true, err, "got invalid block %s during IBD", blockHash)
|
||||
}
|
||||
}
|
||||
|
||||
if callOnNewBlock {
|
||||
err := flow.OnNewBlock(block, blockInsertionResult)
|
||||
if err != nil {
|
||||
return err
|
||||
log.Infof("Rejected block header %s from %s during IBD: %s", blockHash, flow.peer, err)
|
||||
return protocolerrors.Wrapf(true, err, "got invalid block header %s during IBD", blockHash)
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,6 +374,73 @@ func (flow *handleRelayInvsFlow) receiveAndInsertPruningPointUTXOSet(
|
||||
}
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) syncMissingBlockBodies(highHash *externalapi.DomainHash) error {
|
||||
hashes, err := flow.Domain().Consensus().GetMissingBlockBodyHashes(highHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(hashes) == 0 {
|
||||
// Blocks can be inserted inside the DAG during IBD if those were requested before IBD started.
|
||||
// In rare cases, all the IBD blocks might be already inserted by the time we reach this point.
|
||||
// In these cases - GetMissingBlockBodyHashes would return an empty array.
|
||||
log.Debugf("No missing block body hashes found.")
|
||||
return nil
|
||||
}
|
||||
|
||||
for offset := 0; offset < len(hashes); offset += ibdBatchSize {
|
||||
var hashesToRequest []*externalapi.DomainHash
|
||||
if offset+ibdBatchSize < len(hashes) {
|
||||
hashesToRequest = hashes[offset : offset+ibdBatchSize]
|
||||
} else {
|
||||
hashesToRequest = hashes[offset:]
|
||||
}
|
||||
|
||||
err := flow.outgoingRoute.Enqueue(appmessage.NewMsgRequestIBDBlocks(hashesToRequest))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, expectedHash := range hashesToRequest {
|
||||
message, err := flow.dequeueIncomingMessageAndSkipInvs(common.DefaultTimeout)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msgIBDBlock, ok := message.(*appmessage.MsgIBDBlock)
|
||||
if !ok {
|
||||
return protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||
"expected: %s, got: %s", appmessage.CmdIBDBlock, message.Command())
|
||||
}
|
||||
|
||||
block := appmessage.MsgBlockToDomainBlock(msgIBDBlock.MsgBlock)
|
||||
blockHash := consensushashing.BlockHash(block)
|
||||
if !expectedHash.Equal(blockHash) {
|
||||
return protocolerrors.Errorf(true, "expected block %s but got %s", expectedHash, blockHash)
|
||||
}
|
||||
|
||||
err = flow.banIfBlockIsHeaderOnly(block)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
blockInsertionResult, err := flow.Domain().Consensus().ValidateAndInsertBlock(block, false)
|
||||
if err != nil {
|
||||
if errors.Is(err, ruleerrors.ErrDuplicateBlock) {
|
||||
log.Debugf("Skipping IBD Block %s as it has already been added to the DAG", blockHash)
|
||||
continue
|
||||
}
|
||||
return protocolerrors.ConvertToBanningProtocolErrorIfRuleError(err, "invalid block %s", blockHash)
|
||||
}
|
||||
err = flow.OnNewBlock(block, blockInsertionResult)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flow.Domain().Consensus().ResolveVirtual()
|
||||
}
|
||||
|
||||
// dequeueIncomingMessageAndSkipInvs is a convenience method to be used during
|
||||
// IBD. Inv messages are expected to arrive at any given moment, but should be
|
||||
// ignored while we're in IBD
|
||||
|
@ -16,7 +16,7 @@ func (flow *handleRelayInvsFlow) ibdWithHeadersProof(highHash *externalapi.Domai
|
||||
return err
|
||||
}
|
||||
|
||||
err = flow.downloadBlocksAndPruningUTXOSet(flow.Domain().StagingConsensus(), highHash)
|
||||
err = flow.downloadHeadersAndPruningUTXOSet(flow.Domain().StagingConsensus(), highHash)
|
||||
if err != nil {
|
||||
if !flow.IsRecoverableError(err) {
|
||||
return err
|
||||
@ -93,7 +93,7 @@ func (flow *handleRelayInvsFlow) downloadHeadersProof() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (flow *handleRelayInvsFlow) downloadBlocksAndPruningUTXOSet(consensus externalapi.Consensus, highHash *externalapi.DomainHash) error {
|
||||
func (flow *handleRelayInvsFlow) downloadHeadersAndPruningUTXOSet(consensus externalapi.Consensus, highHash *externalapi.DomainHash) error {
|
||||
err := flow.downloadHeadersProof()
|
||||
if err != nil {
|
||||
return err
|
||||
@ -104,7 +104,13 @@ func (flow *handleRelayInvsFlow) downloadBlocksAndPruningUTXOSet(consensus exter
|
||||
return err
|
||||
}
|
||||
|
||||
err = flow.syncPruningPointFuture(consensus, pruningPoint, highHash, false)
|
||||
// TODO: Remove this condition once there's more proper way to check finality violation
|
||||
// in the headers proof.
|
||||
if pruningPoint.Equal(flow.Config().NetParams().GenesisHash) {
|
||||
return protocolerrors.Errorf(true, "the genesis pruning point violates finality")
|
||||
}
|
||||
|
||||
err = flow.syncPruningPointFutureHeaders(consensus, pruningPoint, highHash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1,784 +0,0 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/app/protocol/flows/blockrelay"
|
||||
peerpkg "github.com/kaspanet/kaspad/app/protocol/peer"
|
||||
"github.com/kaspanet/kaspad/domain"
|
||||
"github.com/kaspanet/kaspad/domain/consensus"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/ruleerrors"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/blockheader"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/constants"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/utils/testutils"
|
||||
"github.com/kaspanet/kaspad/domain/dagconfig"
|
||||
"github.com/kaspanet/kaspad/domain/miningmanager"
|
||||
"github.com/kaspanet/kaspad/infrastructure/config"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
"github.com/kaspanet/kaspad/util/mstime"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var headerOnlyBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{1})},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
}
|
||||
|
||||
var orphanBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{unknownBlockHash},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
Transactions: []*externalapi.DomainTransaction{{}},
|
||||
}
|
||||
|
||||
var validPruningPointBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{1})},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
Transactions: []*externalapi.DomainTransaction{{}},
|
||||
}
|
||||
|
||||
var invalidPruningPointBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{2})},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
Transactions: []*externalapi.DomainTransaction{{}},
|
||||
}
|
||||
|
||||
var unexpectedIBDBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{3})},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
Transactions: []*externalapi.DomainTransaction{{}},
|
||||
}
|
||||
|
||||
var invalidBlock = &externalapi.DomainBlock{
|
||||
Header: blockheader.NewImmutableBlockHeader(
|
||||
constants.MaxBlockVersion,
|
||||
[]*externalapi.DomainHash{externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{4})},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
&externalapi.DomainHash{},
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
),
|
||||
Transactions: []*externalapi.DomainTransaction{{}},
|
||||
}
|
||||
|
||||
var unknownBlockHash = externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{1})
|
||||
var knownInvalidBlockHash = externalapi.NewDomainHashFromByteArray(&[externalapi.DomainHashSize]byte{2})
|
||||
var validPruningPointHash = consensushashing.BlockHash(validPruningPointBlock)
|
||||
var invalidBlockHash = consensushashing.BlockHash(invalidBlock)
|
||||
var invalidPruningPointHash = consensushashing.BlockHash(invalidPruningPointBlock)
|
||||
var orphanBlockHash = consensushashing.BlockHash(orphanBlock)
|
||||
var headerOnlyBlockHash = consensushashing.BlockHash(headerOnlyBlock)
|
||||
|
||||
type fakeRelayInvsContext struct {
|
||||
testName string
|
||||
params *dagconfig.Params
|
||||
askedOrphanBlockInfo bool
|
||||
finishedIBD chan struct{}
|
||||
|
||||
trySetIBDRunningResponse bool
|
||||
isValidPruningPointResponse bool
|
||||
validateAndInsertImportedPruningPointResponse error
|
||||
getBlockInfoResponse *externalapi.BlockInfo
|
||||
validateAndInsertBlockResponse error
|
||||
virtualBlueScore uint64
|
||||
rwLock sync.RWMutex
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) PopulateMass(*externalapi.DomainTransaction) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) IsRecoverableError(err error) bool {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Init(skipAddingGenesis bool) error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) ValidateAndInsertBlockWithTrustedData(block *externalapi.BlockWithTrustedData, validateUTXO bool) (*externalapi.BlockInsertionResult, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) PruningPointAndItsAnticoneWithTrustedData() ([]*externalapi.BlockWithTrustedData, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) DeleteStagingConsensus() error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) StagingConsensus() externalapi.Consensus {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) InitStagingConsensus() error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) CommitStagingConsensus() error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) EstimateNetworkHashesPerSecond(startHash *externalapi.DomainHash, windowSize int) (uint64, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlockEvenIfHeaderOnly(blockHash *externalapi.DomainHash) (*externalapi.DomainBlock, error) {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlockRelations(blockHash *externalapi.DomainHash) ([]*externalapi.DomainHash, *externalapi.DomainHash, []*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) OnPruningPointUTXOSetOverride() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetVirtualUTXOs(expectedVirtualParents []*externalapi.DomainHash, fromOutpoint *externalapi.DomainOutpoint, limit int) ([]*externalapi.OutpointAndUTXOEntryPair, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Anticone(blockHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) BuildBlock(coinbaseData *externalapi.DomainCoinbaseData, transactions []*externalapi.DomainTransaction) (*externalapi.DomainBlock, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) ValidateAndInsertBlock(*externalapi.DomainBlock, bool) (*externalapi.BlockInsertionResult, error) {
|
||||
return nil, f.validateAndInsertBlockResponse
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) ValidateTransactionAndPopulateWithConsensusData(transaction *externalapi.DomainTransaction) error {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlock(blockHash *externalapi.DomainHash) (*externalapi.DomainBlock, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlockHeader(blockHash *externalapi.DomainHash) (externalapi.BlockHeader, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlockInfo(blockHash *externalapi.DomainHash) (*externalapi.BlockInfo, error) {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
if f.getBlockInfoResponse != nil {
|
||||
return f.getBlockInfoResponse, nil
|
||||
}
|
||||
|
||||
return &externalapi.BlockInfo{
|
||||
Exists: false,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetBlockAcceptanceData(blockHash *externalapi.DomainHash) (externalapi.AcceptanceData, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetHashesBetween(lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetMissingBlockBodyHashes(highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
// This is done so we can test getting invalid block during IBD.
|
||||
return []*externalapi.DomainHash{invalidBlockHash}, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetPruningPointUTXOs(expectedPruningPointHash *externalapi.DomainHash, fromOutpoint *externalapi.DomainOutpoint, limit int) ([]*externalapi.OutpointAndUTXOEntryPair, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) PruningPoint() (*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) ClearImportedPruningPointData() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) AppendImportedPruningPointUTXOs(outpointAndUTXOEntryPairs []*externalapi.OutpointAndUTXOEntryPair) error {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) ValidateAndInsertImportedPruningPoint(newPruningPoint *externalapi.DomainHash) error {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return f.validateAndInsertImportedPruningPointResponse
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetVirtualSelectedParent() (*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) CreateBlockLocatorFromPruningPoint(highHash *externalapi.DomainHash, limit uint32) (externalapi.BlockLocator, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) CreateHeadersSelectedChainBlockLocator(lowHash, highHash *externalapi.DomainHash) (externalapi.BlockLocator, error) {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return externalapi.BlockLocator{
|
||||
f.params.GenesisHash,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) CreateFullHeadersSelectedChainBlockLocator() (externalapi.BlockLocator, error) {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return externalapi.BlockLocator{
|
||||
f.params.GenesisHash,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetSyncInfo() (*externalapi.SyncInfo, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Tips() ([]*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetVirtualBlueScore(blueSCore uint64) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.virtualBlueScore = blueSCore
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetVirtualInfo() (*externalapi.VirtualInfo, error) {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return &externalapi.VirtualInfo{
|
||||
ParentHashes: nil,
|
||||
Bits: 0,
|
||||
PastMedianTime: 0,
|
||||
BlueScore: f.virtualBlueScore,
|
||||
DAAScore: 0,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetVirtualDAAScore() (uint64, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) IsValidPruningPoint(blockHash *externalapi.DomainHash) (bool, error) {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return f.isValidPruningPointResponse, nil
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetVirtualSelectedParentChainFromBlock(blockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) IsInSelectedParentChainOf(blockHashA *externalapi.DomainHash, blockHashB *externalapi.DomainHash) (bool, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetHeadersSelectedTip() (*externalapi.DomainHash, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) MiningManager() miningmanager.MiningManager {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Consensus() externalapi.Consensus {
|
||||
return f
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Domain() domain.Domain {
|
||||
return f
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Config() *config.Config {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return &config.Config{
|
||||
Flags: &config.Flags{
|
||||
NetworkFlags: config.NetworkFlags{
|
||||
ActiveNetParams: f.params,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) OnNewBlock(block *externalapi.DomainBlock, blockInsertionResult *externalapi.BlockInsertionResult) error {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SharedRequestedBlocks() *blockrelay.SharedRequestedBlocks {
|
||||
return blockrelay.NewSharedRequestedBlocks()
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) Broadcast(message appmessage.Message) error {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) AddOrphan(orphanBlock *externalapi.DomainBlock) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetOrphanRoots(orphanHash *externalapi.DomainHash) ([]*externalapi.DomainHash, bool, error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) IsOrphan(blockHash *externalapi.DomainHash) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) IsIBDRunning() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) TrySetIBDRunning(ibdPeer *peerpkg.Peer) bool {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return f.trySetIBDRunningResponse
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) UnsetIBDRunning() {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
close(f.finishedIBD)
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetValidateAndInsertBlockResponse(err error) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.validateAndInsertBlockResponse = err
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetValidateAndInsertImportedPruningPointResponse(err error) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.validateAndInsertImportedPruningPointResponse = err
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetGetBlockInfoResponse(info externalapi.BlockInfo) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.getBlockInfoResponse = &info
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetTrySetIBDRunningResponse(b bool) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.trySetIBDRunningResponse = b
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) SetIsValidPruningPointResponse(b bool) {
|
||||
f.rwLock.Lock()
|
||||
defer f.rwLock.Unlock()
|
||||
f.isValidPruningPointResponse = b
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetGenesisHeader() externalapi.BlockHeader {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return f.params.GenesisBlock.Header
|
||||
}
|
||||
|
||||
func (f *fakeRelayInvsContext) GetFinishedIBDChan() chan struct{} {
|
||||
f.rwLock.RLock()
|
||||
defer f.rwLock.RUnlock()
|
||||
return f.finishedIBD
|
||||
}
|
||||
|
||||
func TestHandleRelayInvs(t *testing.T) {
|
||||
triggerIBD := func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(consensushashing.BlockHash(orphanBlock)))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestRelayBlocks)
|
||||
|
||||
context.SetValidateAndInsertBlockResponse(ruleerrors.NewErrMissingParents(orphanBlock.Header.ParentHashes()))
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.DomainBlockToMsgBlock(orphanBlock))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err = outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestBlockLocator)
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgBlockLocator(nil))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
checkNoActivity := func(t *testing.T, outgoingRoute *router.Route) {
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(5 * time.Second)
|
||||
if !errors.Is(err, router.ErrTimeout) {
|
||||
t.Fatalf("Expected to time out, but got message %s and error %+v", msg.Command(), err)
|
||||
}
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
funcToExecute func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext)
|
||||
expectsProtocolError bool
|
||||
expectsBan bool
|
||||
expectsIBDToFinish bool
|
||||
expectsErrToContain string
|
||||
}{
|
||||
{
|
||||
name: "sending unexpected message type",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgBlockLocator(nil))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: "message in the block relay handleRelayInvsFlow while expecting an inv message",
|
||||
},
|
||||
{
|
||||
name: "sending a known invalid inv",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
|
||||
context.SetGetBlockInfoResponse(externalapi.BlockInfo{
|
||||
Exists: true,
|
||||
BlockStatus: externalapi.StatusInvalid,
|
||||
})
|
||||
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(knownInvalidBlockHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: "sent inv of an invalid block",
|
||||
},
|
||||
{
|
||||
name: "sending unrequested block",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(unknownBlockHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestRelayBlocks)
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgBlock(&appmessage.MsgBlockHeader{
|
||||
Version: 0,
|
||||
ParentHashes: nil,
|
||||
HashMerkleRoot: &externalapi.DomainHash{},
|
||||
AcceptedIDMerkleRoot: &externalapi.DomainHash{},
|
||||
UTXOCommitment: &externalapi.DomainHash{},
|
||||
Timestamp: mstime.Time{},
|
||||
Bits: 0,
|
||||
Nonce: 0,
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: "got unrequested block",
|
||||
},
|
||||
{
|
||||
name: "sending header only block on relay",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(headerOnlyBlockHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestRelayBlocks)
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.DomainBlockToMsgBlock(headerOnlyBlock))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: "block where expected block with body",
|
||||
},
|
||||
{
|
||||
name: "sending invalid block",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(invalidBlockHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestRelayBlocks)
|
||||
|
||||
context.SetValidateAndInsertBlockResponse(ruleerrors.ErrBadMerkleRoot)
|
||||
err = incomingRoute.Enqueue(appmessage.DomainBlockToMsgBlock(invalidBlock))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: "got invalid block",
|
||||
},
|
||||
{
|
||||
name: "sending unexpected message instead of block locator",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
err := incomingRoute.Enqueue(appmessage.NewMsgInvBlock(consensushashing.BlockHash(orphanBlock)))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestRelayBlocks)
|
||||
|
||||
context.SetValidateAndInsertBlockResponse(ruleerrors.NewErrMissingParents(orphanBlock.Header.ParentHashes()))
|
||||
err = incomingRoute.Enqueue(appmessage.DomainBlockToMsgBlock(orphanBlock))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err = outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestBlockLocator)
|
||||
|
||||
// Sending a block while expected a block locator
|
||||
err = incomingRoute.Enqueue(appmessage.DomainBlockToMsgBlock(orphanBlock))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsErrToContain: fmt.Sprintf("received unexpected message type. expected: %s",
|
||||
appmessage.CmdBlockLocator),
|
||||
},
|
||||
{
|
||||
name: "starting IBD when peer is already in IBD",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
context.SetTrySetIBDRunningResponse(false)
|
||||
triggerIBD(t, incomingRoute, outgoingRoute, context)
|
||||
|
||||
checkNoActivity(t, outgoingRoute)
|
||||
},
|
||||
expectsIBDToFinish: false,
|
||||
},
|
||||
{
|
||||
name: "sending unknown highest hash",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
triggerIBD(t, incomingRoute, outgoingRoute, context)
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgIBDBlockLocator)
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgIBDBlockLocatorHighestHash(unknownBlockHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsIBDToFinish: true,
|
||||
expectsErrToContain: "is not in the original blockLocator",
|
||||
},
|
||||
{
|
||||
name: "sending unexpected type instead of highest hash",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
triggerIBD(t, incomingRoute, outgoingRoute, context)
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgIBDBlockLocator)
|
||||
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgBlockLocator(nil))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsIBDToFinish: true,
|
||||
expectsErrToContain: fmt.Sprintf("received unexpected message type. expected: %s",
|
||||
appmessage.CmdIBDBlockLocatorHighestHash),
|
||||
},
|
||||
{
|
||||
name: "sending unexpected type instead of a header",
|
||||
funcToExecute: func(t *testing.T, incomingRoute, outgoingRoute *router.Route, context *fakeRelayInvsContext) {
|
||||
triggerIBD(t, incomingRoute, outgoingRoute, context)
|
||||
|
||||
msg, err := outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
|
||||
highestHash := msg.(*appmessage.MsgIBDBlockLocator).BlockLocatorHashes[0]
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgIBDBlockLocatorHighestHash(highestHash))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
|
||||
msg, err = outgoingRoute.DequeueWithTimeout(time.Second)
|
||||
if err != nil {
|
||||
t.Fatalf("DequeueWithTimeout: %+v", err)
|
||||
}
|
||||
_ = msg.(*appmessage.MsgRequestIBDBlocks)
|
||||
|
||||
// Sending unrequested block locator
|
||||
err = incomingRoute.Enqueue(appmessage.NewMsgBlockLocator(nil))
|
||||
if err != nil {
|
||||
t.Fatalf("Enqueue: %+v", err)
|
||||
}
|
||||
},
|
||||
expectsProtocolError: true,
|
||||
expectsBan: true,
|
||||
expectsIBDToFinish: true,
|
||||
expectsErrToContain: fmt.Sprintf("received unexpected message type. expected: %s or %s",
|
||||
appmessage.CmdIBDBlocks, appmessage.CmdDoneIBDBlocks),
|
||||
},
|
||||
}
|
||||
|
||||
testutils.ForAllNets(t, true, func(t *testing.T, consensusConfig *consensus.Config) {
|
||||
for _, test := range tests {
|
||||
|
||||
// This is done to avoid race condition
|
||||
test := test
|
||||
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
incomingRoute := router.NewRoute("incoming")
|
||||
outgoingRoute := router.NewRoute("outgoing")
|
||||
peer := peerpkg.New(nil)
|
||||
errChan := make(chan error)
|
||||
context := &fakeRelayInvsContext{
|
||||
testName: test.name,
|
||||
params: &consensusConfig.Params,
|
||||
finishedIBD: make(chan struct{}),
|
||||
|
||||
trySetIBDRunningResponse: true,
|
||||
isValidPruningPointResponse: true,
|
||||
}
|
||||
go func() {
|
||||
errChan <- blockrelay.HandleRelayInvs(context, incomingRoute, outgoingRoute, peer)
|
||||
}()
|
||||
|
||||
test.funcToExecute(t, incomingRoute, outgoingRoute, context)
|
||||
|
||||
if test.expectsErrToContain != "" {
|
||||
select {
|
||||
case err := <-errChan:
|
||||
checkFlowError(t, err, test.expectsProtocolError, test.expectsBan, test.expectsErrToContain)
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("waiting for error timed out after %s", 10*time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
select {
|
||||
case <-context.GetFinishedIBDChan():
|
||||
if !test.expectsIBDToFinish {
|
||||
t.Fatalf("IBD unexpecetedly finished")
|
||||
}
|
||||
case <-time.After(10 * time.Second):
|
||||
if test.expectsIBDToFinish {
|
||||
t.Fatalf("IBD didn't finished after %d", time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
if test.expectsErrToContain == "" {
|
||||
// Close the route to stop the flow
|
||||
incomingRoute.Close()
|
||||
|
||||
select {
|
||||
case err := <-errChan:
|
||||
if !errors.Is(err, router.ErrRouteClosed) {
|
||||
t.Fatalf("unexpected error %+v", err)
|
||||
}
|
||||
case <-time.After(10 * time.Second):
|
||||
t.Fatalf("waiting for flow to finish timed out after %s", time.Second)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
@ -169,10 +169,10 @@ func (m *Manager) registerBlockRelayFlows(router *routerpkg.Router, isStopping *
|
||||
|
||||
m.registerFlow("HandleRelayInvs", router, []appmessage.MessageCommand{
|
||||
appmessage.CmdInvRelayBlock, appmessage.CmdBlock, appmessage.CmdBlockLocator, appmessage.CmdBlockBlueWork,
|
||||
appmessage.CmdDoneIBDBlocks, appmessage.CmdUnexpectedPruningPoint, appmessage.CmdPruningPointUTXOSetChunk,
|
||||
appmessage.CmdIBDBlocks, appmessage.CmdIBDBlockLocatorHighestHash, appmessage.CmdBlockWithTrustedData,
|
||||
appmessage.CmdDoneHeaders, appmessage.CmdUnexpectedPruningPoint, appmessage.CmdPruningPointUTXOSetChunk,
|
||||
appmessage.CmdBlockHeaders, appmessage.CmdIBDBlockLocatorHighestHash, appmessage.CmdBlockWithTrustedData,
|
||||
appmessage.CmdDoneBlocksWithTrustedData, appmessage.CmdIBDBlockLocatorHighestHashNotFound,
|
||||
appmessage.CmdDonePruningPointUTXOSetChunks,
|
||||
appmessage.CmdDonePruningPointUTXOSetChunks, appmessage.CmdIBDBlock,
|
||||
},
|
||||
isStopping, errChan, func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
||||
return blockrelay.HandleRelayInvs(m.context, incomingRoute,
|
||||
@ -193,10 +193,17 @@ func (m *Manager) registerBlockRelayFlows(router *routerpkg.Router, isStopping *
|
||||
},
|
||||
),
|
||||
|
||||
m.registerFlow("HandleRequestIBDBlocks", router,
|
||||
[]appmessage.MessageCommand{appmessage.CmdRequestIBDBlocks, appmessage.CmdRequestNextIBDBlocks}, isStopping, errChan,
|
||||
m.registerFlow("HandleRequestHeaders", router,
|
||||
[]appmessage.MessageCommand{appmessage.CmdRequestHeaders, appmessage.CmdRequestNextHeaders}, isStopping, errChan,
|
||||
func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
||||
return blockrelay.HandleRequestIBDBlocks(m.context, incomingRoute, outgoingRoute, peer)
|
||||
return blockrelay.HandleRequestHeaders(m.context, incomingRoute, outgoingRoute, peer)
|
||||
},
|
||||
),
|
||||
|
||||
m.registerFlow("HandleIBDBlockRequests", router,
|
||||
[]appmessage.MessageCommand{appmessage.CmdRequestIBDBlocks}, isStopping, errChan,
|
||||
func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
||||
return blockrelay.HandleIBDBlockRequests(m.context, incomingRoute, outgoingRoute)
|
||||
},
|
||||
),
|
||||
|
||||
|
@ -334,6 +334,20 @@ func (s *consensus) GetHashesBetween(lowHash, highHash *externalapi.DomainHash,
|
||||
return s.syncManager.GetHashesBetween(stagingArea, lowHash, highHash, maxBlocks)
|
||||
}
|
||||
|
||||
func (s *consensus) GetMissingBlockBodyHashes(highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
|
||||
stagingArea := model.NewStagingArea()
|
||||
|
||||
err := s.validateBlockHashExists(stagingArea, highHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return s.syncManager.GetMissingBlockBodyHashes(stagingArea, highHash)
|
||||
}
|
||||
|
||||
func (s *consensus) GetPruningPointUTXOs(expectedPruningPointHash *externalapi.DomainHash,
|
||||
fromOutpoint *externalapi.DomainOutpoint, limit int) ([]*externalapi.OutpointAndUTXOEntryPair, error) {
|
||||
|
||||
@ -630,3 +644,25 @@ func (s *consensus) EstimateNetworkHashesPerSecond(startHash *externalapi.Domain
|
||||
func (s *consensus) PopulateMass(transaction *externalapi.DomainTransaction) {
|
||||
s.transactionValidator.PopulateMass(transaction)
|
||||
}
|
||||
|
||||
func (s *consensus) ResolveVirtual() error {
|
||||
// In order to prevent a situation that the consensus lock is held for too much time, we
|
||||
// release the lock each time resolve 100 blocks.
|
||||
for {
|
||||
var isCompletelyResolved bool
|
||||
var err error
|
||||
func() {
|
||||
s.lock.Lock()
|
||||
defer s.lock.Unlock()
|
||||
|
||||
isCompletelyResolved, err = s.consensusStateManager.ResolveVirtual(100)
|
||||
}()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if isCompletelyResolved {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ func (f *factory) NewConsensus(config *Config, db infrastructuredatabase.Databas
|
||||
pruningWindowSizePlusFinalityDepthForCache := int(config.PruningDepth() + config.FinalityDepth())
|
||||
|
||||
// Data Structures
|
||||
daaWindowStore := daawindowstore.New(dbPrefix, 200, preallocateCaches)
|
||||
daaWindowStore := daawindowstore.New(dbPrefix, 10_000, preallocateCaches)
|
||||
acceptanceDataStore := acceptancedatastore.New(dbPrefix, 200, preallocateCaches)
|
||||
blockStore, err := blockstore.New(dbManager, dbPrefix, 200, preallocateCaches)
|
||||
if err != nil {
|
||||
|
@ -16,6 +16,7 @@ type Consensus interface {
|
||||
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
||||
|
||||
GetHashesBetween(lowHash, highHash *DomainHash, maxBlocks uint64) (hashes []*DomainHash, actualHighHash *DomainHash, err error)
|
||||
GetMissingBlockBodyHashes(highHash *DomainHash) ([]*DomainHash, error)
|
||||
GetPruningPointUTXOs(expectedPruningPointHash *DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||
GetVirtualUTXOs(expectedVirtualParents []*DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||
PruningPoint() (*DomainHash, error)
|
||||
@ -38,4 +39,5 @@ type Consensus interface {
|
||||
Anticone(blockHash *DomainHash) ([]*DomainHash, error)
|
||||
EstimateNetworkHashesPerSecond(startHash *DomainHash, windowSize int) (uint64, error)
|
||||
PopulateMass(transaction *DomainTransaction)
|
||||
ResolveVirtual() error
|
||||
}
|
||||
|
@ -12,4 +12,5 @@ type ConsensusStateManager interface {
|
||||
GetVirtualSelectedParentChainFromBlock(stagingArea *StagingArea, blockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error)
|
||||
RecoverUTXOIfRequired() error
|
||||
ReverseUTXODiffs(tipHash *externalapi.DomainHash, reversalData *UTXODiffReversalData) error
|
||||
ResolveVirtual(maxBlocksToResolve uint64) (bool, error)
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
type SyncManager interface {
|
||||
GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (
|
||||
hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error)
|
||||
GetMissingBlockBodyHashes(stagingArea *StagingArea, highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error)
|
||||
CreateBlockLocator(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, limit uint32) (
|
||||
externalapi.BlockLocator, error)
|
||||
CreateHeadersSelectedChainBlockLocator(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash) (
|
||||
|
@ -60,12 +60,12 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
||||
t.Fatalf("PruningPoint: %+v", err)
|
||||
}
|
||||
|
||||
missingBlocksHashes, _, err := tcSyncer.GetHashesBetween(pruningPoint, syncerVirtualSelectedParent, math.MaxUint64)
|
||||
missingHeaderHashes, _, err := tcSyncer.GetHashesBetween(pruningPoint, syncerVirtualSelectedParent, math.MaxUint64)
|
||||
if err != nil {
|
||||
t.Fatalf("GetHashesBetween: %+v", err)
|
||||
}
|
||||
|
||||
for _, blocksHash := range missingBlocksHashes {
|
||||
for _, blocksHash := range missingHeaderHashes {
|
||||
blockInfo, err := tcSyncee.GetBlockInfo(blocksHash)
|
||||
if err != nil {
|
||||
t.Fatalf("GetBlockInfo: %+v", err)
|
||||
@ -75,12 +75,12 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
||||
continue
|
||||
}
|
||||
|
||||
block, err := tcSyncer.GetBlock(blocksHash)
|
||||
header, err := tcSyncer.GetBlockHeader(blocksHash)
|
||||
if err != nil {
|
||||
t.Fatalf("GetBlock: %+v", err)
|
||||
t.Fatalf("GetBlockHeader: %+v", err)
|
||||
}
|
||||
|
||||
_, err = tcSyncee.ValidateAndInsertBlock(block, false)
|
||||
_, err = tcSyncee.ValidateAndInsertBlock(&externalapi.DomainBlock{Header: header}, false)
|
||||
if err != nil {
|
||||
t.Fatalf("ValidateAndInsertBlock: %+v", err)
|
||||
}
|
||||
@ -136,6 +136,42 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
||||
t.Fatalf("ValidateAndInsertImportedPruningPoint: %+v", err)
|
||||
}
|
||||
|
||||
emptyCoinbase := &externalapi.DomainCoinbaseData{
|
||||
ScriptPublicKey: &externalapi.ScriptPublicKey{
|
||||
Script: nil,
|
||||
Version: 0,
|
||||
},
|
||||
}
|
||||
|
||||
// Check that we can build a block just after importing the pruning point.
|
||||
_, err = tcSyncee.BuildBlock(emptyCoinbase, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("BuildBlock: %+v", err)
|
||||
}
|
||||
|
||||
// Sync block bodies
|
||||
headersSelectedTip, err := tcSyncee.GetHeadersSelectedTip()
|
||||
if err != nil {
|
||||
t.Fatalf("GetHeadersSelectedTip: %+v", err)
|
||||
}
|
||||
|
||||
missingBlockHashes, err := tcSyncee.GetMissingBlockBodyHashes(headersSelectedTip)
|
||||
if err != nil {
|
||||
t.Fatalf("GetMissingBlockBodyHashes: %+v", err)
|
||||
}
|
||||
|
||||
for _, blocksHash := range missingBlockHashes {
|
||||
block, err := tcSyncer.GetBlock(blocksHash)
|
||||
if err != nil {
|
||||
t.Fatalf("GetBlock: %+v", err)
|
||||
}
|
||||
|
||||
_, err = tcSyncee.ValidateAndInsertBlock(block, true)
|
||||
if err != nil {
|
||||
t.Fatalf("ValidateAndInsertBlock: %+v", err)
|
||||
}
|
||||
}
|
||||
|
||||
synceeTips, err := tcSyncee.Tips()
|
||||
if err != nil {
|
||||
t.Fatalf("Tips: %+v", err)
|
||||
|
@ -124,42 +124,8 @@ func (csm *consensusStateManager) importPruningPoint(
|
||||
return err
|
||||
}
|
||||
|
||||
err = csm.setPruningPointSelectedChildAsTheOnlyParentOfTheVirtual(stagingArea)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (csm *consensusStateManager) setPruningPointSelectedChildAsTheOnlyParentOfTheVirtual(stagingArea *model.StagingArea) error {
|
||||
headersSelectedTip, err := csm.headersSelectedTipStore.HeadersSelectedTip(csm.databaseContext, stagingArea)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pruningPoint, err := csm.pruningStore.PruningPoint(csm.databaseContext, stagingArea)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pruningPointSelectedChild, err := csm.dagTraversalManager.SelectedChild(stagingArea,
|
||||
headersSelectedTip, pruningPoint)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
blockStatus, _, err := csm.resolveBlockStatus(stagingArea, pruningPointSelectedChild, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if blockStatus == externalapi.StatusDisqualifiedFromChain {
|
||||
return errors.Wrapf(ruleerrors.ErrPruningPointSelectedChildDisqualifiedFromChain, "pruning point selected"+
|
||||
" child is disqualified from chain")
|
||||
}
|
||||
|
||||
_, _, err = csm.updateVirtual(stagingArea, pruningPointSelectedChild, []*externalapi.DomainHash{pruningPointSelectedChild})
|
||||
// Run update virtual to create acceptance data and any other missing data.
|
||||
_, _, err = csm.updateVirtual(stagingArea, newPruningPoint, []*externalapi.DomainHash{newPruningPoint})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
93
domain/consensus/processes/consensusstatemanager/resolve.go
Normal file
93
domain/consensus/processes/consensusstatemanager/resolve.go
Normal file
@ -0,0 +1,93 @@
|
||||
package consensusstatemanager
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model"
|
||||
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
"github.com/kaspanet/kaspad/infrastructure/logger"
|
||||
"github.com/kaspanet/kaspad/util/staging"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func (csm *consensusStateManager) ResolveVirtual(maxBlocksToResolve uint64) (bool, error) {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "csm.ResolveVirtual")
|
||||
defer onEnd()
|
||||
|
||||
readStagingArea := model.NewStagingArea()
|
||||
tips, err := csm.consensusStateStore.Tips(readStagingArea, csm.databaseContext)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
var sortErr error
|
||||
sort.Slice(tips, func(i, j int) bool {
|
||||
selectedParent, err := csm.ghostdagManager.ChooseSelectedParent(readStagingArea, tips[i], tips[j])
|
||||
if err != nil {
|
||||
sortErr = err
|
||||
return false
|
||||
}
|
||||
|
||||
return selectedParent.Equal(tips[i])
|
||||
})
|
||||
if sortErr != nil {
|
||||
return false, sortErr
|
||||
}
|
||||
|
||||
var selectedTip *externalapi.DomainHash
|
||||
isCompletelyResolved := true
|
||||
for _, tip := range tips {
|
||||
log.Infof("Resolving tip %s", tip)
|
||||
resolveStagingArea := model.NewStagingArea()
|
||||
unverifiedBlocks, err := csm.getUnverifiedChainBlocks(resolveStagingArea, tip)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
resolveTip := tip
|
||||
hasMoreUnverifiedThanMax := maxBlocksToResolve != 0 && uint64(len(unverifiedBlocks)) > maxBlocksToResolve
|
||||
if hasMoreUnverifiedThanMax {
|
||||
resolveTip = unverifiedBlocks[uint64(len(unverifiedBlocks))-maxBlocksToResolve]
|
||||
log.Infof("Has more than %d blocks to resolve. Changing the resolve tip to %s", maxBlocksToResolve, resolveTip)
|
||||
}
|
||||
|
||||
blockStatus, reversalData, err := csm.resolveBlockStatus(resolveStagingArea, resolveTip, true)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if blockStatus == externalapi.StatusUTXOValid {
|
||||
selectedTip = resolveTip
|
||||
isCompletelyResolved = !hasMoreUnverifiedThanMax
|
||||
|
||||
err = staging.CommitAllChanges(csm.databaseContext, resolveStagingArea)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if reversalData != nil {
|
||||
err = csm.ReverseUTXODiffs(resolveTip, reversalData)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if selectedTip == nil {
|
||||
log.Warnf("Non of the DAG tips are valid")
|
||||
return false, nil
|
||||
}
|
||||
|
||||
updateVirtualStagingArea := model.NewStagingArea()
|
||||
_, err = csm.updateVirtualWithParents(updateVirtualStagingArea, []*externalapi.DomainHash{selectedTip})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
err = staging.CommitAllChanges(csm.databaseContext, updateVirtualStagingArea)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return isCompletelyResolved, nil
|
||||
}
|
@ -45,6 +45,7 @@ func (csm *consensusStateManager) ReverseUTXODiffs(tipHash *externalapi.DomainHa
|
||||
// Now go over the rest of the blocks and assign for every block Bi.UTXODiff = Bi+1.UTXODiff.Reversed()
|
||||
for i := 1; ; i++ {
|
||||
currentBlock := previousBlockGHOSTDAGData.SelectedParent()
|
||||
log.Debugf("Reversing UTXO diff for %s", currentBlock)
|
||||
|
||||
currentBlockUTXODiffChild, err := csm.utxoDiffStore.UTXODiffChild(csm.databaseContext, readStagingArea, currentBlock)
|
||||
if err != nil {
|
||||
|
@ -31,45 +31,7 @@ func (csm *consensusStateManager) updateVirtual(stagingArea *model.StagingArea,
|
||||
}
|
||||
log.Debugf("Picked virtual parents: %s", virtualParents)
|
||||
|
||||
err = csm.dagTopologyManager.SetParents(stagingArea, model.VirtualBlockHash, virtualParents)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
log.Debugf("Set new parents for the virtual block hash")
|
||||
|
||||
err = csm.ghostdagManager.GHOSTDAG(stagingArea, model.VirtualBlockHash)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
// This is needed for `csm.CalculatePastUTXOAndAcceptanceData`
|
||||
_, err = csm.difficultyManager.StageDAADataAndReturnRequiredDifficulty(stagingArea, model.VirtualBlockHash, false)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
log.Debugf("Calculating past UTXO, acceptance data, and multiset for the new virtual block")
|
||||
virtualUTXODiff, virtualAcceptanceData, virtualMultiset, err :=
|
||||
csm.CalculatePastUTXOAndAcceptanceData(stagingArea, model.VirtualBlockHash)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
log.Debugf("Calculated the past UTXO of the new virtual. "+
|
||||
"Diff toAdd length: %d, toRemove length: %d",
|
||||
virtualUTXODiff.ToAdd().Len(), virtualUTXODiff.ToRemove().Len())
|
||||
|
||||
log.Debugf("Staging new acceptance data for the virtual block")
|
||||
csm.acceptanceDataStore.Stage(stagingArea, model.VirtualBlockHash, virtualAcceptanceData)
|
||||
|
||||
log.Debugf("Staging new multiset for the virtual block")
|
||||
csm.multisetStore.Stage(stagingArea, model.VirtualBlockHash, virtualMultiset)
|
||||
|
||||
log.Debugf("Staging new UTXO diff for the virtual block")
|
||||
csm.consensusStateStore.StageVirtualUTXODiff(stagingArea, virtualUTXODiff)
|
||||
|
||||
log.Debugf("Updating the selected tip's utxo-diff after adding %s to the DAG", newBlockHash)
|
||||
err = csm.updateSelectedTipUTXODiff(stagingArea, virtualUTXODiff)
|
||||
virtualUTXODiff, err := csm.updateVirtualWithParents(stagingArea, virtualParents)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@ -94,6 +56,54 @@ func (csm *consensusStateManager) updateVirtual(stagingArea *model.StagingArea,
|
||||
return selectedParentChainChanges, virtualUTXODiff, nil
|
||||
}
|
||||
|
||||
func (csm *consensusStateManager) updateVirtualWithParents(
|
||||
stagingArea *model.StagingArea, virtualParents []*externalapi.DomainHash) (externalapi.UTXODiff, error) {
|
||||
err := csm.dagTopologyManager.SetParents(stagingArea, model.VirtualBlockHash, virtualParents)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Debugf("Set new parents for the virtual block hash")
|
||||
|
||||
err = csm.ghostdagManager.GHOSTDAG(stagingArea, model.VirtualBlockHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// This is needed for `csm.CalculatePastUTXOAndAcceptanceData`
|
||||
_, err = csm.difficultyManager.StageDAADataAndReturnRequiredDifficulty(stagingArea, model.VirtualBlockHash, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Debugf("Calculating past UTXO, acceptance data, and multiset for the new virtual block")
|
||||
virtualUTXODiff, virtualAcceptanceData, virtualMultiset, err :=
|
||||
csm.CalculatePastUTXOAndAcceptanceData(stagingArea, model.VirtualBlockHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Debugf("Calculated the past UTXO of the new virtual. "+
|
||||
"Diff toAdd length: %d, toRemove length: %d",
|
||||
virtualUTXODiff.ToAdd().Len(), virtualUTXODiff.ToRemove().Len())
|
||||
|
||||
log.Debugf("Staging new acceptance data for the virtual block")
|
||||
csm.acceptanceDataStore.Stage(stagingArea, model.VirtualBlockHash, virtualAcceptanceData)
|
||||
|
||||
log.Debugf("Staging new multiset for the virtual block")
|
||||
csm.multisetStore.Stage(stagingArea, model.VirtualBlockHash, virtualMultiset)
|
||||
|
||||
log.Debugf("Staging new UTXO diff for the virtual block")
|
||||
csm.consensusStateStore.StageVirtualUTXODiff(stagingArea, virtualUTXODiff)
|
||||
|
||||
log.Debugf("Updating the selected tip's utxo-diff")
|
||||
err = csm.updateSelectedTipUTXODiff(stagingArea, virtualUTXODiff)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return virtualUTXODiff, nil
|
||||
}
|
||||
|
||||
func (csm *consensusStateManager) updateSelectedTipUTXODiff(
|
||||
stagingArea *model.StagingArea, virtualUTXODiff externalapi.UTXODiff) error {
|
||||
|
||||
|
@ -113,6 +113,70 @@ func (sm *syncManager) findLowHashInHighHashSelectedParentChain(stagingArea *mod
|
||||
return lowHash, nil
|
||||
}
|
||||
|
||||
func (sm *syncManager) missingBlockBodyHashes(stagingArea *model.StagingArea, highHash *externalapi.DomainHash) (
|
||||
[]*externalapi.DomainHash, error) {
|
||||
|
||||
pruningPoint, err := sm.pruningStore.PruningPoint(sm.databaseContext, stagingArea)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
selectedChildIterator, err := sm.dagTraversalManager.SelectedChildIterator(stagingArea, highHash, pruningPoint)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer selectedChildIterator.Close()
|
||||
|
||||
lowHash := pruningPoint
|
||||
foundHeaderOnlyBlock := false
|
||||
for ok := selectedChildIterator.First(); ok; ok = selectedChildIterator.Next() {
|
||||
selectedChild, err := selectedChildIterator.Get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hasBlock, err := sm.blockStore.HasBlock(sm.databaseContext, stagingArea, selectedChild)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !hasBlock {
|
||||
foundHeaderOnlyBlock = true
|
||||
break
|
||||
}
|
||||
lowHash = selectedChild
|
||||
}
|
||||
if !foundHeaderOnlyBlock {
|
||||
if lowHash == highHash {
|
||||
// Blocks can be inserted inside the DAG during IBD if those were requested before IBD started.
|
||||
// In rare cases, all the IBD blocks might be already inserted by the time we reach this point.
|
||||
// In these cases - return an empty list of blocks to sync
|
||||
return []*externalapi.DomainHash{}, nil
|
||||
}
|
||||
// TODO: Once block children are fixed (https://github.com/kaspanet/kaspad/issues/1499),
|
||||
// this error should be returned rather the logged
|
||||
log.Errorf("no header-only blocks between %s and %s",
|
||||
lowHash, highHash)
|
||||
}
|
||||
|
||||
hashesBetween, _, err := sm.antiPastHashesBetween(stagingArea, lowHash, highHash, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
missingBlocks := make([]*externalapi.DomainHash, 0, len(hashesBetween))
|
||||
for _, blockHash := range hashesBetween {
|
||||
blockStatus, err := sm.blockStatusStore.Get(sm.databaseContext, stagingArea, blockHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if blockStatus == externalapi.StatusHeaderOnly {
|
||||
missingBlocks = append(missingBlocks, blockHash)
|
||||
}
|
||||
}
|
||||
|
||||
return missingBlocks, nil
|
||||
}
|
||||
|
||||
func (sm *syncManager) isHeaderOnlyBlock(stagingArea *model.StagingArea, blockHash *externalapi.DomainHash) (bool, error) {
|
||||
exists, err := sm.blockStatusStore.Exists(sm.databaseContext, stagingArea, blockHash)
|
||||
if err != nil {
|
||||
|
@ -69,6 +69,13 @@ func (sm *syncManager) GetHashesBetween(stagingArea *model.StagingArea, lowHash,
|
||||
return sm.antiPastHashesBetween(stagingArea, lowHash, highHash, maxBlocks)
|
||||
}
|
||||
|
||||
func (sm *syncManager) GetMissingBlockBodyHashes(stagingArea *model.StagingArea, highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "GetMissingBlockBodyHashes")
|
||||
defer onEnd()
|
||||
|
||||
return sm.missingBlockBodyHashes(stagingArea, highHash)
|
||||
}
|
||||
|
||||
func (sm *syncManager) CreateBlockLocator(stagingArea *model.StagingArea,
|
||||
lowHash, highHash *externalapi.DomainHash, limit uint32) (externalapi.BlockLocator, error) {
|
||||
|
||||
|
@ -38,6 +38,7 @@ type KaspadMessage struct {
|
||||
// *KaspadMessage_RequestAddresses
|
||||
// *KaspadMessage_RequestRelayBlocks
|
||||
// *KaspadMessage_RequestTransactions
|
||||
// *KaspadMessage_IbdBlock
|
||||
// *KaspadMessage_InvRelayBlock
|
||||
// *KaspadMessage_InvTransactions
|
||||
// *KaspadMessage_Ping
|
||||
@ -47,6 +48,7 @@ type KaspadMessage struct {
|
||||
// *KaspadMessage_TransactionNotFound
|
||||
// *KaspadMessage_Reject
|
||||
// *KaspadMessage_PruningPointUtxoSetChunk
|
||||
// *KaspadMessage_RequestIBDBlocks
|
||||
// *KaspadMessage_UnexpectedPruningPoint
|
||||
// *KaspadMessage_IbdBlockLocator
|
||||
// *KaspadMessage_IbdBlockLocatorHighestHash
|
||||
@ -58,11 +60,11 @@ type KaspadMessage struct {
|
||||
// *KaspadMessage_RequestBlockBlueWork
|
||||
// *KaspadMessage_BlockBlueWork
|
||||
// *KaspadMessage_RequestPruningPointAndItsAnticone
|
||||
// *KaspadMessage_IbdBlocks
|
||||
// *KaspadMessage_RequestNextIbdBlocks
|
||||
// *KaspadMessage_DoneIbdBlocks
|
||||
// *KaspadMessage_BlockHeaders
|
||||
// *KaspadMessage_RequestNextHeaders
|
||||
// *KaspadMessage_DoneHeaders
|
||||
// *KaspadMessage_RequestPruningPointUTXOSet
|
||||
// *KaspadMessage_RequestIbdBlocks
|
||||
// *KaspadMessage_RequestHeaders
|
||||
// *KaspadMessage_RequestBlockLocator
|
||||
// *KaspadMessage_GetCurrentNetworkRequest
|
||||
// *KaspadMessage_GetCurrentNetworkResponse
|
||||
@ -231,6 +233,13 @@ func (x *KaspadMessage) GetRequestTransactions() *RequestTransactionsMessage {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetIbdBlock() *BlockMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_IbdBlock); ok {
|
||||
return x.IbdBlock
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetInvRelayBlock() *InvRelayBlockMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_InvRelayBlock); ok {
|
||||
return x.InvRelayBlock
|
||||
@ -294,6 +303,13 @@ func (x *KaspadMessage) GetPruningPointUtxoSetChunk() *PruningPointUtxoSetChunkM
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetRequestIBDBlocks() *RequestIBDBlocksMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestIBDBlocks); ok {
|
||||
return x.RequestIBDBlocks
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetUnexpectedPruningPoint() *UnexpectedPruningPointMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_UnexpectedPruningPoint); ok {
|
||||
return x.UnexpectedPruningPoint
|
||||
@ -371,23 +387,23 @@ func (x *KaspadMessage) GetRequestPruningPointAndItsAnticone() *RequestPruningPo
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetIbdBlocks() *IbdBlocksMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_IbdBlocks); ok {
|
||||
return x.IbdBlocks
|
||||
func (x *KaspadMessage) GetBlockHeaders() *BlockHeadersMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_BlockHeaders); ok {
|
||||
return x.BlockHeaders
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetRequestNextIbdBlocks() *RequestNextIbdBlocksMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestNextIbdBlocks); ok {
|
||||
return x.RequestNextIbdBlocks
|
||||
func (x *KaspadMessage) GetRequestNextHeaders() *RequestNextHeadersMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestNextHeaders); ok {
|
||||
return x.RequestNextHeaders
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetDoneIbdBlocks() *DoneIbdBlocksMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_DoneIbdBlocks); ok {
|
||||
return x.DoneIbdBlocks
|
||||
func (x *KaspadMessage) GetDoneHeaders() *DoneHeadersMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_DoneHeaders); ok {
|
||||
return x.DoneHeaders
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -399,9 +415,9 @@ func (x *KaspadMessage) GetRequestPruningPointUTXOSet() *RequestPruningPointUTXO
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetRequestIbdBlocks() *RequestIbdBlocksMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestIbdBlocks); ok {
|
||||
return x.RequestIbdBlocks
|
||||
func (x *KaspadMessage) GetRequestHeaders() *RequestHeadersMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestHeaders); ok {
|
||||
return x.RequestHeaders
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -977,6 +993,10 @@ type KaspadMessage_RequestTransactions struct {
|
||||
RequestTransactions *RequestTransactionsMessage `protobuf:"bytes,12,opt,name=requestTransactions,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_IbdBlock struct {
|
||||
IbdBlock *BlockMessage `protobuf:"bytes,13,opt,name=ibdBlock,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_InvRelayBlock struct {
|
||||
InvRelayBlock *InvRelayBlockMessage `protobuf:"bytes,14,opt,name=invRelayBlock,proto3,oneof"`
|
||||
}
|
||||
@ -1013,6 +1033,10 @@ type KaspadMessage_PruningPointUtxoSetChunk struct {
|
||||
PruningPointUtxoSetChunk *PruningPointUtxoSetChunkMessage `protobuf:"bytes,25,opt,name=pruningPointUtxoSetChunk,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_RequestIBDBlocks struct {
|
||||
RequestIBDBlocks *RequestIBDBlocksMessage `protobuf:"bytes,26,opt,name=requestIBDBlocks,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_UnexpectedPruningPoint struct {
|
||||
UnexpectedPruningPoint *UnexpectedPruningPointMessage `protobuf:"bytes,27,opt,name=unexpectedPruningPoint,proto3,oneof"`
|
||||
}
|
||||
@ -1057,24 +1081,24 @@ type KaspadMessage_RequestPruningPointAndItsAnticone struct {
|
||||
RequestPruningPointAndItsAnticone *RequestPruningPointAndItsAnticoneMessage `protobuf:"bytes,40,opt,name=requestPruningPointAndItsAnticone,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_IbdBlocks struct {
|
||||
IbdBlocks *IbdBlocksMessage `protobuf:"bytes,41,opt,name=ibdBlocks,proto3,oneof"`
|
||||
type KaspadMessage_BlockHeaders struct {
|
||||
BlockHeaders *BlockHeadersMessage `protobuf:"bytes,41,opt,name=blockHeaders,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_RequestNextIbdBlocks struct {
|
||||
RequestNextIbdBlocks *RequestNextIbdBlocksMessage `protobuf:"bytes,42,opt,name=requestNextIbdBlocks,proto3,oneof"`
|
||||
type KaspadMessage_RequestNextHeaders struct {
|
||||
RequestNextHeaders *RequestNextHeadersMessage `protobuf:"bytes,42,opt,name=requestNextHeaders,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_DoneIbdBlocks struct {
|
||||
DoneIbdBlocks *DoneIbdBlocksMessage `protobuf:"bytes,43,opt,name=doneIbdBlocks,proto3,oneof"`
|
||||
type KaspadMessage_DoneHeaders struct {
|
||||
DoneHeaders *DoneHeadersMessage `protobuf:"bytes,43,opt,name=DoneHeaders,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_RequestPruningPointUTXOSet struct {
|
||||
RequestPruningPointUTXOSet *RequestPruningPointUTXOSetMessage `protobuf:"bytes,44,opt,name=requestPruningPointUTXOSet,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_RequestIbdBlocks struct {
|
||||
RequestIbdBlocks *RequestIbdBlocksMessage `protobuf:"bytes,45,opt,name=requestIbdBlocks,proto3,oneof"`
|
||||
type KaspadMessage_RequestHeaders struct {
|
||||
RequestHeaders *RequestHeadersMessage `protobuf:"bytes,45,opt,name=requestHeaders,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_RequestBlockLocator struct {
|
||||
@ -1399,6 +1423,8 @@ func (*KaspadMessage_RequestRelayBlocks) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestTransactions) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_IbdBlock) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_InvRelayBlock) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_InvTransactions) isKaspadMessage_Payload() {}
|
||||
@ -1417,6 +1443,8 @@ func (*KaspadMessage_Reject) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_PruningPointUtxoSetChunk) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestIBDBlocks) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_UnexpectedPruningPoint) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_IbdBlockLocator) isKaspadMessage_Payload() {}
|
||||
@ -1439,15 +1467,15 @@ func (*KaspadMessage_BlockBlueWork) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestPruningPointAndItsAnticone) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_IbdBlocks) isKaspadMessage_Payload() {}
|
||||
func (*KaspadMessage_BlockHeaders) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestNextIbdBlocks) isKaspadMessage_Payload() {}
|
||||
func (*KaspadMessage_RequestNextHeaders) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_DoneIbdBlocks) isKaspadMessage_Payload() {}
|
||||
func (*KaspadMessage_DoneHeaders) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestPruningPointUTXOSet) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestIbdBlocks) isKaspadMessage_Payload() {}
|
||||
func (*KaspadMessage_RequestHeaders) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_RequestBlockLocator) isKaspadMessage_Payload() {}
|
||||
|
||||
@ -1609,7 +1637,7 @@ var file_messages_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x1a, 0x09, 0x70, 0x32, 0x70,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0x9a, 0x5c, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x6f, 0x22, 0x9a, 0x5d, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
@ -1642,145 +1670,153 @@ var file_messages_proto_rawDesc = []byte{
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
|
||||
0x47, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65,
|
||||
0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x54,
|
||||
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e,
|
||||
0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73,
|
||||
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18,
|
||||
0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||
0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52,
|
||||
0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x11, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||
0x50, 0x6f, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70,
|
||||
0x6f, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x13, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||
0x56, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52,
|
||||
0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x35, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
||||
0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x59,
|
||||
0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74,
|
||||
0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a,
|
||||
0x65, 0x63, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x68, 0x0a,
|
||||
0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78,
|
||||
0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x75, 0x6e,
|
||||
0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43,
|
||||
0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x18, 0x70,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53,
|
||||
0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x62, 0x0a, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70,
|
||||
0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e,
|
||||
0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||
0x69, 0x72, 0x65, 0x2e, 0x55, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72,
|
||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0f, 0x69,
|
||||
0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1e,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
|
||||
0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x6e, 0x0a, 0x1a, 0x69, 0x62,
|
||||
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67,
|
||||
0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73,
|
||||
0x74, 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a,
|
||||
0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48,
|
||||
0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x89, 0x01, 0x0a, 0x23, 0x72,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75,
|
||||
0x6e, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74,
|
||||
0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f,
|
||||
0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||
0x00, 0x52, 0x23, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72,
|
||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65,
|
||||
0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x77, 0x0a, 0x1d, 0x64, 0x6f, 0x6e, 0x65, 0x50, 0x72,
|
||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65,
|
||||
0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x50, 0x72,
|
||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65,
|
||||
0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
||||
0x52, 0x1d, 0x64, 0x6f, 0x6e, 0x65, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12,
|
||||
0x86, 0x01, 0x0a, 0x22, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x6f,
|
||||
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x35, 0x0a, 0x08, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x69, 0x62,
|
||||
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65, 0x6c,
|
||||
0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x52, 0x65, 0x6c,
|
||||
0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
||||
0x52, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12,
|
||||
0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69,
|
||||
0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c,
|
||||
0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x04,
|
||||
0x70, 0x6f, 0x6e, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x65,
|
||||
0x72, 0x61, 0x63, 0x6b, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x35,
|
||||
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x76, 0x65,
|
||||
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x15, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54,
|
||||
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75,
|
||||
0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x13, 0x74, 0x72, 0x61,
|
||||
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64,
|
||||
0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6a,
|
||||
0x65, 0x63, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65,
|
||||
0x6a, 0x65, 0x63, 0x74, 0x12, 0x68, 0x0a, 0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50,
|
||||
0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b,
|
||||
0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55,
|
||||
0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x50,
|
||||
0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x10,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
||||
0x12, 0x62, 0x0a, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72,
|
||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x55, 0x6e, 0x65,
|
||||
0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e,
|
||||
0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50,
|
||||
0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x48, 0x00, 0x52, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x12, 0x6e, 0x0a, 0x1a, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c,
|
||||
0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73,
|
||||
0x68, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||
0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||
0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48,
|
||||
0x61, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x22, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f,
|
||||
0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68,
|
||||
0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x5c, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63,
|
||||
0x61, 0x73, 0x68, 0x12, 0x89, 0x01, 0x0a, 0x23, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e,
|
||||
0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55,
|
||||
0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67,
|
||||
0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e,
|
||||
0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x23, 0x72, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12,
|
||||
0x77, 0x0a, 0x1d, 0x64, 0x6f, 0x6e, 0x65, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73,
|
||||
0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1d, 0x64, 0x6f, 0x6e, 0x65, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53,
|
||||
0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x73, 0x12, 0x86, 0x01, 0x0a, 0x22, 0x69, 0x62, 0x64,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68,
|
||||
0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18,
|
||||
0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
||||
0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f,
|
||||
0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x46,
|
||||
0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x22, 0x69,
|
||||
0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69,
|
||||
0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
|
||||
0x64, 0x12, 0x5c, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72,
|
||||
0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61,
|
||||
0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73,
|
||||
0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
||||
0x52, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74,
|
||||
0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x6b, 0x0a, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44,
|
||||
0x61, 0x74, 0x61, 0x18, 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
||||
0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44,
|
||||
0x61, 0x74, 0x61, 0x12, 0x5c, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x18, 0x26, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
||||
0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72,
|
||||
0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
||||
0x72, 0x6b, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
||||
0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x12, 0x83, 0x01, 0x0a, 0x21, 0x72,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65,
|
||||
0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69,
|
||||
0x63, 0x6f, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x21, 0x72,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65,
|
||||
0x12, 0x3b, 0x0a, 0x09, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x29, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||
0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x48, 0x00, 0x52, 0x09, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x5c, 0x0a,
|
||||
0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x62, 0x64, 0x42,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72,
|
||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12,
|
||||
0x6b, 0x0a, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74,
|
||||
0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x25, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44,
|
||||
0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75,
|
||||
0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||
0x00, 0x52, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74,
|
||||
0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x5c, 0x0a, 0x14,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65,
|
||||
0x57, 0x6f, 0x72, 0x6b, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x62, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x18, 0x27, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57,
|
||||
0x6f, 0x72, 0x6b, 0x12, 0x83, 0x01, 0x0a, 0x21, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74,
|
||||
0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41,
|
||||
0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x21, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74,
|
||||
0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x62, 0x6c, 0x6f,
|
||||
0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x29, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||
0x00, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12,
|
||||
0x56, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x65,
|
||||
0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e,
|
||||
0x65, 0x78, 0x74, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65,
|
||||
0x78, 0x74, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x47, 0x0a, 0x0d, 0x64,
|
||||
0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x2b, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44,
|
||||
0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c,
|
||||
0x6f, 0x63, 0x6b, 0x73, 0x12, 0x6e, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53,
|
||||
0x65, 0x74, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e,
|
||||
0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53, 0x65, 0x74, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58,
|
||||
0x4f, 0x53, 0x65, 0x74, 0x12, 0x50, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49,
|
||||
0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22,
|
||||
0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x48, 0x00, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74,
|
||||
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x44, 0x6f, 0x6e, 0x65, 0x48,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x48, 0x65, 0x61,
|
||||
0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x44,
|
||||
0x6f, 0x6e, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x6e, 0x0a, 0x1a, 0x72, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e,
|
||||
0x74, 0x55, 0x54, 0x58, 0x4f, 0x53, 0x65, 0x74, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||
0x73, 0x74, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x62, 0x64,
|
||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x59, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54,
|
||||
0x58, 0x4f, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||
0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53, 0x65, 0x74, 0x12, 0x4a, 0x0a, 0x0e, 0x72, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x2d, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x59, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x2e, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||
@ -2394,99 +2430,100 @@ var file_messages_proto_goTypes = []interface{}{
|
||||
(*TransactionNotFoundMessage)(nil), // 14: protowire.TransactionNotFoundMessage
|
||||
(*RejectMessage)(nil), // 15: protowire.RejectMessage
|
||||
(*PruningPointUtxoSetChunkMessage)(nil), // 16: protowire.PruningPointUtxoSetChunkMessage
|
||||
(*UnexpectedPruningPointMessage)(nil), // 17: protowire.UnexpectedPruningPointMessage
|
||||
(*IbdBlockLocatorMessage)(nil), // 18: protowire.IbdBlockLocatorMessage
|
||||
(*IbdBlockLocatorHighestHashMessage)(nil), // 19: protowire.IbdBlockLocatorHighestHashMessage
|
||||
(*RequestNextPruningPointUtxoSetChunkMessage)(nil), // 20: protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||
(*DonePruningPointUtxoSetChunksMessage)(nil), // 21: protowire.DonePruningPointUtxoSetChunksMessage
|
||||
(*IbdBlockLocatorHighestHashNotFoundMessage)(nil), // 22: protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||
(*BlockWithTrustedDataMessage)(nil), // 23: protowire.BlockWithTrustedDataMessage
|
||||
(*DoneBlocksWithTrustedDataMessage)(nil), // 24: protowire.DoneBlocksWithTrustedDataMessage
|
||||
(*RequestBlockBlueWorkMessage)(nil), // 25: protowire.RequestBlockBlueWorkMessage
|
||||
(*BlockBlueWorkMessage)(nil), // 26: protowire.BlockBlueWorkMessage
|
||||
(*RequestPruningPointAndItsAnticoneMessage)(nil), // 27: protowire.RequestPruningPointAndItsAnticoneMessage
|
||||
(*IbdBlocksMessage)(nil), // 28: protowire.IbdBlocksMessage
|
||||
(*RequestNextIbdBlocksMessage)(nil), // 29: protowire.RequestNextIbdBlocksMessage
|
||||
(*DoneIbdBlocksMessage)(nil), // 30: protowire.DoneIbdBlocksMessage
|
||||
(*RequestPruningPointUTXOSetMessage)(nil), // 31: protowire.RequestPruningPointUTXOSetMessage
|
||||
(*RequestIbdBlocksMessage)(nil), // 32: protowire.RequestIbdBlocksMessage
|
||||
(*RequestBlockLocatorMessage)(nil), // 33: protowire.RequestBlockLocatorMessage
|
||||
(*GetCurrentNetworkRequestMessage)(nil), // 34: protowire.GetCurrentNetworkRequestMessage
|
||||
(*GetCurrentNetworkResponseMessage)(nil), // 35: protowire.GetCurrentNetworkResponseMessage
|
||||
(*SubmitBlockRequestMessage)(nil), // 36: protowire.SubmitBlockRequestMessage
|
||||
(*SubmitBlockResponseMessage)(nil), // 37: protowire.SubmitBlockResponseMessage
|
||||
(*GetBlockTemplateRequestMessage)(nil), // 38: protowire.GetBlockTemplateRequestMessage
|
||||
(*GetBlockTemplateResponseMessage)(nil), // 39: protowire.GetBlockTemplateResponseMessage
|
||||
(*NotifyBlockAddedRequestMessage)(nil), // 40: protowire.NotifyBlockAddedRequestMessage
|
||||
(*NotifyBlockAddedResponseMessage)(nil), // 41: protowire.NotifyBlockAddedResponseMessage
|
||||
(*BlockAddedNotificationMessage)(nil), // 42: protowire.BlockAddedNotificationMessage
|
||||
(*GetPeerAddressesRequestMessage)(nil), // 43: protowire.GetPeerAddressesRequestMessage
|
||||
(*GetPeerAddressesResponseMessage)(nil), // 44: protowire.GetPeerAddressesResponseMessage
|
||||
(*GetSelectedTipHashRequestMessage)(nil), // 45: protowire.GetSelectedTipHashRequestMessage
|
||||
(*GetSelectedTipHashResponseMessage)(nil), // 46: protowire.GetSelectedTipHashResponseMessage
|
||||
(*GetMempoolEntryRequestMessage)(nil), // 47: protowire.GetMempoolEntryRequestMessage
|
||||
(*GetMempoolEntryResponseMessage)(nil), // 48: protowire.GetMempoolEntryResponseMessage
|
||||
(*GetConnectedPeerInfoRequestMessage)(nil), // 49: protowire.GetConnectedPeerInfoRequestMessage
|
||||
(*GetConnectedPeerInfoResponseMessage)(nil), // 50: protowire.GetConnectedPeerInfoResponseMessage
|
||||
(*AddPeerRequestMessage)(nil), // 51: protowire.AddPeerRequestMessage
|
||||
(*AddPeerResponseMessage)(nil), // 52: protowire.AddPeerResponseMessage
|
||||
(*SubmitTransactionRequestMessage)(nil), // 53: protowire.SubmitTransactionRequestMessage
|
||||
(*SubmitTransactionResponseMessage)(nil), // 54: protowire.SubmitTransactionResponseMessage
|
||||
(*NotifyVirtualSelectedParentChainChangedRequestMessage)(nil), // 55: protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||
(*NotifyVirtualSelectedParentChainChangedResponseMessage)(nil), // 56: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||
(*VirtualSelectedParentChainChangedNotificationMessage)(nil), // 57: protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||
(*GetBlockRequestMessage)(nil), // 58: protowire.GetBlockRequestMessage
|
||||
(*GetBlockResponseMessage)(nil), // 59: protowire.GetBlockResponseMessage
|
||||
(*GetSubnetworkRequestMessage)(nil), // 60: protowire.GetSubnetworkRequestMessage
|
||||
(*GetSubnetworkResponseMessage)(nil), // 61: protowire.GetSubnetworkResponseMessage
|
||||
(*GetVirtualSelectedParentChainFromBlockRequestMessage)(nil), // 62: protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||
(*GetVirtualSelectedParentChainFromBlockResponseMessage)(nil), // 63: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||
(*GetBlocksRequestMessage)(nil), // 64: protowire.GetBlocksRequestMessage
|
||||
(*GetBlocksResponseMessage)(nil), // 65: protowire.GetBlocksResponseMessage
|
||||
(*GetBlockCountRequestMessage)(nil), // 66: protowire.GetBlockCountRequestMessage
|
||||
(*GetBlockCountResponseMessage)(nil), // 67: protowire.GetBlockCountResponseMessage
|
||||
(*GetBlockDagInfoRequestMessage)(nil), // 68: protowire.GetBlockDagInfoRequestMessage
|
||||
(*GetBlockDagInfoResponseMessage)(nil), // 69: protowire.GetBlockDagInfoResponseMessage
|
||||
(*ResolveFinalityConflictRequestMessage)(nil), // 70: protowire.ResolveFinalityConflictRequestMessage
|
||||
(*ResolveFinalityConflictResponseMessage)(nil), // 71: protowire.ResolveFinalityConflictResponseMessage
|
||||
(*NotifyFinalityConflictsRequestMessage)(nil), // 72: protowire.NotifyFinalityConflictsRequestMessage
|
||||
(*NotifyFinalityConflictsResponseMessage)(nil), // 73: protowire.NotifyFinalityConflictsResponseMessage
|
||||
(*FinalityConflictNotificationMessage)(nil), // 74: protowire.FinalityConflictNotificationMessage
|
||||
(*FinalityConflictResolvedNotificationMessage)(nil), // 75: protowire.FinalityConflictResolvedNotificationMessage
|
||||
(*GetMempoolEntriesRequestMessage)(nil), // 76: protowire.GetMempoolEntriesRequestMessage
|
||||
(*GetMempoolEntriesResponseMessage)(nil), // 77: protowire.GetMempoolEntriesResponseMessage
|
||||
(*ShutDownRequestMessage)(nil), // 78: protowire.ShutDownRequestMessage
|
||||
(*ShutDownResponseMessage)(nil), // 79: protowire.ShutDownResponseMessage
|
||||
(*GetHeadersRequestMessage)(nil), // 80: protowire.GetHeadersRequestMessage
|
||||
(*GetHeadersResponseMessage)(nil), // 81: protowire.GetHeadersResponseMessage
|
||||
(*NotifyUtxosChangedRequestMessage)(nil), // 82: protowire.NotifyUtxosChangedRequestMessage
|
||||
(*NotifyUtxosChangedResponseMessage)(nil), // 83: protowire.NotifyUtxosChangedResponseMessage
|
||||
(*UtxosChangedNotificationMessage)(nil), // 84: protowire.UtxosChangedNotificationMessage
|
||||
(*GetUtxosByAddressesRequestMessage)(nil), // 85: protowire.GetUtxosByAddressesRequestMessage
|
||||
(*GetUtxosByAddressesResponseMessage)(nil), // 86: protowire.GetUtxosByAddressesResponseMessage
|
||||
(*GetVirtualSelectedParentBlueScoreRequestMessage)(nil), // 87: protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||
(*GetVirtualSelectedParentBlueScoreResponseMessage)(nil), // 88: protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)(nil), // 89: protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)(nil), // 90: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||
(*VirtualSelectedParentBlueScoreChangedNotificationMessage)(nil), // 91: protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||
(*BanRequestMessage)(nil), // 92: protowire.BanRequestMessage
|
||||
(*BanResponseMessage)(nil), // 93: protowire.BanResponseMessage
|
||||
(*UnbanRequestMessage)(nil), // 94: protowire.UnbanRequestMessage
|
||||
(*UnbanResponseMessage)(nil), // 95: protowire.UnbanResponseMessage
|
||||
(*GetInfoRequestMessage)(nil), // 96: protowire.GetInfoRequestMessage
|
||||
(*GetInfoResponseMessage)(nil), // 97: protowire.GetInfoResponseMessage
|
||||
(*StopNotifyingUtxosChangedRequestMessage)(nil), // 98: protowire.StopNotifyingUtxosChangedRequestMessage
|
||||
(*StopNotifyingUtxosChangedResponseMessage)(nil), // 99: protowire.StopNotifyingUtxosChangedResponseMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 100: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 101: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 102: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 103: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 104: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
(*EstimateNetworkHashesPerSecondRequestMessage)(nil), // 105: protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||
(*EstimateNetworkHashesPerSecondResponseMessage)(nil), // 106: protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 107: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 108: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 109: protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
(*RequestIBDBlocksMessage)(nil), // 17: protowire.RequestIBDBlocksMessage
|
||||
(*UnexpectedPruningPointMessage)(nil), // 18: protowire.UnexpectedPruningPointMessage
|
||||
(*IbdBlockLocatorMessage)(nil), // 19: protowire.IbdBlockLocatorMessage
|
||||
(*IbdBlockLocatorHighestHashMessage)(nil), // 20: protowire.IbdBlockLocatorHighestHashMessage
|
||||
(*RequestNextPruningPointUtxoSetChunkMessage)(nil), // 21: protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||
(*DonePruningPointUtxoSetChunksMessage)(nil), // 22: protowire.DonePruningPointUtxoSetChunksMessage
|
||||
(*IbdBlockLocatorHighestHashNotFoundMessage)(nil), // 23: protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||
(*BlockWithTrustedDataMessage)(nil), // 24: protowire.BlockWithTrustedDataMessage
|
||||
(*DoneBlocksWithTrustedDataMessage)(nil), // 25: protowire.DoneBlocksWithTrustedDataMessage
|
||||
(*RequestBlockBlueWorkMessage)(nil), // 26: protowire.RequestBlockBlueWorkMessage
|
||||
(*BlockBlueWorkMessage)(nil), // 27: protowire.BlockBlueWorkMessage
|
||||
(*RequestPruningPointAndItsAnticoneMessage)(nil), // 28: protowire.RequestPruningPointAndItsAnticoneMessage
|
||||
(*BlockHeadersMessage)(nil), // 29: protowire.BlockHeadersMessage
|
||||
(*RequestNextHeadersMessage)(nil), // 30: protowire.RequestNextHeadersMessage
|
||||
(*DoneHeadersMessage)(nil), // 31: protowire.DoneHeadersMessage
|
||||
(*RequestPruningPointUTXOSetMessage)(nil), // 32: protowire.RequestPruningPointUTXOSetMessage
|
||||
(*RequestHeadersMessage)(nil), // 33: protowire.RequestHeadersMessage
|
||||
(*RequestBlockLocatorMessage)(nil), // 34: protowire.RequestBlockLocatorMessage
|
||||
(*GetCurrentNetworkRequestMessage)(nil), // 35: protowire.GetCurrentNetworkRequestMessage
|
||||
(*GetCurrentNetworkResponseMessage)(nil), // 36: protowire.GetCurrentNetworkResponseMessage
|
||||
(*SubmitBlockRequestMessage)(nil), // 37: protowire.SubmitBlockRequestMessage
|
||||
(*SubmitBlockResponseMessage)(nil), // 38: protowire.SubmitBlockResponseMessage
|
||||
(*GetBlockTemplateRequestMessage)(nil), // 39: protowire.GetBlockTemplateRequestMessage
|
||||
(*GetBlockTemplateResponseMessage)(nil), // 40: protowire.GetBlockTemplateResponseMessage
|
||||
(*NotifyBlockAddedRequestMessage)(nil), // 41: protowire.NotifyBlockAddedRequestMessage
|
||||
(*NotifyBlockAddedResponseMessage)(nil), // 42: protowire.NotifyBlockAddedResponseMessage
|
||||
(*BlockAddedNotificationMessage)(nil), // 43: protowire.BlockAddedNotificationMessage
|
||||
(*GetPeerAddressesRequestMessage)(nil), // 44: protowire.GetPeerAddressesRequestMessage
|
||||
(*GetPeerAddressesResponseMessage)(nil), // 45: protowire.GetPeerAddressesResponseMessage
|
||||
(*GetSelectedTipHashRequestMessage)(nil), // 46: protowire.GetSelectedTipHashRequestMessage
|
||||
(*GetSelectedTipHashResponseMessage)(nil), // 47: protowire.GetSelectedTipHashResponseMessage
|
||||
(*GetMempoolEntryRequestMessage)(nil), // 48: protowire.GetMempoolEntryRequestMessage
|
||||
(*GetMempoolEntryResponseMessage)(nil), // 49: protowire.GetMempoolEntryResponseMessage
|
||||
(*GetConnectedPeerInfoRequestMessage)(nil), // 50: protowire.GetConnectedPeerInfoRequestMessage
|
||||
(*GetConnectedPeerInfoResponseMessage)(nil), // 51: protowire.GetConnectedPeerInfoResponseMessage
|
||||
(*AddPeerRequestMessage)(nil), // 52: protowire.AddPeerRequestMessage
|
||||
(*AddPeerResponseMessage)(nil), // 53: protowire.AddPeerResponseMessage
|
||||
(*SubmitTransactionRequestMessage)(nil), // 54: protowire.SubmitTransactionRequestMessage
|
||||
(*SubmitTransactionResponseMessage)(nil), // 55: protowire.SubmitTransactionResponseMessage
|
||||
(*NotifyVirtualSelectedParentChainChangedRequestMessage)(nil), // 56: protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||
(*NotifyVirtualSelectedParentChainChangedResponseMessage)(nil), // 57: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||
(*VirtualSelectedParentChainChangedNotificationMessage)(nil), // 58: protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||
(*GetBlockRequestMessage)(nil), // 59: protowire.GetBlockRequestMessage
|
||||
(*GetBlockResponseMessage)(nil), // 60: protowire.GetBlockResponseMessage
|
||||
(*GetSubnetworkRequestMessage)(nil), // 61: protowire.GetSubnetworkRequestMessage
|
||||
(*GetSubnetworkResponseMessage)(nil), // 62: protowire.GetSubnetworkResponseMessage
|
||||
(*GetVirtualSelectedParentChainFromBlockRequestMessage)(nil), // 63: protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||
(*GetVirtualSelectedParentChainFromBlockResponseMessage)(nil), // 64: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||
(*GetBlocksRequestMessage)(nil), // 65: protowire.GetBlocksRequestMessage
|
||||
(*GetBlocksResponseMessage)(nil), // 66: protowire.GetBlocksResponseMessage
|
||||
(*GetBlockCountRequestMessage)(nil), // 67: protowire.GetBlockCountRequestMessage
|
||||
(*GetBlockCountResponseMessage)(nil), // 68: protowire.GetBlockCountResponseMessage
|
||||
(*GetBlockDagInfoRequestMessage)(nil), // 69: protowire.GetBlockDagInfoRequestMessage
|
||||
(*GetBlockDagInfoResponseMessage)(nil), // 70: protowire.GetBlockDagInfoResponseMessage
|
||||
(*ResolveFinalityConflictRequestMessage)(nil), // 71: protowire.ResolveFinalityConflictRequestMessage
|
||||
(*ResolveFinalityConflictResponseMessage)(nil), // 72: protowire.ResolveFinalityConflictResponseMessage
|
||||
(*NotifyFinalityConflictsRequestMessage)(nil), // 73: protowire.NotifyFinalityConflictsRequestMessage
|
||||
(*NotifyFinalityConflictsResponseMessage)(nil), // 74: protowire.NotifyFinalityConflictsResponseMessage
|
||||
(*FinalityConflictNotificationMessage)(nil), // 75: protowire.FinalityConflictNotificationMessage
|
||||
(*FinalityConflictResolvedNotificationMessage)(nil), // 76: protowire.FinalityConflictResolvedNotificationMessage
|
||||
(*GetMempoolEntriesRequestMessage)(nil), // 77: protowire.GetMempoolEntriesRequestMessage
|
||||
(*GetMempoolEntriesResponseMessage)(nil), // 78: protowire.GetMempoolEntriesResponseMessage
|
||||
(*ShutDownRequestMessage)(nil), // 79: protowire.ShutDownRequestMessage
|
||||
(*ShutDownResponseMessage)(nil), // 80: protowire.ShutDownResponseMessage
|
||||
(*GetHeadersRequestMessage)(nil), // 81: protowire.GetHeadersRequestMessage
|
||||
(*GetHeadersResponseMessage)(nil), // 82: protowire.GetHeadersResponseMessage
|
||||
(*NotifyUtxosChangedRequestMessage)(nil), // 83: protowire.NotifyUtxosChangedRequestMessage
|
||||
(*NotifyUtxosChangedResponseMessage)(nil), // 84: protowire.NotifyUtxosChangedResponseMessage
|
||||
(*UtxosChangedNotificationMessage)(nil), // 85: protowire.UtxosChangedNotificationMessage
|
||||
(*GetUtxosByAddressesRequestMessage)(nil), // 86: protowire.GetUtxosByAddressesRequestMessage
|
||||
(*GetUtxosByAddressesResponseMessage)(nil), // 87: protowire.GetUtxosByAddressesResponseMessage
|
||||
(*GetVirtualSelectedParentBlueScoreRequestMessage)(nil), // 88: protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||
(*GetVirtualSelectedParentBlueScoreResponseMessage)(nil), // 89: protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)(nil), // 90: protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)(nil), // 91: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||
(*VirtualSelectedParentBlueScoreChangedNotificationMessage)(nil), // 92: protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||
(*BanRequestMessage)(nil), // 93: protowire.BanRequestMessage
|
||||
(*BanResponseMessage)(nil), // 94: protowire.BanResponseMessage
|
||||
(*UnbanRequestMessage)(nil), // 95: protowire.UnbanRequestMessage
|
||||
(*UnbanResponseMessage)(nil), // 96: protowire.UnbanResponseMessage
|
||||
(*GetInfoRequestMessage)(nil), // 97: protowire.GetInfoRequestMessage
|
||||
(*GetInfoResponseMessage)(nil), // 98: protowire.GetInfoResponseMessage
|
||||
(*StopNotifyingUtxosChangedRequestMessage)(nil), // 99: protowire.StopNotifyingUtxosChangedRequestMessage
|
||||
(*StopNotifyingUtxosChangedResponseMessage)(nil), // 100: protowire.StopNotifyingUtxosChangedResponseMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 101: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 102: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 103: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 104: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 105: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
(*EstimateNetworkHashesPerSecondRequestMessage)(nil), // 106: protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||
(*EstimateNetworkHashesPerSecondResponseMessage)(nil), // 107: protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 108: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 109: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 110: protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
}
|
||||
var file_messages_proto_depIdxs = []int32{
|
||||
1, // 0: protowire.KaspadMessage.addresses:type_name -> protowire.AddressesMessage
|
||||
@ -2496,117 +2533,119 @@ var file_messages_proto_depIdxs = []int32{
|
||||
5, // 4: protowire.KaspadMessage.requestAddresses:type_name -> protowire.RequestAddressesMessage
|
||||
6, // 5: protowire.KaspadMessage.requestRelayBlocks:type_name -> protowire.RequestRelayBlocksMessage
|
||||
7, // 6: protowire.KaspadMessage.requestTransactions:type_name -> protowire.RequestTransactionsMessage
|
||||
8, // 7: protowire.KaspadMessage.invRelayBlock:type_name -> protowire.InvRelayBlockMessage
|
||||
9, // 8: protowire.KaspadMessage.invTransactions:type_name -> protowire.InvTransactionsMessage
|
||||
10, // 9: protowire.KaspadMessage.ping:type_name -> protowire.PingMessage
|
||||
11, // 10: protowire.KaspadMessage.pong:type_name -> protowire.PongMessage
|
||||
12, // 11: protowire.KaspadMessage.verack:type_name -> protowire.VerackMessage
|
||||
13, // 12: protowire.KaspadMessage.version:type_name -> protowire.VersionMessage
|
||||
14, // 13: protowire.KaspadMessage.transactionNotFound:type_name -> protowire.TransactionNotFoundMessage
|
||||
15, // 14: protowire.KaspadMessage.reject:type_name -> protowire.RejectMessage
|
||||
16, // 15: protowire.KaspadMessage.pruningPointUtxoSetChunk:type_name -> protowire.PruningPointUtxoSetChunkMessage
|
||||
17, // 16: protowire.KaspadMessage.unexpectedPruningPoint:type_name -> protowire.UnexpectedPruningPointMessage
|
||||
18, // 17: protowire.KaspadMessage.ibdBlockLocator:type_name -> protowire.IbdBlockLocatorMessage
|
||||
19, // 18: protowire.KaspadMessage.ibdBlockLocatorHighestHash:type_name -> protowire.IbdBlockLocatorHighestHashMessage
|
||||
20, // 19: protowire.KaspadMessage.requestNextPruningPointUtxoSetChunk:type_name -> protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||
21, // 20: protowire.KaspadMessage.donePruningPointUtxoSetChunks:type_name -> protowire.DonePruningPointUtxoSetChunksMessage
|
||||
22, // 21: protowire.KaspadMessage.ibdBlockLocatorHighestHashNotFound:type_name -> protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||
23, // 22: protowire.KaspadMessage.blockWithTrustedData:type_name -> protowire.BlockWithTrustedDataMessage
|
||||
24, // 23: protowire.KaspadMessage.doneBlocksWithTrustedData:type_name -> protowire.DoneBlocksWithTrustedDataMessage
|
||||
25, // 24: protowire.KaspadMessage.requestBlockBlueWork:type_name -> protowire.RequestBlockBlueWorkMessage
|
||||
26, // 25: protowire.KaspadMessage.blockBlueWork:type_name -> protowire.BlockBlueWorkMessage
|
||||
27, // 26: protowire.KaspadMessage.requestPruningPointAndItsAnticone:type_name -> protowire.RequestPruningPointAndItsAnticoneMessage
|
||||
28, // 27: protowire.KaspadMessage.ibdBlocks:type_name -> protowire.IbdBlocksMessage
|
||||
29, // 28: protowire.KaspadMessage.requestNextIbdBlocks:type_name -> protowire.RequestNextIbdBlocksMessage
|
||||
30, // 29: protowire.KaspadMessage.doneIbdBlocks:type_name -> protowire.DoneIbdBlocksMessage
|
||||
31, // 30: protowire.KaspadMessage.requestPruningPointUTXOSet:type_name -> protowire.RequestPruningPointUTXOSetMessage
|
||||
32, // 31: protowire.KaspadMessage.requestIbdBlocks:type_name -> protowire.RequestIbdBlocksMessage
|
||||
33, // 32: protowire.KaspadMessage.requestBlockLocator:type_name -> protowire.RequestBlockLocatorMessage
|
||||
34, // 33: protowire.KaspadMessage.getCurrentNetworkRequest:type_name -> protowire.GetCurrentNetworkRequestMessage
|
||||
35, // 34: protowire.KaspadMessage.getCurrentNetworkResponse:type_name -> protowire.GetCurrentNetworkResponseMessage
|
||||
36, // 35: protowire.KaspadMessage.submitBlockRequest:type_name -> protowire.SubmitBlockRequestMessage
|
||||
37, // 36: protowire.KaspadMessage.submitBlockResponse:type_name -> protowire.SubmitBlockResponseMessage
|
||||
38, // 37: protowire.KaspadMessage.getBlockTemplateRequest:type_name -> protowire.GetBlockTemplateRequestMessage
|
||||
39, // 38: protowire.KaspadMessage.getBlockTemplateResponse:type_name -> protowire.GetBlockTemplateResponseMessage
|
||||
40, // 39: protowire.KaspadMessage.notifyBlockAddedRequest:type_name -> protowire.NotifyBlockAddedRequestMessage
|
||||
41, // 40: protowire.KaspadMessage.notifyBlockAddedResponse:type_name -> protowire.NotifyBlockAddedResponseMessage
|
||||
42, // 41: protowire.KaspadMessage.blockAddedNotification:type_name -> protowire.BlockAddedNotificationMessage
|
||||
43, // 42: protowire.KaspadMessage.getPeerAddressesRequest:type_name -> protowire.GetPeerAddressesRequestMessage
|
||||
44, // 43: protowire.KaspadMessage.getPeerAddressesResponse:type_name -> protowire.GetPeerAddressesResponseMessage
|
||||
45, // 44: protowire.KaspadMessage.getSelectedTipHashRequest:type_name -> protowire.GetSelectedTipHashRequestMessage
|
||||
46, // 45: protowire.KaspadMessage.getSelectedTipHashResponse:type_name -> protowire.GetSelectedTipHashResponseMessage
|
||||
47, // 46: protowire.KaspadMessage.getMempoolEntryRequest:type_name -> protowire.GetMempoolEntryRequestMessage
|
||||
48, // 47: protowire.KaspadMessage.getMempoolEntryResponse:type_name -> protowire.GetMempoolEntryResponseMessage
|
||||
49, // 48: protowire.KaspadMessage.getConnectedPeerInfoRequest:type_name -> protowire.GetConnectedPeerInfoRequestMessage
|
||||
50, // 49: protowire.KaspadMessage.getConnectedPeerInfoResponse:type_name -> protowire.GetConnectedPeerInfoResponseMessage
|
||||
51, // 50: protowire.KaspadMessage.addPeerRequest:type_name -> protowire.AddPeerRequestMessage
|
||||
52, // 51: protowire.KaspadMessage.addPeerResponse:type_name -> protowire.AddPeerResponseMessage
|
||||
53, // 52: protowire.KaspadMessage.submitTransactionRequest:type_name -> protowire.SubmitTransactionRequestMessage
|
||||
54, // 53: protowire.KaspadMessage.submitTransactionResponse:type_name -> protowire.SubmitTransactionResponseMessage
|
||||
55, // 54: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||
56, // 55: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||
57, // 56: protowire.KaspadMessage.virtualSelectedParentChainChangedNotification:type_name -> protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||
58, // 57: protowire.KaspadMessage.getBlockRequest:type_name -> protowire.GetBlockRequestMessage
|
||||
59, // 58: protowire.KaspadMessage.getBlockResponse:type_name -> protowire.GetBlockResponseMessage
|
||||
60, // 59: protowire.KaspadMessage.getSubnetworkRequest:type_name -> protowire.GetSubnetworkRequestMessage
|
||||
61, // 60: protowire.KaspadMessage.getSubnetworkResponse:type_name -> protowire.GetSubnetworkResponseMessage
|
||||
62, // 61: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockRequest:type_name -> protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||
63, // 62: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockResponse:type_name -> protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||
64, // 63: protowire.KaspadMessage.getBlocksRequest:type_name -> protowire.GetBlocksRequestMessage
|
||||
65, // 64: protowire.KaspadMessage.getBlocksResponse:type_name -> protowire.GetBlocksResponseMessage
|
||||
66, // 65: protowire.KaspadMessage.getBlockCountRequest:type_name -> protowire.GetBlockCountRequestMessage
|
||||
67, // 66: protowire.KaspadMessage.getBlockCountResponse:type_name -> protowire.GetBlockCountResponseMessage
|
||||
68, // 67: protowire.KaspadMessage.getBlockDagInfoRequest:type_name -> protowire.GetBlockDagInfoRequestMessage
|
||||
69, // 68: protowire.KaspadMessage.getBlockDagInfoResponse:type_name -> protowire.GetBlockDagInfoResponseMessage
|
||||
70, // 69: protowire.KaspadMessage.resolveFinalityConflictRequest:type_name -> protowire.ResolveFinalityConflictRequestMessage
|
||||
71, // 70: protowire.KaspadMessage.resolveFinalityConflictResponse:type_name -> protowire.ResolveFinalityConflictResponseMessage
|
||||
72, // 71: protowire.KaspadMessage.notifyFinalityConflictsRequest:type_name -> protowire.NotifyFinalityConflictsRequestMessage
|
||||
73, // 72: protowire.KaspadMessage.notifyFinalityConflictsResponse:type_name -> protowire.NotifyFinalityConflictsResponseMessage
|
||||
74, // 73: protowire.KaspadMessage.finalityConflictNotification:type_name -> protowire.FinalityConflictNotificationMessage
|
||||
75, // 74: protowire.KaspadMessage.finalityConflictResolvedNotification:type_name -> protowire.FinalityConflictResolvedNotificationMessage
|
||||
76, // 75: protowire.KaspadMessage.getMempoolEntriesRequest:type_name -> protowire.GetMempoolEntriesRequestMessage
|
||||
77, // 76: protowire.KaspadMessage.getMempoolEntriesResponse:type_name -> protowire.GetMempoolEntriesResponseMessage
|
||||
78, // 77: protowire.KaspadMessage.shutDownRequest:type_name -> protowire.ShutDownRequestMessage
|
||||
79, // 78: protowire.KaspadMessage.shutDownResponse:type_name -> protowire.ShutDownResponseMessage
|
||||
80, // 79: protowire.KaspadMessage.getHeadersRequest:type_name -> protowire.GetHeadersRequestMessage
|
||||
81, // 80: protowire.KaspadMessage.getHeadersResponse:type_name -> protowire.GetHeadersResponseMessage
|
||||
82, // 81: protowire.KaspadMessage.notifyUtxosChangedRequest:type_name -> protowire.NotifyUtxosChangedRequestMessage
|
||||
83, // 82: protowire.KaspadMessage.notifyUtxosChangedResponse:type_name -> protowire.NotifyUtxosChangedResponseMessage
|
||||
84, // 83: protowire.KaspadMessage.utxosChangedNotification:type_name -> protowire.UtxosChangedNotificationMessage
|
||||
85, // 84: protowire.KaspadMessage.getUtxosByAddressesRequest:type_name -> protowire.GetUtxosByAddressesRequestMessage
|
||||
86, // 85: protowire.KaspadMessage.getUtxosByAddressesResponse:type_name -> protowire.GetUtxosByAddressesResponseMessage
|
||||
87, // 86: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreRequest:type_name -> protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||
88, // 87: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreResponse:type_name -> protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||
89, // 88: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
90, // 89: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||
91, // 90: protowire.KaspadMessage.virtualSelectedParentBlueScoreChangedNotification:type_name -> protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||
92, // 91: protowire.KaspadMessage.banRequest:type_name -> protowire.BanRequestMessage
|
||||
93, // 92: protowire.KaspadMessage.banResponse:type_name -> protowire.BanResponseMessage
|
||||
94, // 93: protowire.KaspadMessage.unbanRequest:type_name -> protowire.UnbanRequestMessage
|
||||
95, // 94: protowire.KaspadMessage.unbanResponse:type_name -> protowire.UnbanResponseMessage
|
||||
96, // 95: protowire.KaspadMessage.getInfoRequest:type_name -> protowire.GetInfoRequestMessage
|
||||
97, // 96: protowire.KaspadMessage.getInfoResponse:type_name -> protowire.GetInfoResponseMessage
|
||||
98, // 97: protowire.KaspadMessage.stopNotifyingUtxosChangedRequest:type_name -> protowire.StopNotifyingUtxosChangedRequestMessage
|
||||
99, // 98: protowire.KaspadMessage.stopNotifyingUtxosChangedResponse:type_name -> protowire.StopNotifyingUtxosChangedResponseMessage
|
||||
100, // 99: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideRequest:type_name -> protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
101, // 100: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideResponse:type_name -> protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
102, // 101: protowire.KaspadMessage.pruningPointUTXOSetOverrideNotification:type_name -> protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
103, // 102: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideRequest:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
104, // 103: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideResponse:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
105, // 104: protowire.KaspadMessage.estimateNetworkHashesPerSecondRequest:type_name -> protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||
106, // 105: protowire.KaspadMessage.estimateNetworkHashesPerSecondResponse:type_name -> protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||
107, // 106: protowire.KaspadMessage.notifyVirtualDaaScoreChangedRequest:type_name -> protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
108, // 107: protowire.KaspadMessage.notifyVirtualDaaScoreChangedResponse:type_name -> protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
109, // 108: protowire.KaspadMessage.virtualDaaScoreChangedNotification:type_name -> protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
0, // 109: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 110: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 111: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 112: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
111, // [111:113] is the sub-list for method output_type
|
||||
109, // [109:111] is the sub-list for method input_type
|
||||
109, // [109:109] is the sub-list for extension type_name
|
||||
109, // [109:109] is the sub-list for extension extendee
|
||||
0, // [0:109] is the sub-list for field type_name
|
||||
2, // 7: protowire.KaspadMessage.ibdBlock:type_name -> protowire.BlockMessage
|
||||
8, // 8: protowire.KaspadMessage.invRelayBlock:type_name -> protowire.InvRelayBlockMessage
|
||||
9, // 9: protowire.KaspadMessage.invTransactions:type_name -> protowire.InvTransactionsMessage
|
||||
10, // 10: protowire.KaspadMessage.ping:type_name -> protowire.PingMessage
|
||||
11, // 11: protowire.KaspadMessage.pong:type_name -> protowire.PongMessage
|
||||
12, // 12: protowire.KaspadMessage.verack:type_name -> protowire.VerackMessage
|
||||
13, // 13: protowire.KaspadMessage.version:type_name -> protowire.VersionMessage
|
||||
14, // 14: protowire.KaspadMessage.transactionNotFound:type_name -> protowire.TransactionNotFoundMessage
|
||||
15, // 15: protowire.KaspadMessage.reject:type_name -> protowire.RejectMessage
|
||||
16, // 16: protowire.KaspadMessage.pruningPointUtxoSetChunk:type_name -> protowire.PruningPointUtxoSetChunkMessage
|
||||
17, // 17: protowire.KaspadMessage.requestIBDBlocks:type_name -> protowire.RequestIBDBlocksMessage
|
||||
18, // 18: protowire.KaspadMessage.unexpectedPruningPoint:type_name -> protowire.UnexpectedPruningPointMessage
|
||||
19, // 19: protowire.KaspadMessage.ibdBlockLocator:type_name -> protowire.IbdBlockLocatorMessage
|
||||
20, // 20: protowire.KaspadMessage.ibdBlockLocatorHighestHash:type_name -> protowire.IbdBlockLocatorHighestHashMessage
|
||||
21, // 21: protowire.KaspadMessage.requestNextPruningPointUtxoSetChunk:type_name -> protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||
22, // 22: protowire.KaspadMessage.donePruningPointUtxoSetChunks:type_name -> protowire.DonePruningPointUtxoSetChunksMessage
|
||||
23, // 23: protowire.KaspadMessage.ibdBlockLocatorHighestHashNotFound:type_name -> protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||
24, // 24: protowire.KaspadMessage.blockWithTrustedData:type_name -> protowire.BlockWithTrustedDataMessage
|
||||
25, // 25: protowire.KaspadMessage.doneBlocksWithTrustedData:type_name -> protowire.DoneBlocksWithTrustedDataMessage
|
||||
26, // 26: protowire.KaspadMessage.requestBlockBlueWork:type_name -> protowire.RequestBlockBlueWorkMessage
|
||||
27, // 27: protowire.KaspadMessage.blockBlueWork:type_name -> protowire.BlockBlueWorkMessage
|
||||
28, // 28: protowire.KaspadMessage.requestPruningPointAndItsAnticone:type_name -> protowire.RequestPruningPointAndItsAnticoneMessage
|
||||
29, // 29: protowire.KaspadMessage.blockHeaders:type_name -> protowire.BlockHeadersMessage
|
||||
30, // 30: protowire.KaspadMessage.requestNextHeaders:type_name -> protowire.RequestNextHeadersMessage
|
||||
31, // 31: protowire.KaspadMessage.DoneHeaders:type_name -> protowire.DoneHeadersMessage
|
||||
32, // 32: protowire.KaspadMessage.requestPruningPointUTXOSet:type_name -> protowire.RequestPruningPointUTXOSetMessage
|
||||
33, // 33: protowire.KaspadMessage.requestHeaders:type_name -> protowire.RequestHeadersMessage
|
||||
34, // 34: protowire.KaspadMessage.requestBlockLocator:type_name -> protowire.RequestBlockLocatorMessage
|
||||
35, // 35: protowire.KaspadMessage.getCurrentNetworkRequest:type_name -> protowire.GetCurrentNetworkRequestMessage
|
||||
36, // 36: protowire.KaspadMessage.getCurrentNetworkResponse:type_name -> protowire.GetCurrentNetworkResponseMessage
|
||||
37, // 37: protowire.KaspadMessage.submitBlockRequest:type_name -> protowire.SubmitBlockRequestMessage
|
||||
38, // 38: protowire.KaspadMessage.submitBlockResponse:type_name -> protowire.SubmitBlockResponseMessage
|
||||
39, // 39: protowire.KaspadMessage.getBlockTemplateRequest:type_name -> protowire.GetBlockTemplateRequestMessage
|
||||
40, // 40: protowire.KaspadMessage.getBlockTemplateResponse:type_name -> protowire.GetBlockTemplateResponseMessage
|
||||
41, // 41: protowire.KaspadMessage.notifyBlockAddedRequest:type_name -> protowire.NotifyBlockAddedRequestMessage
|
||||
42, // 42: protowire.KaspadMessage.notifyBlockAddedResponse:type_name -> protowire.NotifyBlockAddedResponseMessage
|
||||
43, // 43: protowire.KaspadMessage.blockAddedNotification:type_name -> protowire.BlockAddedNotificationMessage
|
||||
44, // 44: protowire.KaspadMessage.getPeerAddressesRequest:type_name -> protowire.GetPeerAddressesRequestMessage
|
||||
45, // 45: protowire.KaspadMessage.getPeerAddressesResponse:type_name -> protowire.GetPeerAddressesResponseMessage
|
||||
46, // 46: protowire.KaspadMessage.getSelectedTipHashRequest:type_name -> protowire.GetSelectedTipHashRequestMessage
|
||||
47, // 47: protowire.KaspadMessage.getSelectedTipHashResponse:type_name -> protowire.GetSelectedTipHashResponseMessage
|
||||
48, // 48: protowire.KaspadMessage.getMempoolEntryRequest:type_name -> protowire.GetMempoolEntryRequestMessage
|
||||
49, // 49: protowire.KaspadMessage.getMempoolEntryResponse:type_name -> protowire.GetMempoolEntryResponseMessage
|
||||
50, // 50: protowire.KaspadMessage.getConnectedPeerInfoRequest:type_name -> protowire.GetConnectedPeerInfoRequestMessage
|
||||
51, // 51: protowire.KaspadMessage.getConnectedPeerInfoResponse:type_name -> protowire.GetConnectedPeerInfoResponseMessage
|
||||
52, // 52: protowire.KaspadMessage.addPeerRequest:type_name -> protowire.AddPeerRequestMessage
|
||||
53, // 53: protowire.KaspadMessage.addPeerResponse:type_name -> protowire.AddPeerResponseMessage
|
||||
54, // 54: protowire.KaspadMessage.submitTransactionRequest:type_name -> protowire.SubmitTransactionRequestMessage
|
||||
55, // 55: protowire.KaspadMessage.submitTransactionResponse:type_name -> protowire.SubmitTransactionResponseMessage
|
||||
56, // 56: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||
57, // 57: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||
58, // 58: protowire.KaspadMessage.virtualSelectedParentChainChangedNotification:type_name -> protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||
59, // 59: protowire.KaspadMessage.getBlockRequest:type_name -> protowire.GetBlockRequestMessage
|
||||
60, // 60: protowire.KaspadMessage.getBlockResponse:type_name -> protowire.GetBlockResponseMessage
|
||||
61, // 61: protowire.KaspadMessage.getSubnetworkRequest:type_name -> protowire.GetSubnetworkRequestMessage
|
||||
62, // 62: protowire.KaspadMessage.getSubnetworkResponse:type_name -> protowire.GetSubnetworkResponseMessage
|
||||
63, // 63: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockRequest:type_name -> protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||
64, // 64: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockResponse:type_name -> protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||
65, // 65: protowire.KaspadMessage.getBlocksRequest:type_name -> protowire.GetBlocksRequestMessage
|
||||
66, // 66: protowire.KaspadMessage.getBlocksResponse:type_name -> protowire.GetBlocksResponseMessage
|
||||
67, // 67: protowire.KaspadMessage.getBlockCountRequest:type_name -> protowire.GetBlockCountRequestMessage
|
||||
68, // 68: protowire.KaspadMessage.getBlockCountResponse:type_name -> protowire.GetBlockCountResponseMessage
|
||||
69, // 69: protowire.KaspadMessage.getBlockDagInfoRequest:type_name -> protowire.GetBlockDagInfoRequestMessage
|
||||
70, // 70: protowire.KaspadMessage.getBlockDagInfoResponse:type_name -> protowire.GetBlockDagInfoResponseMessage
|
||||
71, // 71: protowire.KaspadMessage.resolveFinalityConflictRequest:type_name -> protowire.ResolveFinalityConflictRequestMessage
|
||||
72, // 72: protowire.KaspadMessage.resolveFinalityConflictResponse:type_name -> protowire.ResolveFinalityConflictResponseMessage
|
||||
73, // 73: protowire.KaspadMessage.notifyFinalityConflictsRequest:type_name -> protowire.NotifyFinalityConflictsRequestMessage
|
||||
74, // 74: protowire.KaspadMessage.notifyFinalityConflictsResponse:type_name -> protowire.NotifyFinalityConflictsResponseMessage
|
||||
75, // 75: protowire.KaspadMessage.finalityConflictNotification:type_name -> protowire.FinalityConflictNotificationMessage
|
||||
76, // 76: protowire.KaspadMessage.finalityConflictResolvedNotification:type_name -> protowire.FinalityConflictResolvedNotificationMessage
|
||||
77, // 77: protowire.KaspadMessage.getMempoolEntriesRequest:type_name -> protowire.GetMempoolEntriesRequestMessage
|
||||
78, // 78: protowire.KaspadMessage.getMempoolEntriesResponse:type_name -> protowire.GetMempoolEntriesResponseMessage
|
||||
79, // 79: protowire.KaspadMessage.shutDownRequest:type_name -> protowire.ShutDownRequestMessage
|
||||
80, // 80: protowire.KaspadMessage.shutDownResponse:type_name -> protowire.ShutDownResponseMessage
|
||||
81, // 81: protowire.KaspadMessage.getHeadersRequest:type_name -> protowire.GetHeadersRequestMessage
|
||||
82, // 82: protowire.KaspadMessage.getHeadersResponse:type_name -> protowire.GetHeadersResponseMessage
|
||||
83, // 83: protowire.KaspadMessage.notifyUtxosChangedRequest:type_name -> protowire.NotifyUtxosChangedRequestMessage
|
||||
84, // 84: protowire.KaspadMessage.notifyUtxosChangedResponse:type_name -> protowire.NotifyUtxosChangedResponseMessage
|
||||
85, // 85: protowire.KaspadMessage.utxosChangedNotification:type_name -> protowire.UtxosChangedNotificationMessage
|
||||
86, // 86: protowire.KaspadMessage.getUtxosByAddressesRequest:type_name -> protowire.GetUtxosByAddressesRequestMessage
|
||||
87, // 87: protowire.KaspadMessage.getUtxosByAddressesResponse:type_name -> protowire.GetUtxosByAddressesResponseMessage
|
||||
88, // 88: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreRequest:type_name -> protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||
89, // 89: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreResponse:type_name -> protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||
90, // 90: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
91, // 91: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||
92, // 92: protowire.KaspadMessage.virtualSelectedParentBlueScoreChangedNotification:type_name -> protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||
93, // 93: protowire.KaspadMessage.banRequest:type_name -> protowire.BanRequestMessage
|
||||
94, // 94: protowire.KaspadMessage.banResponse:type_name -> protowire.BanResponseMessage
|
||||
95, // 95: protowire.KaspadMessage.unbanRequest:type_name -> protowire.UnbanRequestMessage
|
||||
96, // 96: protowire.KaspadMessage.unbanResponse:type_name -> protowire.UnbanResponseMessage
|
||||
97, // 97: protowire.KaspadMessage.getInfoRequest:type_name -> protowire.GetInfoRequestMessage
|
||||
98, // 98: protowire.KaspadMessage.getInfoResponse:type_name -> protowire.GetInfoResponseMessage
|
||||
99, // 99: protowire.KaspadMessage.stopNotifyingUtxosChangedRequest:type_name -> protowire.StopNotifyingUtxosChangedRequestMessage
|
||||
100, // 100: protowire.KaspadMessage.stopNotifyingUtxosChangedResponse:type_name -> protowire.StopNotifyingUtxosChangedResponseMessage
|
||||
101, // 101: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideRequest:type_name -> protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
102, // 102: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideResponse:type_name -> protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
103, // 103: protowire.KaspadMessage.pruningPointUTXOSetOverrideNotification:type_name -> protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
104, // 104: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideRequest:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
105, // 105: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideResponse:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
106, // 106: protowire.KaspadMessage.estimateNetworkHashesPerSecondRequest:type_name -> protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||
107, // 107: protowire.KaspadMessage.estimateNetworkHashesPerSecondResponse:type_name -> protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||
108, // 108: protowire.KaspadMessage.notifyVirtualDaaScoreChangedRequest:type_name -> protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
109, // 109: protowire.KaspadMessage.notifyVirtualDaaScoreChangedResponse:type_name -> protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
110, // 110: protowire.KaspadMessage.virtualDaaScoreChangedNotification:type_name -> protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
0, // 111: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 112: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 113: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 114: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
113, // [113:115] is the sub-list for method output_type
|
||||
111, // [111:113] is the sub-list for method input_type
|
||||
111, // [111:111] is the sub-list for extension type_name
|
||||
111, // [111:111] is the sub-list for extension extendee
|
||||
0, // [0:111] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_messages_proto_init() }
|
||||
@ -2638,6 +2677,7 @@ func file_messages_proto_init() {
|
||||
(*KaspadMessage_RequestAddresses)(nil),
|
||||
(*KaspadMessage_RequestRelayBlocks)(nil),
|
||||
(*KaspadMessage_RequestTransactions)(nil),
|
||||
(*KaspadMessage_IbdBlock)(nil),
|
||||
(*KaspadMessage_InvRelayBlock)(nil),
|
||||
(*KaspadMessage_InvTransactions)(nil),
|
||||
(*KaspadMessage_Ping)(nil),
|
||||
@ -2647,6 +2687,7 @@ func file_messages_proto_init() {
|
||||
(*KaspadMessage_TransactionNotFound)(nil),
|
||||
(*KaspadMessage_Reject)(nil),
|
||||
(*KaspadMessage_PruningPointUtxoSetChunk)(nil),
|
||||
(*KaspadMessage_RequestIBDBlocks)(nil),
|
||||
(*KaspadMessage_UnexpectedPruningPoint)(nil),
|
||||
(*KaspadMessage_IbdBlockLocator)(nil),
|
||||
(*KaspadMessage_IbdBlockLocatorHighestHash)(nil),
|
||||
@ -2658,11 +2699,11 @@ func file_messages_proto_init() {
|
||||
(*KaspadMessage_RequestBlockBlueWork)(nil),
|
||||
(*KaspadMessage_BlockBlueWork)(nil),
|
||||
(*KaspadMessage_RequestPruningPointAndItsAnticone)(nil),
|
||||
(*KaspadMessage_IbdBlocks)(nil),
|
||||
(*KaspadMessage_RequestNextIbdBlocks)(nil),
|
||||
(*KaspadMessage_DoneIbdBlocks)(nil),
|
||||
(*KaspadMessage_BlockHeaders)(nil),
|
||||
(*KaspadMessage_RequestNextHeaders)(nil),
|
||||
(*KaspadMessage_DoneHeaders)(nil),
|
||||
(*KaspadMessage_RequestPruningPointUTXOSet)(nil),
|
||||
(*KaspadMessage_RequestIbdBlocks)(nil),
|
||||
(*KaspadMessage_RequestHeaders)(nil),
|
||||
(*KaspadMessage_RequestBlockLocator)(nil),
|
||||
(*KaspadMessage_GetCurrentNetworkRequest)(nil),
|
||||
(*KaspadMessage_GetCurrentNetworkResponse)(nil),
|
||||
|
@ -15,6 +15,7 @@ message KaspadMessage {
|
||||
RequestAddressesMessage requestAddresses = 6;
|
||||
RequestRelayBlocksMessage requestRelayBlocks = 10;
|
||||
RequestTransactionsMessage requestTransactions = 12;
|
||||
BlockMessage ibdBlock = 13;
|
||||
InvRelayBlockMessage invRelayBlock = 14;
|
||||
InvTransactionsMessage invTransactions = 15;
|
||||
PingMessage ping = 16;
|
||||
@ -24,6 +25,7 @@ message KaspadMessage {
|
||||
TransactionNotFoundMessage transactionNotFound = 21;
|
||||
RejectMessage reject = 22;
|
||||
PruningPointUtxoSetChunkMessage pruningPointUtxoSetChunk = 25;
|
||||
RequestIBDBlocksMessage requestIBDBlocks = 26;
|
||||
UnexpectedPruningPointMessage unexpectedPruningPoint = 27;
|
||||
IbdBlockLocatorMessage ibdBlockLocator = 30;
|
||||
IbdBlockLocatorHighestHashMessage ibdBlockLocatorHighestHash = 31;
|
||||
@ -35,11 +37,11 @@ message KaspadMessage {
|
||||
RequestBlockBlueWorkMessage requestBlockBlueWork = 38;
|
||||
BlockBlueWorkMessage blockBlueWork = 39;
|
||||
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone = 40;
|
||||
IbdBlocksMessage ibdBlocks = 41;
|
||||
RequestNextIbdBlocksMessage requestNextIbdBlocks = 42;
|
||||
DoneIbdBlocksMessage doneIbdBlocks = 43;
|
||||
BlockHeadersMessage blockHeaders = 41;
|
||||
RequestNextHeadersMessage requestNextHeaders = 42;
|
||||
DoneHeadersMessage DoneHeaders = 43;
|
||||
RequestPruningPointUTXOSetMessage requestPruningPointUTXOSet = 44;
|
||||
RequestIbdBlocksMessage requestIbdBlocks = 45;
|
||||
RequestHeadersMessage requestHeaders = 45;
|
||||
RequestBlockLocatorMessage requestBlockLocator = 46;
|
||||
|
||||
GetCurrentNetworkRequestMessage getCurrentNetworkRequest = 1001;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -86,15 +86,15 @@ message BlockLocatorMessage{
|
||||
repeated Hash hashes = 1;
|
||||
}
|
||||
|
||||
message RequestIbdBlocksMessage{
|
||||
message RequestHeadersMessage{
|
||||
Hash lowHash = 1;
|
||||
Hash highHash = 2;
|
||||
}
|
||||
|
||||
message RequestNextIbdBlocksMessage{
|
||||
message RequestNextHeadersMessage{
|
||||
}
|
||||
|
||||
message DoneIbdBlocksMessage{
|
||||
message DoneHeadersMessage{
|
||||
}
|
||||
|
||||
message RequestRelayBlocksMessage{
|
||||
@ -170,6 +170,10 @@ message RequestNextPruningPointUtxoSetChunkMessage {
|
||||
message DonePruningPointUtxoSetChunksMessage {
|
||||
}
|
||||
|
||||
message RequestIBDBlocksMessage{
|
||||
repeated Hash hashes = 1;
|
||||
}
|
||||
|
||||
message UnexpectedPruningPointMessage{
|
||||
}
|
||||
|
||||
@ -185,8 +189,8 @@ message IbdBlockLocatorHighestHashMessage {
|
||||
message IbdBlockLocatorHighestHashNotFoundMessage {
|
||||
}
|
||||
|
||||
message IbdBlocksMessage {
|
||||
repeated BlockMessage blocks = 1;
|
||||
message BlockHeadersMessage {
|
||||
repeated BlockHeader blockHeaders = 1;
|
||||
}
|
||||
|
||||
message RequestPruningPointAndItsAnticoneMessage {
|
||||
|
@ -0,0 +1,51 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_BlockHeaders) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_BlockHeaders is nil")
|
||||
}
|
||||
blockHeaders, err := x.BlockHeaders.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &appmessage.BlockHeadersMessage{
|
||||
BlockHeaders: blockHeaders,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *BlockHeadersMessage) toAppMessage() ([]*appmessage.MsgBlockHeader, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "BlockHeadersMessage is nil")
|
||||
}
|
||||
blockHeaders := make([]*appmessage.MsgBlockHeader, len(x.BlockHeaders))
|
||||
for i, blockHeader := range x.BlockHeaders {
|
||||
var err error
|
||||
blockHeaders[i], err = blockHeader.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return blockHeaders, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_BlockHeaders) fromAppMessage(blockHeadersMessage *appmessage.BlockHeadersMessage) error {
|
||||
blockHeaders := make([]*BlockHeader, len(blockHeadersMessage.BlockHeaders))
|
||||
for i, blockHeader := range blockHeadersMessage.BlockHeaders {
|
||||
blockHeaders[i] = &BlockHeader{}
|
||||
err := blockHeaders[i].fromAppMessage(blockHeader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
x.BlockHeaders = &BlockHeadersMessage{
|
||||
BlockHeaders: blockHeaders,
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_DoneHeaders) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_DoneHeaders is nil")
|
||||
}
|
||||
return &appmessage.MsgDoneHeaders{}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_DoneHeaders) fromAppMessage(_ *appmessage.MsgDoneHeaders) error {
|
||||
return nil
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_DoneIbdBlocks) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_DoneIBDBlocks is nil")
|
||||
}
|
||||
return &appmessage.MsgDoneIBDBlocks{}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_DoneIbdBlocks) fromAppMessage(_ *appmessage.MsgDoneIBDBlocks) error {
|
||||
return nil
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_IbdBlock) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_IbdBlock is nil")
|
||||
}
|
||||
msgBlock, err := x.IbdBlock.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &appmessage.MsgIBDBlock{MsgBlock: msgBlock}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_IbdBlock) fromAppMessage(msgIBDBlock *appmessage.MsgIBDBlock) error {
|
||||
x.IbdBlock = new(BlockMessage)
|
||||
return x.IbdBlock.fromAppMessage(msgIBDBlock.MsgBlock)
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_IbdBlocks) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_IbdBlocks is nil")
|
||||
}
|
||||
blocks, err := x.IbdBlocks.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &appmessage.IBDBlocksMessage{
|
||||
Blocks: blocks,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *IbdBlocksMessage) toAppMessage() ([]*appmessage.MsgBlock, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "IBDBlocksMessage is nil")
|
||||
}
|
||||
blocks := make([]*appmessage.MsgBlock, len(x.Blocks))
|
||||
for i, block := range x.Blocks {
|
||||
var err error
|
||||
blocks[i], err = block.toAppMessage()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return blocks, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_IbdBlocks) fromAppMessage(ibdBlocksMessage *appmessage.IBDBlocksMessage) error {
|
||||
blocks := make([]*BlockMessage, len(ibdBlocksMessage.Blocks))
|
||||
for i, blockHeader := range ibdBlocksMessage.Blocks {
|
||||
blocks[i] = &BlockMessage{}
|
||||
err := blocks[i].fromAppMessage(blockHeader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
x.IbdBlocks = &IbdBlocksMessage{
|
||||
Blocks: blocks,
|
||||
}
|
||||
return nil
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_RequestHeaders) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestBlockLocator is nil")
|
||||
}
|
||||
lowHash, err := x.RequestHeaders.LowHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
highHash, err := x.RequestHeaders.HighHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &appmessage.MsgRequestHeaders{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
}, nil
|
||||
}
|
||||
func (x *RequestHeadersMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "RequestHeadersMessage is nil")
|
||||
}
|
||||
lowHash, err := x.LowHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
highHash, err := x.HighHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &appmessage.MsgRequestHeaders{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_RequestHeaders) fromAppMessage(msgRequestHeaders *appmessage.MsgRequestHeaders) error {
|
||||
x.RequestHeaders = &RequestHeadersMessage{
|
||||
LowHash: domainHashToProto(msgRequestHeaders.LowHash),
|
||||
HighHash: domainHashToProto(msgRequestHeaders.HighHash),
|
||||
}
|
||||
return nil
|
||||
}
|
@ -5,51 +5,28 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_RequestIbdBlocks) toAppMessage() (appmessage.Message, error) {
|
||||
func (x *KaspadMessage_RequestIBDBlocks) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestIBDBlocks is nil")
|
||||
}
|
||||
lowHash, err := x.RequestIbdBlocks.LowHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
highHash, err := x.RequestIbdBlocks.HighHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &appmessage.MsgRequestIBDBlocks{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
}, nil
|
||||
return x.RequestIBDBlocks.toAppMessage()
|
||||
}
|
||||
|
||||
func (x *RequestIbdBlocksMessage) toAppMessage() (appmessage.Message, error) {
|
||||
func (x *RequestIBDBlocksMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "RequestIBDBlocksMessage is nil")
|
||||
}
|
||||
lowHash, err := x.LowHash.toDomain()
|
||||
hashes, err := protoHashesToDomain(x.Hashes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
highHash, err := x.HighHash.toDomain()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &appmessage.MsgRequestIBDBlocks{
|
||||
LowHash: lowHash,
|
||||
HighHash: highHash,
|
||||
}, nil
|
||||
|
||||
return &appmessage.MsgRequestIBDBlocks{Hashes: hashes}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_RequestIbdBlocks) fromAppMessage(msgRequestmsgRequestIBDBlocks *appmessage.MsgRequestIBDBlocks) error {
|
||||
x.RequestIbdBlocks = &RequestIbdBlocksMessage{
|
||||
LowHash: domainHashToProto(msgRequestmsgRequestIBDBlocks.LowHash),
|
||||
HighHash: domainHashToProto(msgRequestmsgRequestIBDBlocks.HighHash),
|
||||
func (x *KaspadMessage_RequestIBDBlocks) fromAppMessage(msgRequestIBDBlocks *appmessage.MsgRequestIBDBlocks) error {
|
||||
x.RequestIBDBlocks = &RequestIBDBlocksMessage{
|
||||
Hashes: domainHashesToProto(msgRequestIBDBlocks.Hashes),
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -0,0 +1,17 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_RequestNextHeaders) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestNextHeaders is nil")
|
||||
}
|
||||
return &appmessage.MsgRequestNextHeaders{}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_RequestNextHeaders) fromAppMessage(_ *appmessage.MsgRequestNextHeaders) error {
|
||||
return nil
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_RequestNextIbdBlocks) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestNextIBDBlocks is nil")
|
||||
}
|
||||
return &appmessage.MsgRequestNextIBDBlocks{}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_RequestNextIbdBlocks) fromAppMessage(_ *appmessage.MsgRequestNextIBDBlocks) error {
|
||||
return nil
|
||||
}
|
@ -94,21 +94,21 @@ func toP2PPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.MsgRequestIBDBlocks:
|
||||
payload := new(KaspadMessage_RequestIbdBlocks)
|
||||
payload := new(KaspadMessage_RequestIBDBlocks)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.MsgRequestNextIBDBlocks:
|
||||
payload := new(KaspadMessage_RequestNextIbdBlocks)
|
||||
case *appmessage.MsgRequestNextHeaders:
|
||||
payload := new(KaspadMessage_RequestNextHeaders)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.MsgDoneIBDBlocks:
|
||||
payload := new(KaspadMessage_DoneIbdBlocks)
|
||||
case *appmessage.MsgDoneHeaders:
|
||||
payload := new(KaspadMessage_DoneHeaders)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -233,8 +233,8 @@ func toP2PPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.IBDBlocksMessage:
|
||||
payload := new(KaspadMessage_IbdBlocks)
|
||||
case *appmessage.BlockHeadersMessage:
|
||||
payload := new(KaspadMessage_BlockHeaders)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -289,6 +289,20 @@ func toP2PPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.MsgIBDBlock:
|
||||
payload := new(KaspadMessage_IbdBlock)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.MsgRequestHeaders:
|
||||
payload := new(KaspadMessage_RequestHeaders)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user