mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 06:06:49 +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
|
CmdVerAck
|
||||||
CmdRequestAddresses
|
CmdRequestAddresses
|
||||||
CmdAddresses
|
CmdAddresses
|
||||||
CmdRequestIBDBlocks
|
CmdRequestHeaders
|
||||||
CmdBlock
|
CmdBlock
|
||||||
CmdTx
|
CmdTx
|
||||||
CmdPing
|
CmdPing
|
||||||
@ -45,17 +45,17 @@ const (
|
|||||||
CmdRequestRelayBlocks
|
CmdRequestRelayBlocks
|
||||||
CmdInvTransaction
|
CmdInvTransaction
|
||||||
CmdRequestTransactions
|
CmdRequestTransactions
|
||||||
CmdDoneIBDBlocks
|
CmdDoneHeaders
|
||||||
CmdTransactionNotFound
|
CmdTransactionNotFound
|
||||||
CmdReject
|
CmdReject
|
||||||
CmdRequestNextIBDBlocks
|
CmdRequestNextHeaders
|
||||||
CmdRequestPruningPointUTXOSet
|
CmdRequestPruningPointUTXOSet
|
||||||
CmdPruningPointUTXOSetChunk
|
CmdPruningPointUTXOSetChunk
|
||||||
CmdUnexpectedPruningPoint
|
CmdUnexpectedPruningPoint
|
||||||
CmdIBDBlockLocator
|
CmdIBDBlockLocator
|
||||||
CmdIBDBlockLocatorHighestHash
|
CmdIBDBlockLocatorHighestHash
|
||||||
CmdIBDBlockLocatorHighestHashNotFound
|
CmdIBDBlockLocatorHighestHashNotFound
|
||||||
CmdIBDBlocks
|
CmdBlockHeaders
|
||||||
CmdRequestNextPruningPointUTXOSetChunk
|
CmdRequestNextPruningPointUTXOSetChunk
|
||||||
CmdDonePruningPointUTXOSetChunks
|
CmdDonePruningPointUTXOSetChunks
|
||||||
CmdBlockBlueWork
|
CmdBlockBlueWork
|
||||||
@ -63,6 +63,8 @@ const (
|
|||||||
CmdDoneBlocksWithTrustedData
|
CmdDoneBlocksWithTrustedData
|
||||||
CmdRequestPruningPointAndItsAnticone
|
CmdRequestPruningPointAndItsAnticone
|
||||||
CmdRequestBlockBlueWork
|
CmdRequestBlockBlueWork
|
||||||
|
CmdIBDBlock
|
||||||
|
CmdRequestIBDBlocks
|
||||||
|
|
||||||
// rpc
|
// rpc
|
||||||
CmdGetCurrentNetworkRequestMessage
|
CmdGetCurrentNetworkRequestMessage
|
||||||
@ -150,7 +152,7 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
|||||||
CmdVerAck: "VerAck",
|
CmdVerAck: "VerAck",
|
||||||
CmdRequestAddresses: "RequestAddresses",
|
CmdRequestAddresses: "RequestAddresses",
|
||||||
CmdAddresses: "Addresses",
|
CmdAddresses: "Addresses",
|
||||||
CmdRequestIBDBlocks: "CmdRequestIBDBlocks",
|
CmdRequestHeaders: "CmdRequestHeaders",
|
||||||
CmdBlock: "Block",
|
CmdBlock: "Block",
|
||||||
CmdTx: "Tx",
|
CmdTx: "Tx",
|
||||||
CmdPing: "Ping",
|
CmdPing: "Ping",
|
||||||
@ -161,17 +163,17 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
|||||||
CmdRequestRelayBlocks: "RequestRelayBlocks",
|
CmdRequestRelayBlocks: "RequestRelayBlocks",
|
||||||
CmdInvTransaction: "InvTransaction",
|
CmdInvTransaction: "InvTransaction",
|
||||||
CmdRequestTransactions: "RequestTransactions",
|
CmdRequestTransactions: "RequestTransactions",
|
||||||
CmdDoneIBDBlocks: "DoneIBDBlocks",
|
CmdDoneHeaders: "DoneHeaders",
|
||||||
CmdTransactionNotFound: "TransactionNotFound",
|
CmdTransactionNotFound: "TransactionNotFound",
|
||||||
CmdReject: "Reject",
|
CmdReject: "Reject",
|
||||||
CmdRequestNextIBDBlocks: "RequestNextIBDBlocks",
|
CmdRequestNextHeaders: "RequestNextHeaders",
|
||||||
CmdRequestPruningPointUTXOSet: "RequestPruningPointUTXOSet",
|
CmdRequestPruningPointUTXOSet: "RequestPruningPointUTXOSet",
|
||||||
CmdPruningPointUTXOSetChunk: "PruningPointUTXOSetChunk",
|
CmdPruningPointUTXOSetChunk: "PruningPointUTXOSetChunk",
|
||||||
CmdUnexpectedPruningPoint: "UnexpectedPruningPoint",
|
CmdUnexpectedPruningPoint: "UnexpectedPruningPoint",
|
||||||
CmdIBDBlockLocator: "IBDBlockLocator",
|
CmdIBDBlockLocator: "IBDBlockLocator",
|
||||||
CmdIBDBlockLocatorHighestHash: "IBDBlockLocatorHighestHash",
|
CmdIBDBlockLocatorHighestHash: "IBDBlockLocatorHighestHash",
|
||||||
CmdIBDBlockLocatorHighestHashNotFound: "IBDBlockLocatorHighestHashNotFound",
|
CmdIBDBlockLocatorHighestHashNotFound: "IBDBlockLocatorHighestHashNotFound",
|
||||||
CmdIBDBlocks: "IBDBlocks",
|
CmdBlockHeaders: "BlockHeaders",
|
||||||
CmdRequestNextPruningPointUTXOSetChunk: "RequestNextPruningPointUTXOSetChunk",
|
CmdRequestNextPruningPointUTXOSetChunk: "RequestNextPruningPointUTXOSetChunk",
|
||||||
CmdDonePruningPointUTXOSetChunks: "DonePruningPointUTXOSetChunks",
|
CmdDonePruningPointUTXOSetChunks: "DonePruningPointUTXOSetChunks",
|
||||||
CmdBlockBlueWork: "BlockBlueWork",
|
CmdBlockBlueWork: "BlockBlueWork",
|
||||||
@ -179,6 +181,8 @@ var ProtocolMessageCommandToString = map[MessageCommand]string{
|
|||||||
CmdDoneBlocksWithTrustedData: "DoneBlocksWithTrustedData",
|
CmdDoneBlocksWithTrustedData: "DoneBlocksWithTrustedData",
|
||||||
CmdRequestPruningPointAndItsAnticone: "RequestPruningPointAndItsAnticoneHeaders",
|
CmdRequestPruningPointAndItsAnticone: "RequestPruningPointAndItsAnticoneHeaders",
|
||||||
CmdRequestBlockBlueWork: "RequestBlockBlueWork",
|
CmdRequestBlockBlueWork: "RequestBlockBlueWork",
|
||||||
|
CmdIBDBlock: "IBDBlock",
|
||||||
|
CmdRequestIBDBlocks: "RequestIBDBlocks",
|
||||||
}
|
}
|
||||||
|
|
||||||
// RPCMessageCommandToString maps all MessageCommands to their string representation
|
// 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.
|
// Ensure we get the same data back out.
|
||||||
msg := NewMsgRequstIBDBlocks(lowHash, highHash)
|
msg := NewMsgRequstHeaders(lowHash, highHash)
|
||||||
if !msg.HighHash.Equal(highHash) {
|
if !msg.HighHash.Equal(highHash) {
|
||||||
t.Errorf("NewMsgRequstIBDBlocks: wrong high hash - got %v, want %v",
|
t.Errorf("NewMsgRequstIBDBlocks: wrong high hash - got %v, want %v",
|
||||||
msg.HighHash, highHash)
|
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
|
package appmessage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -9,12 +5,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// MsgRequestIBDBlocks implements the Message interface and represents a kaspa
|
// MsgRequestIBDBlocks implements the Message interface and represents a kaspa
|
||||||
// RequestIBDBlocks message. It is used to request a list of blocks starting after the
|
// RequestIBDBlocks message. It is used to request blocks as part of the IBD
|
||||||
// low hash and until the high hash.
|
// protocol.
|
||||||
type MsgRequestIBDBlocks struct {
|
type MsgRequestIBDBlocks struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
LowHash *externalapi.DomainHash
|
Hashes []*externalapi.DomainHash
|
||||||
HighHash *externalapi.DomainHash
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command returns the protocol command string for the message. This is part
|
// Command returns the protocol command string for the message. This is part
|
||||||
@ -23,12 +18,9 @@ func (msg *MsgRequestIBDBlocks) Command() MessageCommand {
|
|||||||
return CmdRequestIBDBlocks
|
return CmdRequestIBDBlocks
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgRequstIBDBlocks returns a new kaspa RequestIBDBlocks message that conforms to the
|
// NewMsgRequestIBDBlocks returns a new MsgRequestIBDBlocks.
|
||||||
// Message interface using the passed parameters and defaults for the remaining
|
func NewMsgRequestIBDBlocks(hashes []*externalapi.DomainHash) *MsgRequestIBDBlocks {
|
||||||
// fields.
|
|
||||||
func NewMsgRequstIBDBlocks(lowHash, highHash *externalapi.DomainHash) *MsgRequestIBDBlocks {
|
|
||||||
return &MsgRequestIBDBlocks{
|
return &MsgRequestIBDBlocks{
|
||||||
LowHash: lowHash,
|
Hashes: hashes,
|
||||||
HighHash: highHash,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err = flow.syncPruningPointFuture(flow.Domain().Consensus(), highestSharedBlockHash, highHash, true)
|
err = flow.syncPruningPointFutureHeaders(flow.Domain().Consensus(), highestSharedBlockHash, highHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = flow.syncMissingBlockBodies(highHash)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
log.Debugf("Finished syncing blocks up to %s", highHash)
|
log.Debugf("Finished syncing blocks up to %s", highHash)
|
||||||
isFinishedSuccessfully = true
|
isFinishedSuccessfully = true
|
||||||
return nil
|
return nil
|
||||||
@ -190,36 +195,36 @@ func (flow *handleRelayInvsFlow) fetchHighestHash(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Consensus, highestSharedBlockHash *externalapi.DomainHash,
|
func (flow *handleRelayInvsFlow) syncPruningPointFutureHeaders(consensus externalapi.Consensus, highestSharedBlockHash *externalapi.DomainHash,
|
||||||
highHash *externalapi.DomainHash, callOnNewBlock bool) error {
|
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 {
|
if err != nil {
|
||||||
return err
|
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
|
// never a moment when the node is not validating and inserting
|
||||||
// blocks
|
// headers
|
||||||
ibdBlocksMessageChan := make(chan *appmessage.IBDBlocksMessage, 2)
|
blockHeadersMessageChan := make(chan *appmessage.BlockHeadersMessage, 2)
|
||||||
errChan := make(chan error)
|
errChan := make(chan error)
|
||||||
spawn("handleRelayInvsFlow-syncPruningPointFuture", func() {
|
spawn("handleRelayInvsFlow-syncPruningPointFutureHeaders", func() {
|
||||||
for {
|
for {
|
||||||
ibdBlocksMessage, doneIBD, err := flow.receiveIBDBlocks()
|
blockHeadersMessage, doneIBD, err := flow.receiveHeaders()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if doneIBD {
|
if doneIBD {
|
||||||
close(ibdBlocksMessageChan)
|
close(blockHeadersMessageChan)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ibdBlocksMessageChan <- ibdBlocksMessage
|
blockHeadersMessageChan <- blockHeadersMessage
|
||||||
|
|
||||||
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgRequestNextIBDBlocks())
|
err = flow.outgoingRoute.Enqueue(appmessage.NewMsgRequestNextHeaders())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return
|
return
|
||||||
@ -229,7 +234,7 @@ func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Co
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case ibdBlocksMessage, ok := <-ibdBlocksMessageChan:
|
case ibdBlocksMessage, ok := <-blockHeadersMessageChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
// If the highHash has not been received, the peer is misbehaving
|
// If the highHash has not been received, the peer is misbehaving
|
||||||
highHashBlockInfo, err := consensus.GetBlockInfo(highHash)
|
highHashBlockInfo, err := consensus.GetBlockInfo(highHash)
|
||||||
@ -242,8 +247,8 @@ func (flow *handleRelayInvsFlow) syncPruningPointFuture(consensus externalapi.Co
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
for _, block := range ibdBlocksMessage.Blocks {
|
for _, block := range ibdBlocksMessage.BlockHeaders {
|
||||||
err = flow.processIBDBlock(consensus, block, callOnNewBlock)
|
err = flow.processHeader(consensus, block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
peerSelectedTipHash *externalapi.DomainHash) error {
|
||||||
|
|
||||||
msgGetBlockInvs := appmessage.NewMsgRequstIBDBlocks(highestSharedBlockHash, peerSelectedTipHash)
|
msgGetBlockInvs := appmessage.NewMsgRequstHeaders(highestSharedBlockHash, peerSelectedTipHash)
|
||||||
return flow.outgoingRoute.Enqueue(msgGetBlockInvs)
|
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)
|
message, err := flow.dequeueIncomingMessageAndSkipInvs(common.DefaultTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
switch message := message.(type) {
|
switch message := message.(type) {
|
||||||
case *appmessage.IBDBlocksMessage:
|
case *appmessage.BlockHeadersMessage:
|
||||||
return message, false, nil
|
return message, false, nil
|
||||||
case *appmessage.MsgDoneIBDBlocks:
|
case *appmessage.MsgDoneHeaders:
|
||||||
return nil, true, nil
|
return nil, true, nil
|
||||||
default:
|
default:
|
||||||
return nil, false,
|
return nil, false,
|
||||||
protocolerrors.Errorf(true, "received unexpected message type. "+
|
protocolerrors.Errorf(true, "received unexpected message type. "+
|
||||||
"expected: %s or %s, got: %s",
|
"expected: %s or %s, got: %s",
|
||||||
appmessage.CmdIBDBlocks,
|
appmessage.CmdBlockHeaders,
|
||||||
appmessage.CmdDoneIBDBlocks,
|
appmessage.CmdDoneHeaders,
|
||||||
message.Command())
|
message.Command())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (flow *handleRelayInvsFlow) processIBDBlock(consensus externalapi.Consensus, msgBlock *appmessage.MsgBlock, callOnNewBlock bool) error {
|
func (flow *handleRelayInvsFlow) processHeader(consensus externalapi.Consensus, msgBlockHeader *appmessage.MsgBlockHeader) error {
|
||||||
block := appmessage.MsgBlockToDomainBlock(msgBlock)
|
header := appmessage.BlockHeaderToDomainBlockHeader(msgBlockHeader)
|
||||||
|
block := &externalapi.DomainBlock{
|
||||||
|
Header: header,
|
||||||
|
Transactions: nil,
|
||||||
|
}
|
||||||
|
|
||||||
blockHash := consensushashing.BlockHash(block)
|
blockHash := consensushashing.BlockHash(block)
|
||||||
blockInfo, err := flow.Domain().Consensus().GetBlockInfo(blockHash)
|
blockInfo, err := consensus.GetBlockInfo(blockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if blockInfo.Exists {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
blockInsertionResult, err := consensus.ValidateAndInsertBlock(block, false)
|
_, err = consensus.ValidateAndInsertBlock(block, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !errors.As(err, &ruleerrors.RuleError{}) {
|
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) {
|
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 {
|
} else {
|
||||||
log.Infof("Rejected block %s from %s during IBD: %s", blockHash, flow.peer, err)
|
log.Infof("Rejected block header %s from %s during IBD: %s", blockHash, flow.peer, err)
|
||||||
return protocolerrors.Wrapf(true, err, "got invalid block %s during IBD", blockHash)
|
return protocolerrors.Wrapf(true, err, "got invalid block header %s during IBD", blockHash)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if callOnNewBlock {
|
|
||||||
err := flow.OnNewBlock(block, blockInsertionResult)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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
|
// dequeueIncomingMessageAndSkipInvs is a convenience method to be used during
|
||||||
// IBD. Inv messages are expected to arrive at any given moment, but should be
|
// IBD. Inv messages are expected to arrive at any given moment, but should be
|
||||||
// ignored while we're in IBD
|
// ignored while we're in IBD
|
||||||
|
@ -16,7 +16,7 @@ func (flow *handleRelayInvsFlow) ibdWithHeadersProof(highHash *externalapi.Domai
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = flow.downloadBlocksAndPruningUTXOSet(flow.Domain().StagingConsensus(), highHash)
|
err = flow.downloadHeadersAndPruningUTXOSet(flow.Domain().StagingConsensus(), highHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !flow.IsRecoverableError(err) {
|
if !flow.IsRecoverableError(err) {
|
||||||
return err
|
return err
|
||||||
@ -93,7 +93,7 @@ func (flow *handleRelayInvsFlow) downloadHeadersProof() error {
|
|||||||
return nil
|
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()
|
err := flow.downloadHeadersProof()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -104,7 +104,13 @@ func (flow *handleRelayInvsFlow) downloadBlocksAndPruningUTXOSet(consensus exter
|
|||||||
return err
|
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 {
|
if err != nil {
|
||||||
return err
|
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{
|
m.registerFlow("HandleRelayInvs", router, []appmessage.MessageCommand{
|
||||||
appmessage.CmdInvRelayBlock, appmessage.CmdBlock, appmessage.CmdBlockLocator, appmessage.CmdBlockBlueWork,
|
appmessage.CmdInvRelayBlock, appmessage.CmdBlock, appmessage.CmdBlockLocator, appmessage.CmdBlockBlueWork,
|
||||||
appmessage.CmdDoneIBDBlocks, appmessage.CmdUnexpectedPruningPoint, appmessage.CmdPruningPointUTXOSetChunk,
|
appmessage.CmdDoneHeaders, appmessage.CmdUnexpectedPruningPoint, appmessage.CmdPruningPointUTXOSetChunk,
|
||||||
appmessage.CmdIBDBlocks, appmessage.CmdIBDBlockLocatorHighestHash, appmessage.CmdBlockWithTrustedData,
|
appmessage.CmdBlockHeaders, appmessage.CmdIBDBlockLocatorHighestHash, appmessage.CmdBlockWithTrustedData,
|
||||||
appmessage.CmdDoneBlocksWithTrustedData, appmessage.CmdIBDBlockLocatorHighestHashNotFound,
|
appmessage.CmdDoneBlocksWithTrustedData, appmessage.CmdIBDBlockLocatorHighestHashNotFound,
|
||||||
appmessage.CmdDonePruningPointUTXOSetChunks,
|
appmessage.CmdDonePruningPointUTXOSetChunks, appmessage.CmdIBDBlock,
|
||||||
},
|
},
|
||||||
isStopping, errChan, func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
isStopping, errChan, func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
||||||
return blockrelay.HandleRelayInvs(m.context, incomingRoute,
|
return blockrelay.HandleRelayInvs(m.context, incomingRoute,
|
||||||
@ -193,10 +193,17 @@ func (m *Manager) registerBlockRelayFlows(router *routerpkg.Router, isStopping *
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
m.registerFlow("HandleRequestIBDBlocks", router,
|
m.registerFlow("HandleRequestHeaders", router,
|
||||||
[]appmessage.MessageCommand{appmessage.CmdRequestIBDBlocks, appmessage.CmdRequestNextIBDBlocks}, isStopping, errChan,
|
[]appmessage.MessageCommand{appmessage.CmdRequestHeaders, appmessage.CmdRequestNextHeaders}, isStopping, errChan,
|
||||||
func(incomingRoute *routerpkg.Route, peer *peerpkg.Peer) error {
|
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)
|
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,
|
func (s *consensus) GetPruningPointUTXOs(expectedPruningPointHash *externalapi.DomainHash,
|
||||||
fromOutpoint *externalapi.DomainOutpoint, limit int) ([]*externalapi.OutpointAndUTXOEntryPair, error) {
|
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) {
|
func (s *consensus) PopulateMass(transaction *externalapi.DomainTransaction) {
|
||||||
s.transactionValidator.PopulateMass(transaction)
|
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())
|
pruningWindowSizePlusFinalityDepthForCache := int(config.PruningDepth() + config.FinalityDepth())
|
||||||
|
|
||||||
// Data Structures
|
// Data Structures
|
||||||
daaWindowStore := daawindowstore.New(dbPrefix, 200, preallocateCaches)
|
daaWindowStore := daawindowstore.New(dbPrefix, 10_000, preallocateCaches)
|
||||||
acceptanceDataStore := acceptancedatastore.New(dbPrefix, 200, preallocateCaches)
|
acceptanceDataStore := acceptancedatastore.New(dbPrefix, 200, preallocateCaches)
|
||||||
blockStore, err := blockstore.New(dbManager, dbPrefix, 200, preallocateCaches)
|
blockStore, err := blockstore.New(dbManager, dbPrefix, 200, preallocateCaches)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -16,6 +16,7 @@ type Consensus interface {
|
|||||||
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
||||||
|
|
||||||
GetHashesBetween(lowHash, highHash *DomainHash, maxBlocks uint64) (hashes []*DomainHash, actualHighHash *DomainHash, err 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)
|
GetPruningPointUTXOs(expectedPruningPointHash *DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||||
GetVirtualUTXOs(expectedVirtualParents []*DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
GetVirtualUTXOs(expectedVirtualParents []*DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||||
PruningPoint() (*DomainHash, error)
|
PruningPoint() (*DomainHash, error)
|
||||||
@ -38,4 +39,5 @@ type Consensus interface {
|
|||||||
Anticone(blockHash *DomainHash) ([]*DomainHash, error)
|
Anticone(blockHash *DomainHash) ([]*DomainHash, error)
|
||||||
EstimateNetworkHashesPerSecond(startHash *DomainHash, windowSize int) (uint64, error)
|
EstimateNetworkHashesPerSecond(startHash *DomainHash, windowSize int) (uint64, error)
|
||||||
PopulateMass(transaction *DomainTransaction)
|
PopulateMass(transaction *DomainTransaction)
|
||||||
|
ResolveVirtual() error
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,5 @@ type ConsensusStateManager interface {
|
|||||||
GetVirtualSelectedParentChainFromBlock(stagingArea *StagingArea, blockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error)
|
GetVirtualSelectedParentChainFromBlock(stagingArea *StagingArea, blockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error)
|
||||||
RecoverUTXOIfRequired() error
|
RecoverUTXOIfRequired() error
|
||||||
ReverseUTXODiffs(tipHash *externalapi.DomainHash, reversalData *UTXODiffReversalData) 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 {
|
type SyncManager interface {
|
||||||
GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (
|
GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (
|
||||||
hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error)
|
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) (
|
CreateBlockLocator(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, limit uint32) (
|
||||||
externalapi.BlockLocator, error)
|
externalapi.BlockLocator, error)
|
||||||
CreateHeadersSelectedChainBlockLocator(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash) (
|
CreateHeadersSelectedChainBlockLocator(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash) (
|
||||||
|
@ -60,12 +60,12 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
|||||||
t.Fatalf("PruningPoint: %+v", err)
|
t.Fatalf("PruningPoint: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
missingBlocksHashes, _, err := tcSyncer.GetHashesBetween(pruningPoint, syncerVirtualSelectedParent, math.MaxUint64)
|
missingHeaderHashes, _, err := tcSyncer.GetHashesBetween(pruningPoint, syncerVirtualSelectedParent, math.MaxUint64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("GetHashesBetween: %+v", err)
|
t.Fatalf("GetHashesBetween: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, blocksHash := range missingBlocksHashes {
|
for _, blocksHash := range missingHeaderHashes {
|
||||||
blockInfo, err := tcSyncee.GetBlockInfo(blocksHash)
|
blockInfo, err := tcSyncee.GetBlockInfo(blocksHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("GetBlockInfo: %+v", err)
|
t.Fatalf("GetBlockInfo: %+v", err)
|
||||||
@ -75,12 +75,12 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
block, err := tcSyncer.GetBlock(blocksHash)
|
header, err := tcSyncer.GetBlockHeader(blocksHash)
|
||||||
if err != nil {
|
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 {
|
if err != nil {
|
||||||
t.Fatalf("ValidateAndInsertBlock: %+v", err)
|
t.Fatalf("ValidateAndInsertBlock: %+v", err)
|
||||||
}
|
}
|
||||||
@ -136,6 +136,42 @@ func TestValidateAndInsertImportedPruningPoint(t *testing.T) {
|
|||||||
t.Fatalf("ValidateAndInsertImportedPruningPoint: %+v", err)
|
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()
|
synceeTips, err := tcSyncee.Tips()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Tips: %+v", err)
|
t.Fatalf("Tips: %+v", err)
|
||||||
|
@ -124,42 +124,8 @@ func (csm *consensusStateManager) importPruningPoint(
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = csm.setPruningPointSelectedChildAsTheOnlyParentOfTheVirtual(stagingArea)
|
// Run update virtual to create acceptance data and any other missing data.
|
||||||
if err != nil {
|
_, _, err = csm.updateVirtual(stagingArea, newPruningPoint, []*externalapi.DomainHash{newPruningPoint})
|
||||||
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})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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()
|
// Now go over the rest of the blocks and assign for every block Bi.UTXODiff = Bi+1.UTXODiff.Reversed()
|
||||||
for i := 1; ; i++ {
|
for i := 1; ; i++ {
|
||||||
currentBlock := previousBlockGHOSTDAGData.SelectedParent()
|
currentBlock := previousBlockGHOSTDAGData.SelectedParent()
|
||||||
|
log.Debugf("Reversing UTXO diff for %s", currentBlock)
|
||||||
|
|
||||||
currentBlockUTXODiffChild, err := csm.utxoDiffStore.UTXODiffChild(csm.databaseContext, readStagingArea, currentBlock)
|
currentBlockUTXODiffChild, err := csm.utxoDiffStore.UTXODiffChild(csm.databaseContext, readStagingArea, currentBlock)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -31,45 +31,7 @@ func (csm *consensusStateManager) updateVirtual(stagingArea *model.StagingArea,
|
|||||||
}
|
}
|
||||||
log.Debugf("Picked virtual parents: %s", virtualParents)
|
log.Debugf("Picked virtual parents: %s", virtualParents)
|
||||||
|
|
||||||
err = csm.dagTopologyManager.SetParents(stagingArea, model.VirtualBlockHash, virtualParents)
|
virtualUTXODiff, err := csm.updateVirtualWithParents(stagingArea, 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)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
@ -94,6 +56,54 @@ func (csm *consensusStateManager) updateVirtual(stagingArea *model.StagingArea,
|
|||||||
return selectedParentChainChanges, virtualUTXODiff, nil
|
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(
|
func (csm *consensusStateManager) updateSelectedTipUTXODiff(
|
||||||
stagingArea *model.StagingArea, virtualUTXODiff externalapi.UTXODiff) error {
|
stagingArea *model.StagingArea, virtualUTXODiff externalapi.UTXODiff) error {
|
||||||
|
|
||||||
|
@ -113,6 +113,70 @@ func (sm *syncManager) findLowHashInHighHashSelectedParentChain(stagingArea *mod
|
|||||||
return lowHash, nil
|
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) {
|
func (sm *syncManager) isHeaderOnlyBlock(stagingArea *model.StagingArea, blockHash *externalapi.DomainHash) (bool, error) {
|
||||||
exists, err := sm.blockStatusStore.Exists(sm.databaseContext, stagingArea, blockHash)
|
exists, err := sm.blockStatusStore.Exists(sm.databaseContext, stagingArea, blockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -69,6 +69,13 @@ func (sm *syncManager) GetHashesBetween(stagingArea *model.StagingArea, lowHash,
|
|||||||
return sm.antiPastHashesBetween(stagingArea, lowHash, highHash, maxBlocks)
|
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,
|
func (sm *syncManager) CreateBlockLocator(stagingArea *model.StagingArea,
|
||||||
lowHash, highHash *externalapi.DomainHash, limit uint32) (externalapi.BlockLocator, error) {
|
lowHash, highHash *externalapi.DomainHash, limit uint32) (externalapi.BlockLocator, error) {
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ type KaspadMessage struct {
|
|||||||
// *KaspadMessage_RequestAddresses
|
// *KaspadMessage_RequestAddresses
|
||||||
// *KaspadMessage_RequestRelayBlocks
|
// *KaspadMessage_RequestRelayBlocks
|
||||||
// *KaspadMessage_RequestTransactions
|
// *KaspadMessage_RequestTransactions
|
||||||
|
// *KaspadMessage_IbdBlock
|
||||||
// *KaspadMessage_InvRelayBlock
|
// *KaspadMessage_InvRelayBlock
|
||||||
// *KaspadMessage_InvTransactions
|
// *KaspadMessage_InvTransactions
|
||||||
// *KaspadMessage_Ping
|
// *KaspadMessage_Ping
|
||||||
@ -47,6 +48,7 @@ type KaspadMessage struct {
|
|||||||
// *KaspadMessage_TransactionNotFound
|
// *KaspadMessage_TransactionNotFound
|
||||||
// *KaspadMessage_Reject
|
// *KaspadMessage_Reject
|
||||||
// *KaspadMessage_PruningPointUtxoSetChunk
|
// *KaspadMessage_PruningPointUtxoSetChunk
|
||||||
|
// *KaspadMessage_RequestIBDBlocks
|
||||||
// *KaspadMessage_UnexpectedPruningPoint
|
// *KaspadMessage_UnexpectedPruningPoint
|
||||||
// *KaspadMessage_IbdBlockLocator
|
// *KaspadMessage_IbdBlockLocator
|
||||||
// *KaspadMessage_IbdBlockLocatorHighestHash
|
// *KaspadMessage_IbdBlockLocatorHighestHash
|
||||||
@ -58,11 +60,11 @@ type KaspadMessage struct {
|
|||||||
// *KaspadMessage_RequestBlockBlueWork
|
// *KaspadMessage_RequestBlockBlueWork
|
||||||
// *KaspadMessage_BlockBlueWork
|
// *KaspadMessage_BlockBlueWork
|
||||||
// *KaspadMessage_RequestPruningPointAndItsAnticone
|
// *KaspadMessage_RequestPruningPointAndItsAnticone
|
||||||
// *KaspadMessage_IbdBlocks
|
// *KaspadMessage_BlockHeaders
|
||||||
// *KaspadMessage_RequestNextIbdBlocks
|
// *KaspadMessage_RequestNextHeaders
|
||||||
// *KaspadMessage_DoneIbdBlocks
|
// *KaspadMessage_DoneHeaders
|
||||||
// *KaspadMessage_RequestPruningPointUTXOSet
|
// *KaspadMessage_RequestPruningPointUTXOSet
|
||||||
// *KaspadMessage_RequestIbdBlocks
|
// *KaspadMessage_RequestHeaders
|
||||||
// *KaspadMessage_RequestBlockLocator
|
// *KaspadMessage_RequestBlockLocator
|
||||||
// *KaspadMessage_GetCurrentNetworkRequest
|
// *KaspadMessage_GetCurrentNetworkRequest
|
||||||
// *KaspadMessage_GetCurrentNetworkResponse
|
// *KaspadMessage_GetCurrentNetworkResponse
|
||||||
@ -231,6 +233,13 @@ func (x *KaspadMessage) GetRequestTransactions() *RequestTransactionsMessage {
|
|||||||
return nil
|
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 {
|
func (x *KaspadMessage) GetInvRelayBlock() *InvRelayBlockMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_InvRelayBlock); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_InvRelayBlock); ok {
|
||||||
return x.InvRelayBlock
|
return x.InvRelayBlock
|
||||||
@ -294,6 +303,13 @@ func (x *KaspadMessage) GetPruningPointUtxoSetChunk() *PruningPointUtxoSetChunkM
|
|||||||
return nil
|
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 {
|
func (x *KaspadMessage) GetUnexpectedPruningPoint() *UnexpectedPruningPointMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_UnexpectedPruningPoint); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_UnexpectedPruningPoint); ok {
|
||||||
return x.UnexpectedPruningPoint
|
return x.UnexpectedPruningPoint
|
||||||
@ -371,23 +387,23 @@ func (x *KaspadMessage) GetRequestPruningPointAndItsAnticone() *RequestPruningPo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *KaspadMessage) GetIbdBlocks() *IbdBlocksMessage {
|
func (x *KaspadMessage) GetBlockHeaders() *BlockHeadersMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_IbdBlocks); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_BlockHeaders); ok {
|
||||||
return x.IbdBlocks
|
return x.BlockHeaders
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *KaspadMessage) GetRequestNextIbdBlocks() *RequestNextIbdBlocksMessage {
|
func (x *KaspadMessage) GetRequestNextHeaders() *RequestNextHeadersMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestNextIbdBlocks); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_RequestNextHeaders); ok {
|
||||||
return x.RequestNextIbdBlocks
|
return x.RequestNextHeaders
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *KaspadMessage) GetDoneIbdBlocks() *DoneIbdBlocksMessage {
|
func (x *KaspadMessage) GetDoneHeaders() *DoneHeadersMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_DoneIbdBlocks); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_DoneHeaders); ok {
|
||||||
return x.DoneIbdBlocks
|
return x.DoneHeaders
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -399,9 +415,9 @@ func (x *KaspadMessage) GetRequestPruningPointUTXOSet() *RequestPruningPointUTXO
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *KaspadMessage) GetRequestIbdBlocks() *RequestIbdBlocksMessage {
|
func (x *KaspadMessage) GetRequestHeaders() *RequestHeadersMessage {
|
||||||
if x, ok := x.GetPayload().(*KaspadMessage_RequestIbdBlocks); ok {
|
if x, ok := x.GetPayload().(*KaspadMessage_RequestHeaders); ok {
|
||||||
return x.RequestIbdBlocks
|
return x.RequestHeaders
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -977,6 +993,10 @@ type KaspadMessage_RequestTransactions struct {
|
|||||||
RequestTransactions *RequestTransactionsMessage `protobuf:"bytes,12,opt,name=requestTransactions,proto3,oneof"`
|
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 {
|
type KaspadMessage_InvRelayBlock struct {
|
||||||
InvRelayBlock *InvRelayBlockMessage `protobuf:"bytes,14,opt,name=invRelayBlock,proto3,oneof"`
|
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"`
|
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 {
|
type KaspadMessage_UnexpectedPruningPoint struct {
|
||||||
UnexpectedPruningPoint *UnexpectedPruningPointMessage `protobuf:"bytes,27,opt,name=unexpectedPruningPoint,proto3,oneof"`
|
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"`
|
RequestPruningPointAndItsAnticone *RequestPruningPointAndItsAnticoneMessage `protobuf:"bytes,40,opt,name=requestPruningPointAndItsAnticone,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_IbdBlocks struct {
|
type KaspadMessage_BlockHeaders struct {
|
||||||
IbdBlocks *IbdBlocksMessage `protobuf:"bytes,41,opt,name=ibdBlocks,proto3,oneof"`
|
BlockHeaders *BlockHeadersMessage `protobuf:"bytes,41,opt,name=blockHeaders,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_RequestNextIbdBlocks struct {
|
type KaspadMessage_RequestNextHeaders struct {
|
||||||
RequestNextIbdBlocks *RequestNextIbdBlocksMessage `protobuf:"bytes,42,opt,name=requestNextIbdBlocks,proto3,oneof"`
|
RequestNextHeaders *RequestNextHeadersMessage `protobuf:"bytes,42,opt,name=requestNextHeaders,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_DoneIbdBlocks struct {
|
type KaspadMessage_DoneHeaders struct {
|
||||||
DoneIbdBlocks *DoneIbdBlocksMessage `protobuf:"bytes,43,opt,name=doneIbdBlocks,proto3,oneof"`
|
DoneHeaders *DoneHeadersMessage `protobuf:"bytes,43,opt,name=DoneHeaders,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_RequestPruningPointUTXOSet struct {
|
type KaspadMessage_RequestPruningPointUTXOSet struct {
|
||||||
RequestPruningPointUTXOSet *RequestPruningPointUTXOSetMessage `protobuf:"bytes,44,opt,name=requestPruningPointUTXOSet,proto3,oneof"`
|
RequestPruningPointUTXOSet *RequestPruningPointUTXOSetMessage `protobuf:"bytes,44,opt,name=requestPruningPointUTXOSet,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_RequestIbdBlocks struct {
|
type KaspadMessage_RequestHeaders struct {
|
||||||
RequestIbdBlocks *RequestIbdBlocksMessage `protobuf:"bytes,45,opt,name=requestIbdBlocks,proto3,oneof"`
|
RequestHeaders *RequestHeadersMessage `protobuf:"bytes,45,opt,name=requestHeaders,proto3,oneof"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KaspadMessage_RequestBlockLocator struct {
|
type KaspadMessage_RequestBlockLocator struct {
|
||||||
@ -1399,6 +1423,8 @@ func (*KaspadMessage_RequestRelayBlocks) isKaspadMessage_Payload() {}
|
|||||||
|
|
||||||
func (*KaspadMessage_RequestTransactions) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_RequestTransactions) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
|
func (*KaspadMessage_IbdBlock) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_InvRelayBlock) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_InvRelayBlock) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_InvTransactions) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_InvTransactions) isKaspadMessage_Payload() {}
|
||||||
@ -1417,6 +1443,8 @@ func (*KaspadMessage_Reject) isKaspadMessage_Payload() {}
|
|||||||
|
|
||||||
func (*KaspadMessage_PruningPointUtxoSetChunk) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_PruningPointUtxoSetChunk) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
|
func (*KaspadMessage_RequestIBDBlocks) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_UnexpectedPruningPoint) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_UnexpectedPruningPoint) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_IbdBlockLocator) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_IbdBlockLocator) isKaspadMessage_Payload() {}
|
||||||
@ -1439,15 +1467,15 @@ func (*KaspadMessage_BlockBlueWork) isKaspadMessage_Payload() {}
|
|||||||
|
|
||||||
func (*KaspadMessage_RequestPruningPointAndItsAnticone) 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_RequestPruningPointUTXOSet) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_RequestIbdBlocks) isKaspadMessage_Payload() {}
|
func (*KaspadMessage_RequestHeaders) isKaspadMessage_Payload() {}
|
||||||
|
|
||||||
func (*KaspadMessage_RequestBlockLocator) 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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
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,
|
0x35, 0x0a, 0x08, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28,
|
||||||
0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c,
|
||||||
0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 0x69, 0x62,
|
||||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65,
|
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65, 0x6c,
|
||||||
0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x54,
|
0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
|
||||||
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x52, 0x65, 0x6c,
|
||||||
0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e,
|
0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
||||||
0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x73,
|
0x52, 0x0d, 0x69, 0x6e, 0x76, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12,
|
||||||
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73,
|
0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||||
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18,
|
0x6e, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72,
|
0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
||||||
0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52,
|
0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69,
|
||||||
0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x18, 0x11, 0x20,
|
0x6e, 0x76, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70,
|
||||||
0x50, 0x6f, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70,
|
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73,
|
||||||
0x6f, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x18, 0x13, 0x20,
|
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x04,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
0x70, 0x6f, 0x6e, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x56, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52,
|
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x6f, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x35, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
|
0x67, 0x65, 0x48, 0x00, 0x52, 0x04, 0x70, 0x6f, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x06, 0x76, 0x65,
|
||||||
0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x72, 0x61, 0x63, 0x6b, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73,
|
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x4d, 0x65, 0x73,
|
||||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x59,
|
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x76, 0x65, 0x72, 0x61, 0x63, 0x6b, 0x12, 0x35,
|
||||||
0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74,
|
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72,
|
0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x73,
|
||||||
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
|
0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x07, 0x76, 0x65,
|
||||||
0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
|
||||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x15, 0x20, 0x01,
|
||||||
0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a,
|
0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x54,
|
||||||
0x65, 0x63, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75,
|
||||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x13, 0x74, 0x72, 0x61,
|
||||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x68, 0x0a,
|
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64,
|
||||||
0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78,
|
0x12, 0x32, 0x0a, 0x06, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x6a,
|
||||||
0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x75, 0x6e,
|
0x65, 0x63, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65,
|
||||||
0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43,
|
0x6a, 0x65, 0x63, 0x74, 0x12, 0x68, 0x0a, 0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50,
|
||||||
0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x18, 0x70,
|
0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b,
|
||||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53,
|
0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||||
0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x62, 0x0a, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70,
|
0x72, 0x65, 0x2e, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55,
|
||||||
0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e,
|
0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
0x67, 0x65, 0x48, 0x00, 0x52, 0x18, 0x70, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
||||||
0x69, 0x72, 0x65, 0x2e, 0x55, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72,
|
0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x50,
|
||||||
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42, 0x6c, 0x6f, 0x63,
|
||||||
0x65, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50,
|
0x6b, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0f, 0x69,
|
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42,
|
||||||
0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1e,
|
0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x10,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65,
|
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x42, 0x44, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
||||||
0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72,
|
0x12, 0x62, 0x0a, 0x16, 0x75, 0x6e, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72,
|
||||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c,
|
0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b,
|
||||||
0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x6e, 0x0a, 0x1a, 0x69, 0x62,
|
0x32, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x55, 0x6e, 0x65,
|
||||||
0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67,
|
0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f,
|
||||||
0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c,
|
0x69, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x16, 0x75, 0x6e,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c,
|
0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50,
|
||||||
0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73,
|
0x6f, 0x69, 0x6e, 0x74, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x74, 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a,
|
0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
|
||||||
0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f,
|
||||||
0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x89, 0x01, 0x0a, 0x23, 0x72,
|
0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e,
|
0x48, 0x00, 0x52, 0x0f, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||||
0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75,
|
0x74, 0x6f, 0x72, 0x12, 0x6e, 0x0a, 0x1a, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c,
|
||||||
0x6e, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73,
|
||||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74,
|
0x68, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||||
0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x74, 0x78, 0x6f,
|
0x69, 0x72, 0x65, 0x2e, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f, 0x63, 0x61,
|
||||||
0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68, 0x4d, 0x65,
|
||||||
0x00, 0x52, 0x23, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x72,
|
0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63,
|
||||||
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,
|
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,
|
0x61, 0x73, 0x68, 0x12, 0x89, 0x01, 0x0a, 0x23, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e,
|
||||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x22, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x6f,
|
0x65, 0x78, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55,
|
||||||
0x63, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x48, 0x61, 0x73, 0x68,
|
0x74, 0x78, 0x6f, 0x53, 0x65, 0x74, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x21, 0x20, 0x01, 0x28,
|
||||||
0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x5c, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63,
|
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,
|
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,
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73,
|
0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12,
|
||||||
0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
0x6b, 0x0a, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74,
|
||||||
0x52, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74,
|
0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x18, 0x25, 0x20, 0x01,
|
||||||
0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x6b, 0x0a, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c,
|
0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44,
|
||||||
0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44,
|
0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75,
|
||||||
0x61, 0x74, 0x61, 0x18, 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
|
0x00, 0x52, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74,
|
||||||
0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x4d,
|
0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x5c, 0x0a, 0x14,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x19, 0x64, 0x6f, 0x6e, 0x65, 0x42, 0x6c,
|
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65,
|
||||||
0x6f, 0x63, 0x6b, 0x73, 0x57, 0x69, 0x74, 0x68, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x44,
|
0x57, 0x6f, 0x72, 0x6b, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x61, 0x74, 0x61, 0x12, 0x5c, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c,
|
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, 0x18, 0x26, 0x20, 0x01, 0x28,
|
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65,
|
0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x62, 0x6c,
|
||||||
0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71,
|
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x18, 0x27, 0x20, 0x01, 0x28,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72,
|
0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c,
|
||||||
0x6b, 0x12, 0x47, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x72, 0x6b, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57,
|
||||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f,
|
0x6f, 0x72, 0x6b, 0x12, 0x83, 0x01, 0x0a, 0x21, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
||||||
0x72, 0x6b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x6c, 0x6f,
|
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74,
|
||||||
0x63, 0x6b, 0x42, 0x6c, 0x75, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x12, 0x83, 0x01, 0x0a, 0x21, 0x72,
|
0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75,
|
||||||
0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65,
|
0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41,
|
||||||
0x18, 0x28, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x4d, 0x65, 0x73,
|
||||||
0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e,
|
0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x21, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
||||||
0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69,
|
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74,
|
||||||
0x63, 0x6f, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x21, 0x72,
|
0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x62, 0x6c, 0x6f,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69,
|
0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x29, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x6e, 0x74, 0x41, 0x6e, 0x64, 0x49, 0x74, 0x73, 0x41, 0x6e, 0x74, 0x69, 0x63, 0x6f, 0x6e, 0x65,
|
0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63,
|
||||||
0x12, 0x3b, 0x0a, 0x09, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x29, 0x20,
|
0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
0x00, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12,
|
||||||
0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
0x56, 0x0a, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74, 0x48, 0x65,
|
||||||
0x48, 0x00, 0x52, 0x09, 0x69, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x5c, 0x0a,
|
0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x72,
|
||||||
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,
|
|
||||||
0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e,
|
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,
|
0x65, 0x78, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65,
|
0x65, 0x48, 0x00, 0x52, 0x12, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x65, 0x78, 0x74,
|
||||||
0x78, 0x74, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x47, 0x0a, 0x0d, 0x64,
|
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x41, 0x0a, 0x0b, 0x44, 0x6f, 0x6e, 0x65, 0x48,
|
||||||
0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x2b, 0x20, 0x01,
|
0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x2b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70,
|
||||||
0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44,
|
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6e, 0x65, 0x48, 0x65, 0x61,
|
||||||
0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x44,
|
||||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x64, 0x6f, 0x6e, 0x65, 0x49, 0x62, 0x64, 0x42, 0x6c,
|
0x6f, 0x6e, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x6e, 0x0a, 0x1a, 0x72, 0x65,
|
||||||
0x6f, 0x63, 0x6b, 0x73, 0x12, 0x6e, 0x0a, 0x1a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e,
|
||||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53,
|
0x74, 0x55, 0x54, 0x58, 0x4f, 0x53, 0x65, 0x74, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c,
|
||||||
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,
|
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
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,
|
0x73, 0x74, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54,
|
||||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x62, 0x64,
|
0x58, 0x4f, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x1a,
|
||||||
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x59, 0x0a, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
|
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,
|
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,
|
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,
|
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
|
(*TransactionNotFoundMessage)(nil), // 14: protowire.TransactionNotFoundMessage
|
||||||
(*RejectMessage)(nil), // 15: protowire.RejectMessage
|
(*RejectMessage)(nil), // 15: protowire.RejectMessage
|
||||||
(*PruningPointUtxoSetChunkMessage)(nil), // 16: protowire.PruningPointUtxoSetChunkMessage
|
(*PruningPointUtxoSetChunkMessage)(nil), // 16: protowire.PruningPointUtxoSetChunkMessage
|
||||||
(*UnexpectedPruningPointMessage)(nil), // 17: protowire.UnexpectedPruningPointMessage
|
(*RequestIBDBlocksMessage)(nil), // 17: protowire.RequestIBDBlocksMessage
|
||||||
(*IbdBlockLocatorMessage)(nil), // 18: protowire.IbdBlockLocatorMessage
|
(*UnexpectedPruningPointMessage)(nil), // 18: protowire.UnexpectedPruningPointMessage
|
||||||
(*IbdBlockLocatorHighestHashMessage)(nil), // 19: protowire.IbdBlockLocatorHighestHashMessage
|
(*IbdBlockLocatorMessage)(nil), // 19: protowire.IbdBlockLocatorMessage
|
||||||
(*RequestNextPruningPointUtxoSetChunkMessage)(nil), // 20: protowire.RequestNextPruningPointUtxoSetChunkMessage
|
(*IbdBlockLocatorHighestHashMessage)(nil), // 20: protowire.IbdBlockLocatorHighestHashMessage
|
||||||
(*DonePruningPointUtxoSetChunksMessage)(nil), // 21: protowire.DonePruningPointUtxoSetChunksMessage
|
(*RequestNextPruningPointUtxoSetChunkMessage)(nil), // 21: protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||||
(*IbdBlockLocatorHighestHashNotFoundMessage)(nil), // 22: protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
(*DonePruningPointUtxoSetChunksMessage)(nil), // 22: protowire.DonePruningPointUtxoSetChunksMessage
|
||||||
(*BlockWithTrustedDataMessage)(nil), // 23: protowire.BlockWithTrustedDataMessage
|
(*IbdBlockLocatorHighestHashNotFoundMessage)(nil), // 23: protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||||
(*DoneBlocksWithTrustedDataMessage)(nil), // 24: protowire.DoneBlocksWithTrustedDataMessage
|
(*BlockWithTrustedDataMessage)(nil), // 24: protowire.BlockWithTrustedDataMessage
|
||||||
(*RequestBlockBlueWorkMessage)(nil), // 25: protowire.RequestBlockBlueWorkMessage
|
(*DoneBlocksWithTrustedDataMessage)(nil), // 25: protowire.DoneBlocksWithTrustedDataMessage
|
||||||
(*BlockBlueWorkMessage)(nil), // 26: protowire.BlockBlueWorkMessage
|
(*RequestBlockBlueWorkMessage)(nil), // 26: protowire.RequestBlockBlueWorkMessage
|
||||||
(*RequestPruningPointAndItsAnticoneMessage)(nil), // 27: protowire.RequestPruningPointAndItsAnticoneMessage
|
(*BlockBlueWorkMessage)(nil), // 27: protowire.BlockBlueWorkMessage
|
||||||
(*IbdBlocksMessage)(nil), // 28: protowire.IbdBlocksMessage
|
(*RequestPruningPointAndItsAnticoneMessage)(nil), // 28: protowire.RequestPruningPointAndItsAnticoneMessage
|
||||||
(*RequestNextIbdBlocksMessage)(nil), // 29: protowire.RequestNextIbdBlocksMessage
|
(*BlockHeadersMessage)(nil), // 29: protowire.BlockHeadersMessage
|
||||||
(*DoneIbdBlocksMessage)(nil), // 30: protowire.DoneIbdBlocksMessage
|
(*RequestNextHeadersMessage)(nil), // 30: protowire.RequestNextHeadersMessage
|
||||||
(*RequestPruningPointUTXOSetMessage)(nil), // 31: protowire.RequestPruningPointUTXOSetMessage
|
(*DoneHeadersMessage)(nil), // 31: protowire.DoneHeadersMessage
|
||||||
(*RequestIbdBlocksMessage)(nil), // 32: protowire.RequestIbdBlocksMessage
|
(*RequestPruningPointUTXOSetMessage)(nil), // 32: protowire.RequestPruningPointUTXOSetMessage
|
||||||
(*RequestBlockLocatorMessage)(nil), // 33: protowire.RequestBlockLocatorMessage
|
(*RequestHeadersMessage)(nil), // 33: protowire.RequestHeadersMessage
|
||||||
(*GetCurrentNetworkRequestMessage)(nil), // 34: protowire.GetCurrentNetworkRequestMessage
|
(*RequestBlockLocatorMessage)(nil), // 34: protowire.RequestBlockLocatorMessage
|
||||||
(*GetCurrentNetworkResponseMessage)(nil), // 35: protowire.GetCurrentNetworkResponseMessage
|
(*GetCurrentNetworkRequestMessage)(nil), // 35: protowire.GetCurrentNetworkRequestMessage
|
||||||
(*SubmitBlockRequestMessage)(nil), // 36: protowire.SubmitBlockRequestMessage
|
(*GetCurrentNetworkResponseMessage)(nil), // 36: protowire.GetCurrentNetworkResponseMessage
|
||||||
(*SubmitBlockResponseMessage)(nil), // 37: protowire.SubmitBlockResponseMessage
|
(*SubmitBlockRequestMessage)(nil), // 37: protowire.SubmitBlockRequestMessage
|
||||||
(*GetBlockTemplateRequestMessage)(nil), // 38: protowire.GetBlockTemplateRequestMessage
|
(*SubmitBlockResponseMessage)(nil), // 38: protowire.SubmitBlockResponseMessage
|
||||||
(*GetBlockTemplateResponseMessage)(nil), // 39: protowire.GetBlockTemplateResponseMessage
|
(*GetBlockTemplateRequestMessage)(nil), // 39: protowire.GetBlockTemplateRequestMessage
|
||||||
(*NotifyBlockAddedRequestMessage)(nil), // 40: protowire.NotifyBlockAddedRequestMessage
|
(*GetBlockTemplateResponseMessage)(nil), // 40: protowire.GetBlockTemplateResponseMessage
|
||||||
(*NotifyBlockAddedResponseMessage)(nil), // 41: protowire.NotifyBlockAddedResponseMessage
|
(*NotifyBlockAddedRequestMessage)(nil), // 41: protowire.NotifyBlockAddedRequestMessage
|
||||||
(*BlockAddedNotificationMessage)(nil), // 42: protowire.BlockAddedNotificationMessage
|
(*NotifyBlockAddedResponseMessage)(nil), // 42: protowire.NotifyBlockAddedResponseMessage
|
||||||
(*GetPeerAddressesRequestMessage)(nil), // 43: protowire.GetPeerAddressesRequestMessage
|
(*BlockAddedNotificationMessage)(nil), // 43: protowire.BlockAddedNotificationMessage
|
||||||
(*GetPeerAddressesResponseMessage)(nil), // 44: protowire.GetPeerAddressesResponseMessage
|
(*GetPeerAddressesRequestMessage)(nil), // 44: protowire.GetPeerAddressesRequestMessage
|
||||||
(*GetSelectedTipHashRequestMessage)(nil), // 45: protowire.GetSelectedTipHashRequestMessage
|
(*GetPeerAddressesResponseMessage)(nil), // 45: protowire.GetPeerAddressesResponseMessage
|
||||||
(*GetSelectedTipHashResponseMessage)(nil), // 46: protowire.GetSelectedTipHashResponseMessage
|
(*GetSelectedTipHashRequestMessage)(nil), // 46: protowire.GetSelectedTipHashRequestMessage
|
||||||
(*GetMempoolEntryRequestMessage)(nil), // 47: protowire.GetMempoolEntryRequestMessage
|
(*GetSelectedTipHashResponseMessage)(nil), // 47: protowire.GetSelectedTipHashResponseMessage
|
||||||
(*GetMempoolEntryResponseMessage)(nil), // 48: protowire.GetMempoolEntryResponseMessage
|
(*GetMempoolEntryRequestMessage)(nil), // 48: protowire.GetMempoolEntryRequestMessage
|
||||||
(*GetConnectedPeerInfoRequestMessage)(nil), // 49: protowire.GetConnectedPeerInfoRequestMessage
|
(*GetMempoolEntryResponseMessage)(nil), // 49: protowire.GetMempoolEntryResponseMessage
|
||||||
(*GetConnectedPeerInfoResponseMessage)(nil), // 50: protowire.GetConnectedPeerInfoResponseMessage
|
(*GetConnectedPeerInfoRequestMessage)(nil), // 50: protowire.GetConnectedPeerInfoRequestMessage
|
||||||
(*AddPeerRequestMessage)(nil), // 51: protowire.AddPeerRequestMessage
|
(*GetConnectedPeerInfoResponseMessage)(nil), // 51: protowire.GetConnectedPeerInfoResponseMessage
|
||||||
(*AddPeerResponseMessage)(nil), // 52: protowire.AddPeerResponseMessage
|
(*AddPeerRequestMessage)(nil), // 52: protowire.AddPeerRequestMessage
|
||||||
(*SubmitTransactionRequestMessage)(nil), // 53: protowire.SubmitTransactionRequestMessage
|
(*AddPeerResponseMessage)(nil), // 53: protowire.AddPeerResponseMessage
|
||||||
(*SubmitTransactionResponseMessage)(nil), // 54: protowire.SubmitTransactionResponseMessage
|
(*SubmitTransactionRequestMessage)(nil), // 54: protowire.SubmitTransactionRequestMessage
|
||||||
(*NotifyVirtualSelectedParentChainChangedRequestMessage)(nil), // 55: protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
(*SubmitTransactionResponseMessage)(nil), // 55: protowire.SubmitTransactionResponseMessage
|
||||||
(*NotifyVirtualSelectedParentChainChangedResponseMessage)(nil), // 56: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
(*NotifyVirtualSelectedParentChainChangedRequestMessage)(nil), // 56: protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||||
(*VirtualSelectedParentChainChangedNotificationMessage)(nil), // 57: protowire.VirtualSelectedParentChainChangedNotificationMessage
|
(*NotifyVirtualSelectedParentChainChangedResponseMessage)(nil), // 57: protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||||
(*GetBlockRequestMessage)(nil), // 58: protowire.GetBlockRequestMessage
|
(*VirtualSelectedParentChainChangedNotificationMessage)(nil), // 58: protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||||
(*GetBlockResponseMessage)(nil), // 59: protowire.GetBlockResponseMessage
|
(*GetBlockRequestMessage)(nil), // 59: protowire.GetBlockRequestMessage
|
||||||
(*GetSubnetworkRequestMessage)(nil), // 60: protowire.GetSubnetworkRequestMessage
|
(*GetBlockResponseMessage)(nil), // 60: protowire.GetBlockResponseMessage
|
||||||
(*GetSubnetworkResponseMessage)(nil), // 61: protowire.GetSubnetworkResponseMessage
|
(*GetSubnetworkRequestMessage)(nil), // 61: protowire.GetSubnetworkRequestMessage
|
||||||
(*GetVirtualSelectedParentChainFromBlockRequestMessage)(nil), // 62: protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
(*GetSubnetworkResponseMessage)(nil), // 62: protowire.GetSubnetworkResponseMessage
|
||||||
(*GetVirtualSelectedParentChainFromBlockResponseMessage)(nil), // 63: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
(*GetVirtualSelectedParentChainFromBlockRequestMessage)(nil), // 63: protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||||
(*GetBlocksRequestMessage)(nil), // 64: protowire.GetBlocksRequestMessage
|
(*GetVirtualSelectedParentChainFromBlockResponseMessage)(nil), // 64: protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||||
(*GetBlocksResponseMessage)(nil), // 65: protowire.GetBlocksResponseMessage
|
(*GetBlocksRequestMessage)(nil), // 65: protowire.GetBlocksRequestMessage
|
||||||
(*GetBlockCountRequestMessage)(nil), // 66: protowire.GetBlockCountRequestMessage
|
(*GetBlocksResponseMessage)(nil), // 66: protowire.GetBlocksResponseMessage
|
||||||
(*GetBlockCountResponseMessage)(nil), // 67: protowire.GetBlockCountResponseMessage
|
(*GetBlockCountRequestMessage)(nil), // 67: protowire.GetBlockCountRequestMessage
|
||||||
(*GetBlockDagInfoRequestMessage)(nil), // 68: protowire.GetBlockDagInfoRequestMessage
|
(*GetBlockCountResponseMessage)(nil), // 68: protowire.GetBlockCountResponseMessage
|
||||||
(*GetBlockDagInfoResponseMessage)(nil), // 69: protowire.GetBlockDagInfoResponseMessage
|
(*GetBlockDagInfoRequestMessage)(nil), // 69: protowire.GetBlockDagInfoRequestMessage
|
||||||
(*ResolveFinalityConflictRequestMessage)(nil), // 70: protowire.ResolveFinalityConflictRequestMessage
|
(*GetBlockDagInfoResponseMessage)(nil), // 70: protowire.GetBlockDagInfoResponseMessage
|
||||||
(*ResolveFinalityConflictResponseMessage)(nil), // 71: protowire.ResolveFinalityConflictResponseMessage
|
(*ResolveFinalityConflictRequestMessage)(nil), // 71: protowire.ResolveFinalityConflictRequestMessage
|
||||||
(*NotifyFinalityConflictsRequestMessage)(nil), // 72: protowire.NotifyFinalityConflictsRequestMessage
|
(*ResolveFinalityConflictResponseMessage)(nil), // 72: protowire.ResolveFinalityConflictResponseMessage
|
||||||
(*NotifyFinalityConflictsResponseMessage)(nil), // 73: protowire.NotifyFinalityConflictsResponseMessage
|
(*NotifyFinalityConflictsRequestMessage)(nil), // 73: protowire.NotifyFinalityConflictsRequestMessage
|
||||||
(*FinalityConflictNotificationMessage)(nil), // 74: protowire.FinalityConflictNotificationMessage
|
(*NotifyFinalityConflictsResponseMessage)(nil), // 74: protowire.NotifyFinalityConflictsResponseMessage
|
||||||
(*FinalityConflictResolvedNotificationMessage)(nil), // 75: protowire.FinalityConflictResolvedNotificationMessage
|
(*FinalityConflictNotificationMessage)(nil), // 75: protowire.FinalityConflictNotificationMessage
|
||||||
(*GetMempoolEntriesRequestMessage)(nil), // 76: protowire.GetMempoolEntriesRequestMessage
|
(*FinalityConflictResolvedNotificationMessage)(nil), // 76: protowire.FinalityConflictResolvedNotificationMessage
|
||||||
(*GetMempoolEntriesResponseMessage)(nil), // 77: protowire.GetMempoolEntriesResponseMessage
|
(*GetMempoolEntriesRequestMessage)(nil), // 77: protowire.GetMempoolEntriesRequestMessage
|
||||||
(*ShutDownRequestMessage)(nil), // 78: protowire.ShutDownRequestMessage
|
(*GetMempoolEntriesResponseMessage)(nil), // 78: protowire.GetMempoolEntriesResponseMessage
|
||||||
(*ShutDownResponseMessage)(nil), // 79: protowire.ShutDownResponseMessage
|
(*ShutDownRequestMessage)(nil), // 79: protowire.ShutDownRequestMessage
|
||||||
(*GetHeadersRequestMessage)(nil), // 80: protowire.GetHeadersRequestMessage
|
(*ShutDownResponseMessage)(nil), // 80: protowire.ShutDownResponseMessage
|
||||||
(*GetHeadersResponseMessage)(nil), // 81: protowire.GetHeadersResponseMessage
|
(*GetHeadersRequestMessage)(nil), // 81: protowire.GetHeadersRequestMessage
|
||||||
(*NotifyUtxosChangedRequestMessage)(nil), // 82: protowire.NotifyUtxosChangedRequestMessage
|
(*GetHeadersResponseMessage)(nil), // 82: protowire.GetHeadersResponseMessage
|
||||||
(*NotifyUtxosChangedResponseMessage)(nil), // 83: protowire.NotifyUtxosChangedResponseMessage
|
(*NotifyUtxosChangedRequestMessage)(nil), // 83: protowire.NotifyUtxosChangedRequestMessage
|
||||||
(*UtxosChangedNotificationMessage)(nil), // 84: protowire.UtxosChangedNotificationMessage
|
(*NotifyUtxosChangedResponseMessage)(nil), // 84: protowire.NotifyUtxosChangedResponseMessage
|
||||||
(*GetUtxosByAddressesRequestMessage)(nil), // 85: protowire.GetUtxosByAddressesRequestMessage
|
(*UtxosChangedNotificationMessage)(nil), // 85: protowire.UtxosChangedNotificationMessage
|
||||||
(*GetUtxosByAddressesResponseMessage)(nil), // 86: protowire.GetUtxosByAddressesResponseMessage
|
(*GetUtxosByAddressesRequestMessage)(nil), // 86: protowire.GetUtxosByAddressesRequestMessage
|
||||||
(*GetVirtualSelectedParentBlueScoreRequestMessage)(nil), // 87: protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
(*GetUtxosByAddressesResponseMessage)(nil), // 87: protowire.GetUtxosByAddressesResponseMessage
|
||||||
(*GetVirtualSelectedParentBlueScoreResponseMessage)(nil), // 88: protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
(*GetVirtualSelectedParentBlueScoreRequestMessage)(nil), // 88: protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||||
(*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)(nil), // 89: protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
(*GetVirtualSelectedParentBlueScoreResponseMessage)(nil), // 89: protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||||
(*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)(nil), // 90: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
(*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)(nil), // 90: protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||||
(*VirtualSelectedParentBlueScoreChangedNotificationMessage)(nil), // 91: protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
(*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)(nil), // 91: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||||
(*BanRequestMessage)(nil), // 92: protowire.BanRequestMessage
|
(*VirtualSelectedParentBlueScoreChangedNotificationMessage)(nil), // 92: protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||||
(*BanResponseMessage)(nil), // 93: protowire.BanResponseMessage
|
(*BanRequestMessage)(nil), // 93: protowire.BanRequestMessage
|
||||||
(*UnbanRequestMessage)(nil), // 94: protowire.UnbanRequestMessage
|
(*BanResponseMessage)(nil), // 94: protowire.BanResponseMessage
|
||||||
(*UnbanResponseMessage)(nil), // 95: protowire.UnbanResponseMessage
|
(*UnbanRequestMessage)(nil), // 95: protowire.UnbanRequestMessage
|
||||||
(*GetInfoRequestMessage)(nil), // 96: protowire.GetInfoRequestMessage
|
(*UnbanResponseMessage)(nil), // 96: protowire.UnbanResponseMessage
|
||||||
(*GetInfoResponseMessage)(nil), // 97: protowire.GetInfoResponseMessage
|
(*GetInfoRequestMessage)(nil), // 97: protowire.GetInfoRequestMessage
|
||||||
(*StopNotifyingUtxosChangedRequestMessage)(nil), // 98: protowire.StopNotifyingUtxosChangedRequestMessage
|
(*GetInfoResponseMessage)(nil), // 98: protowire.GetInfoResponseMessage
|
||||||
(*StopNotifyingUtxosChangedResponseMessage)(nil), // 99: protowire.StopNotifyingUtxosChangedResponseMessage
|
(*StopNotifyingUtxosChangedRequestMessage)(nil), // 99: protowire.StopNotifyingUtxosChangedRequestMessage
|
||||||
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 100: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
(*StopNotifyingUtxosChangedResponseMessage)(nil), // 100: protowire.StopNotifyingUtxosChangedResponseMessage
|
||||||
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 101: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 101: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 102: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 102: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 103: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 103: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 104: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 104: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||||
(*EstimateNetworkHashesPerSecondRequestMessage)(nil), // 105: protowire.EstimateNetworkHashesPerSecondRequestMessage
|
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 105: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||||
(*EstimateNetworkHashesPerSecondResponseMessage)(nil), // 106: protowire.EstimateNetworkHashesPerSecondResponseMessage
|
(*EstimateNetworkHashesPerSecondRequestMessage)(nil), // 106: protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||||
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 107: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
(*EstimateNetworkHashesPerSecondResponseMessage)(nil), // 107: protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||||
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 108: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 108: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||||
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 109: protowire.VirtualDaaScoreChangedNotificationMessage
|
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 109: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||||
|
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 110: protowire.VirtualDaaScoreChangedNotificationMessage
|
||||||
}
|
}
|
||||||
var file_messages_proto_depIdxs = []int32{
|
var file_messages_proto_depIdxs = []int32{
|
||||||
1, // 0: protowire.KaspadMessage.addresses:type_name -> protowire.AddressesMessage
|
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
|
5, // 4: protowire.KaspadMessage.requestAddresses:type_name -> protowire.RequestAddressesMessage
|
||||||
6, // 5: protowire.KaspadMessage.requestRelayBlocks:type_name -> protowire.RequestRelayBlocksMessage
|
6, // 5: protowire.KaspadMessage.requestRelayBlocks:type_name -> protowire.RequestRelayBlocksMessage
|
||||||
7, // 6: protowire.KaspadMessage.requestTransactions:type_name -> protowire.RequestTransactionsMessage
|
7, // 6: protowire.KaspadMessage.requestTransactions:type_name -> protowire.RequestTransactionsMessage
|
||||||
8, // 7: protowire.KaspadMessage.invRelayBlock:type_name -> protowire.InvRelayBlockMessage
|
2, // 7: protowire.KaspadMessage.ibdBlock:type_name -> protowire.BlockMessage
|
||||||
9, // 8: protowire.KaspadMessage.invTransactions:type_name -> protowire.InvTransactionsMessage
|
8, // 8: protowire.KaspadMessage.invRelayBlock:type_name -> protowire.InvRelayBlockMessage
|
||||||
10, // 9: protowire.KaspadMessage.ping:type_name -> protowire.PingMessage
|
9, // 9: protowire.KaspadMessage.invTransactions:type_name -> protowire.InvTransactionsMessage
|
||||||
11, // 10: protowire.KaspadMessage.pong:type_name -> protowire.PongMessage
|
10, // 10: protowire.KaspadMessage.ping:type_name -> protowire.PingMessage
|
||||||
12, // 11: protowire.KaspadMessage.verack:type_name -> protowire.VerackMessage
|
11, // 11: protowire.KaspadMessage.pong:type_name -> protowire.PongMessage
|
||||||
13, // 12: protowire.KaspadMessage.version:type_name -> protowire.VersionMessage
|
12, // 12: protowire.KaspadMessage.verack:type_name -> protowire.VerackMessage
|
||||||
14, // 13: protowire.KaspadMessage.transactionNotFound:type_name -> protowire.TransactionNotFoundMessage
|
13, // 13: protowire.KaspadMessage.version:type_name -> protowire.VersionMessage
|
||||||
15, // 14: protowire.KaspadMessage.reject:type_name -> protowire.RejectMessage
|
14, // 14: protowire.KaspadMessage.transactionNotFound:type_name -> protowire.TransactionNotFoundMessage
|
||||||
16, // 15: protowire.KaspadMessage.pruningPointUtxoSetChunk:type_name -> protowire.PruningPointUtxoSetChunkMessage
|
15, // 15: protowire.KaspadMessage.reject:type_name -> protowire.RejectMessage
|
||||||
17, // 16: protowire.KaspadMessage.unexpectedPruningPoint:type_name -> protowire.UnexpectedPruningPointMessage
|
16, // 16: protowire.KaspadMessage.pruningPointUtxoSetChunk:type_name -> protowire.PruningPointUtxoSetChunkMessage
|
||||||
18, // 17: protowire.KaspadMessage.ibdBlockLocator:type_name -> protowire.IbdBlockLocatorMessage
|
17, // 17: protowire.KaspadMessage.requestIBDBlocks:type_name -> protowire.RequestIBDBlocksMessage
|
||||||
19, // 18: protowire.KaspadMessage.ibdBlockLocatorHighestHash:type_name -> protowire.IbdBlockLocatorHighestHashMessage
|
18, // 18: protowire.KaspadMessage.unexpectedPruningPoint:type_name -> protowire.UnexpectedPruningPointMessage
|
||||||
20, // 19: protowire.KaspadMessage.requestNextPruningPointUtxoSetChunk:type_name -> protowire.RequestNextPruningPointUtxoSetChunkMessage
|
19, // 19: protowire.KaspadMessage.ibdBlockLocator:type_name -> protowire.IbdBlockLocatorMessage
|
||||||
21, // 20: protowire.KaspadMessage.donePruningPointUtxoSetChunks:type_name -> protowire.DonePruningPointUtxoSetChunksMessage
|
20, // 20: protowire.KaspadMessage.ibdBlockLocatorHighestHash:type_name -> protowire.IbdBlockLocatorHighestHashMessage
|
||||||
22, // 21: protowire.KaspadMessage.ibdBlockLocatorHighestHashNotFound:type_name -> protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
21, // 21: protowire.KaspadMessage.requestNextPruningPointUtxoSetChunk:type_name -> protowire.RequestNextPruningPointUtxoSetChunkMessage
|
||||||
23, // 22: protowire.KaspadMessage.blockWithTrustedData:type_name -> protowire.BlockWithTrustedDataMessage
|
22, // 22: protowire.KaspadMessage.donePruningPointUtxoSetChunks:type_name -> protowire.DonePruningPointUtxoSetChunksMessage
|
||||||
24, // 23: protowire.KaspadMessage.doneBlocksWithTrustedData:type_name -> protowire.DoneBlocksWithTrustedDataMessage
|
23, // 23: protowire.KaspadMessage.ibdBlockLocatorHighestHashNotFound:type_name -> protowire.IbdBlockLocatorHighestHashNotFoundMessage
|
||||||
25, // 24: protowire.KaspadMessage.requestBlockBlueWork:type_name -> protowire.RequestBlockBlueWorkMessage
|
24, // 24: protowire.KaspadMessage.blockWithTrustedData:type_name -> protowire.BlockWithTrustedDataMessage
|
||||||
26, // 25: protowire.KaspadMessage.blockBlueWork:type_name -> protowire.BlockBlueWorkMessage
|
25, // 25: protowire.KaspadMessage.doneBlocksWithTrustedData:type_name -> protowire.DoneBlocksWithTrustedDataMessage
|
||||||
27, // 26: protowire.KaspadMessage.requestPruningPointAndItsAnticone:type_name -> protowire.RequestPruningPointAndItsAnticoneMessage
|
26, // 26: protowire.KaspadMessage.requestBlockBlueWork:type_name -> protowire.RequestBlockBlueWorkMessage
|
||||||
28, // 27: protowire.KaspadMessage.ibdBlocks:type_name -> protowire.IbdBlocksMessage
|
27, // 27: protowire.KaspadMessage.blockBlueWork:type_name -> protowire.BlockBlueWorkMessage
|
||||||
29, // 28: protowire.KaspadMessage.requestNextIbdBlocks:type_name -> protowire.RequestNextIbdBlocksMessage
|
28, // 28: protowire.KaspadMessage.requestPruningPointAndItsAnticone:type_name -> protowire.RequestPruningPointAndItsAnticoneMessage
|
||||||
30, // 29: protowire.KaspadMessage.doneIbdBlocks:type_name -> protowire.DoneIbdBlocksMessage
|
29, // 29: protowire.KaspadMessage.blockHeaders:type_name -> protowire.BlockHeadersMessage
|
||||||
31, // 30: protowire.KaspadMessage.requestPruningPointUTXOSet:type_name -> protowire.RequestPruningPointUTXOSetMessage
|
30, // 30: protowire.KaspadMessage.requestNextHeaders:type_name -> protowire.RequestNextHeadersMessage
|
||||||
32, // 31: protowire.KaspadMessage.requestIbdBlocks:type_name -> protowire.RequestIbdBlocksMessage
|
31, // 31: protowire.KaspadMessage.DoneHeaders:type_name -> protowire.DoneHeadersMessage
|
||||||
33, // 32: protowire.KaspadMessage.requestBlockLocator:type_name -> protowire.RequestBlockLocatorMessage
|
32, // 32: protowire.KaspadMessage.requestPruningPointUTXOSet:type_name -> protowire.RequestPruningPointUTXOSetMessage
|
||||||
34, // 33: protowire.KaspadMessage.getCurrentNetworkRequest:type_name -> protowire.GetCurrentNetworkRequestMessage
|
33, // 33: protowire.KaspadMessage.requestHeaders:type_name -> protowire.RequestHeadersMessage
|
||||||
35, // 34: protowire.KaspadMessage.getCurrentNetworkResponse:type_name -> protowire.GetCurrentNetworkResponseMessage
|
34, // 34: protowire.KaspadMessage.requestBlockLocator:type_name -> protowire.RequestBlockLocatorMessage
|
||||||
36, // 35: protowire.KaspadMessage.submitBlockRequest:type_name -> protowire.SubmitBlockRequestMessage
|
35, // 35: protowire.KaspadMessage.getCurrentNetworkRequest:type_name -> protowire.GetCurrentNetworkRequestMessage
|
||||||
37, // 36: protowire.KaspadMessage.submitBlockResponse:type_name -> protowire.SubmitBlockResponseMessage
|
36, // 36: protowire.KaspadMessage.getCurrentNetworkResponse:type_name -> protowire.GetCurrentNetworkResponseMessage
|
||||||
38, // 37: protowire.KaspadMessage.getBlockTemplateRequest:type_name -> protowire.GetBlockTemplateRequestMessage
|
37, // 37: protowire.KaspadMessage.submitBlockRequest:type_name -> protowire.SubmitBlockRequestMessage
|
||||||
39, // 38: protowire.KaspadMessage.getBlockTemplateResponse:type_name -> protowire.GetBlockTemplateResponseMessage
|
38, // 38: protowire.KaspadMessage.submitBlockResponse:type_name -> protowire.SubmitBlockResponseMessage
|
||||||
40, // 39: protowire.KaspadMessage.notifyBlockAddedRequest:type_name -> protowire.NotifyBlockAddedRequestMessage
|
39, // 39: protowire.KaspadMessage.getBlockTemplateRequest:type_name -> protowire.GetBlockTemplateRequestMessage
|
||||||
41, // 40: protowire.KaspadMessage.notifyBlockAddedResponse:type_name -> protowire.NotifyBlockAddedResponseMessage
|
40, // 40: protowire.KaspadMessage.getBlockTemplateResponse:type_name -> protowire.GetBlockTemplateResponseMessage
|
||||||
42, // 41: protowire.KaspadMessage.blockAddedNotification:type_name -> protowire.BlockAddedNotificationMessage
|
41, // 41: protowire.KaspadMessage.notifyBlockAddedRequest:type_name -> protowire.NotifyBlockAddedRequestMessage
|
||||||
43, // 42: protowire.KaspadMessage.getPeerAddressesRequest:type_name -> protowire.GetPeerAddressesRequestMessage
|
42, // 42: protowire.KaspadMessage.notifyBlockAddedResponse:type_name -> protowire.NotifyBlockAddedResponseMessage
|
||||||
44, // 43: protowire.KaspadMessage.getPeerAddressesResponse:type_name -> protowire.GetPeerAddressesResponseMessage
|
43, // 43: protowire.KaspadMessage.blockAddedNotification:type_name -> protowire.BlockAddedNotificationMessage
|
||||||
45, // 44: protowire.KaspadMessage.getSelectedTipHashRequest:type_name -> protowire.GetSelectedTipHashRequestMessage
|
44, // 44: protowire.KaspadMessage.getPeerAddressesRequest:type_name -> protowire.GetPeerAddressesRequestMessage
|
||||||
46, // 45: protowire.KaspadMessage.getSelectedTipHashResponse:type_name -> protowire.GetSelectedTipHashResponseMessage
|
45, // 45: protowire.KaspadMessage.getPeerAddressesResponse:type_name -> protowire.GetPeerAddressesResponseMessage
|
||||||
47, // 46: protowire.KaspadMessage.getMempoolEntryRequest:type_name -> protowire.GetMempoolEntryRequestMessage
|
46, // 46: protowire.KaspadMessage.getSelectedTipHashRequest:type_name -> protowire.GetSelectedTipHashRequestMessage
|
||||||
48, // 47: protowire.KaspadMessage.getMempoolEntryResponse:type_name -> protowire.GetMempoolEntryResponseMessage
|
47, // 47: protowire.KaspadMessage.getSelectedTipHashResponse:type_name -> protowire.GetSelectedTipHashResponseMessage
|
||||||
49, // 48: protowire.KaspadMessage.getConnectedPeerInfoRequest:type_name -> protowire.GetConnectedPeerInfoRequestMessage
|
48, // 48: protowire.KaspadMessage.getMempoolEntryRequest:type_name -> protowire.GetMempoolEntryRequestMessage
|
||||||
50, // 49: protowire.KaspadMessage.getConnectedPeerInfoResponse:type_name -> protowire.GetConnectedPeerInfoResponseMessage
|
49, // 49: protowire.KaspadMessage.getMempoolEntryResponse:type_name -> protowire.GetMempoolEntryResponseMessage
|
||||||
51, // 50: protowire.KaspadMessage.addPeerRequest:type_name -> protowire.AddPeerRequestMessage
|
50, // 50: protowire.KaspadMessage.getConnectedPeerInfoRequest:type_name -> protowire.GetConnectedPeerInfoRequestMessage
|
||||||
52, // 51: protowire.KaspadMessage.addPeerResponse:type_name -> protowire.AddPeerResponseMessage
|
51, // 51: protowire.KaspadMessage.getConnectedPeerInfoResponse:type_name -> protowire.GetConnectedPeerInfoResponseMessage
|
||||||
53, // 52: protowire.KaspadMessage.submitTransactionRequest:type_name -> protowire.SubmitTransactionRequestMessage
|
52, // 52: protowire.KaspadMessage.addPeerRequest:type_name -> protowire.AddPeerRequestMessage
|
||||||
54, // 53: protowire.KaspadMessage.submitTransactionResponse:type_name -> protowire.SubmitTransactionResponseMessage
|
53, // 53: protowire.KaspadMessage.addPeerResponse:type_name -> protowire.AddPeerResponseMessage
|
||||||
55, // 54: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
54, // 54: protowire.KaspadMessage.submitTransactionRequest:type_name -> protowire.SubmitTransactionRequestMessage
|
||||||
56, // 55: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
55, // 55: protowire.KaspadMessage.submitTransactionResponse:type_name -> protowire.SubmitTransactionResponseMessage
|
||||||
57, // 56: protowire.KaspadMessage.virtualSelectedParentChainChangedNotification:type_name -> protowire.VirtualSelectedParentChainChangedNotificationMessage
|
56, // 56: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentChainChangedRequestMessage
|
||||||
58, // 57: protowire.KaspadMessage.getBlockRequest:type_name -> protowire.GetBlockRequestMessage
|
57, // 57: protowire.KaspadMessage.notifyVirtualSelectedParentChainChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentChainChangedResponseMessage
|
||||||
59, // 58: protowire.KaspadMessage.getBlockResponse:type_name -> protowire.GetBlockResponseMessage
|
58, // 58: protowire.KaspadMessage.virtualSelectedParentChainChangedNotification:type_name -> protowire.VirtualSelectedParentChainChangedNotificationMessage
|
||||||
60, // 59: protowire.KaspadMessage.getSubnetworkRequest:type_name -> protowire.GetSubnetworkRequestMessage
|
59, // 59: protowire.KaspadMessage.getBlockRequest:type_name -> protowire.GetBlockRequestMessage
|
||||||
61, // 60: protowire.KaspadMessage.getSubnetworkResponse:type_name -> protowire.GetSubnetworkResponseMessage
|
60, // 60: protowire.KaspadMessage.getBlockResponse:type_name -> protowire.GetBlockResponseMessage
|
||||||
62, // 61: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockRequest:type_name -> protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
61, // 61: protowire.KaspadMessage.getSubnetworkRequest:type_name -> protowire.GetSubnetworkRequestMessage
|
||||||
63, // 62: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockResponse:type_name -> protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
62, // 62: protowire.KaspadMessage.getSubnetworkResponse:type_name -> protowire.GetSubnetworkResponseMessage
|
||||||
64, // 63: protowire.KaspadMessage.getBlocksRequest:type_name -> protowire.GetBlocksRequestMessage
|
63, // 63: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockRequest:type_name -> protowire.GetVirtualSelectedParentChainFromBlockRequestMessage
|
||||||
65, // 64: protowire.KaspadMessage.getBlocksResponse:type_name -> protowire.GetBlocksResponseMessage
|
64, // 64: protowire.KaspadMessage.getVirtualSelectedParentChainFromBlockResponse:type_name -> protowire.GetVirtualSelectedParentChainFromBlockResponseMessage
|
||||||
66, // 65: protowire.KaspadMessage.getBlockCountRequest:type_name -> protowire.GetBlockCountRequestMessage
|
65, // 65: protowire.KaspadMessage.getBlocksRequest:type_name -> protowire.GetBlocksRequestMessage
|
||||||
67, // 66: protowire.KaspadMessage.getBlockCountResponse:type_name -> protowire.GetBlockCountResponseMessage
|
66, // 66: protowire.KaspadMessage.getBlocksResponse:type_name -> protowire.GetBlocksResponseMessage
|
||||||
68, // 67: protowire.KaspadMessage.getBlockDagInfoRequest:type_name -> protowire.GetBlockDagInfoRequestMessage
|
67, // 67: protowire.KaspadMessage.getBlockCountRequest:type_name -> protowire.GetBlockCountRequestMessage
|
||||||
69, // 68: protowire.KaspadMessage.getBlockDagInfoResponse:type_name -> protowire.GetBlockDagInfoResponseMessage
|
68, // 68: protowire.KaspadMessage.getBlockCountResponse:type_name -> protowire.GetBlockCountResponseMessage
|
||||||
70, // 69: protowire.KaspadMessage.resolveFinalityConflictRequest:type_name -> protowire.ResolveFinalityConflictRequestMessage
|
69, // 69: protowire.KaspadMessage.getBlockDagInfoRequest:type_name -> protowire.GetBlockDagInfoRequestMessage
|
||||||
71, // 70: protowire.KaspadMessage.resolveFinalityConflictResponse:type_name -> protowire.ResolveFinalityConflictResponseMessage
|
70, // 70: protowire.KaspadMessage.getBlockDagInfoResponse:type_name -> protowire.GetBlockDagInfoResponseMessage
|
||||||
72, // 71: protowire.KaspadMessage.notifyFinalityConflictsRequest:type_name -> protowire.NotifyFinalityConflictsRequestMessage
|
71, // 71: protowire.KaspadMessage.resolveFinalityConflictRequest:type_name -> protowire.ResolveFinalityConflictRequestMessage
|
||||||
73, // 72: protowire.KaspadMessage.notifyFinalityConflictsResponse:type_name -> protowire.NotifyFinalityConflictsResponseMessage
|
72, // 72: protowire.KaspadMessage.resolveFinalityConflictResponse:type_name -> protowire.ResolveFinalityConflictResponseMessage
|
||||||
74, // 73: protowire.KaspadMessage.finalityConflictNotification:type_name -> protowire.FinalityConflictNotificationMessage
|
73, // 73: protowire.KaspadMessage.notifyFinalityConflictsRequest:type_name -> protowire.NotifyFinalityConflictsRequestMessage
|
||||||
75, // 74: protowire.KaspadMessage.finalityConflictResolvedNotification:type_name -> protowire.FinalityConflictResolvedNotificationMessage
|
74, // 74: protowire.KaspadMessage.notifyFinalityConflictsResponse:type_name -> protowire.NotifyFinalityConflictsResponseMessage
|
||||||
76, // 75: protowire.KaspadMessage.getMempoolEntriesRequest:type_name -> protowire.GetMempoolEntriesRequestMessage
|
75, // 75: protowire.KaspadMessage.finalityConflictNotification:type_name -> protowire.FinalityConflictNotificationMessage
|
||||||
77, // 76: protowire.KaspadMessage.getMempoolEntriesResponse:type_name -> protowire.GetMempoolEntriesResponseMessage
|
76, // 76: protowire.KaspadMessage.finalityConflictResolvedNotification:type_name -> protowire.FinalityConflictResolvedNotificationMessage
|
||||||
78, // 77: protowire.KaspadMessage.shutDownRequest:type_name -> protowire.ShutDownRequestMessage
|
77, // 77: protowire.KaspadMessage.getMempoolEntriesRequest:type_name -> protowire.GetMempoolEntriesRequestMessage
|
||||||
79, // 78: protowire.KaspadMessage.shutDownResponse:type_name -> protowire.ShutDownResponseMessage
|
78, // 78: protowire.KaspadMessage.getMempoolEntriesResponse:type_name -> protowire.GetMempoolEntriesResponseMessage
|
||||||
80, // 79: protowire.KaspadMessage.getHeadersRequest:type_name -> protowire.GetHeadersRequestMessage
|
79, // 79: protowire.KaspadMessage.shutDownRequest:type_name -> protowire.ShutDownRequestMessage
|
||||||
81, // 80: protowire.KaspadMessage.getHeadersResponse:type_name -> protowire.GetHeadersResponseMessage
|
80, // 80: protowire.KaspadMessage.shutDownResponse:type_name -> protowire.ShutDownResponseMessage
|
||||||
82, // 81: protowire.KaspadMessage.notifyUtxosChangedRequest:type_name -> protowire.NotifyUtxosChangedRequestMessage
|
81, // 81: protowire.KaspadMessage.getHeadersRequest:type_name -> protowire.GetHeadersRequestMessage
|
||||||
83, // 82: protowire.KaspadMessage.notifyUtxosChangedResponse:type_name -> protowire.NotifyUtxosChangedResponseMessage
|
82, // 82: protowire.KaspadMessage.getHeadersResponse:type_name -> protowire.GetHeadersResponseMessage
|
||||||
84, // 83: protowire.KaspadMessage.utxosChangedNotification:type_name -> protowire.UtxosChangedNotificationMessage
|
83, // 83: protowire.KaspadMessage.notifyUtxosChangedRequest:type_name -> protowire.NotifyUtxosChangedRequestMessage
|
||||||
85, // 84: protowire.KaspadMessage.getUtxosByAddressesRequest:type_name -> protowire.GetUtxosByAddressesRequestMessage
|
84, // 84: protowire.KaspadMessage.notifyUtxosChangedResponse:type_name -> protowire.NotifyUtxosChangedResponseMessage
|
||||||
86, // 85: protowire.KaspadMessage.getUtxosByAddressesResponse:type_name -> protowire.GetUtxosByAddressesResponseMessage
|
85, // 85: protowire.KaspadMessage.utxosChangedNotification:type_name -> protowire.UtxosChangedNotificationMessage
|
||||||
87, // 86: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreRequest:type_name -> protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
86, // 86: protowire.KaspadMessage.getUtxosByAddressesRequest:type_name -> protowire.GetUtxosByAddressesRequestMessage
|
||||||
88, // 87: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreResponse:type_name -> protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
87, // 87: protowire.KaspadMessage.getUtxosByAddressesResponse:type_name -> protowire.GetUtxosByAddressesResponseMessage
|
||||||
89, // 88: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
88, // 88: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreRequest:type_name -> protowire.GetVirtualSelectedParentBlueScoreRequestMessage
|
||||||
90, // 89: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
89, // 89: protowire.KaspadMessage.getVirtualSelectedParentBlueScoreResponse:type_name -> protowire.GetVirtualSelectedParentBlueScoreResponseMessage
|
||||||
91, // 90: protowire.KaspadMessage.virtualSelectedParentBlueScoreChangedNotification:type_name -> protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
90, // 90: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedRequest:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||||
92, // 91: protowire.KaspadMessage.banRequest:type_name -> protowire.BanRequestMessage
|
91, // 91: protowire.KaspadMessage.notifyVirtualSelectedParentBlueScoreChangedResponse:type_name -> protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||||
93, // 92: protowire.KaspadMessage.banResponse:type_name -> protowire.BanResponseMessage
|
92, // 92: protowire.KaspadMessage.virtualSelectedParentBlueScoreChangedNotification:type_name -> protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||||
94, // 93: protowire.KaspadMessage.unbanRequest:type_name -> protowire.UnbanRequestMessage
|
93, // 93: protowire.KaspadMessage.banRequest:type_name -> protowire.BanRequestMessage
|
||||||
95, // 94: protowire.KaspadMessage.unbanResponse:type_name -> protowire.UnbanResponseMessage
|
94, // 94: protowire.KaspadMessage.banResponse:type_name -> protowire.BanResponseMessage
|
||||||
96, // 95: protowire.KaspadMessage.getInfoRequest:type_name -> protowire.GetInfoRequestMessage
|
95, // 95: protowire.KaspadMessage.unbanRequest:type_name -> protowire.UnbanRequestMessage
|
||||||
97, // 96: protowire.KaspadMessage.getInfoResponse:type_name -> protowire.GetInfoResponseMessage
|
96, // 96: protowire.KaspadMessage.unbanResponse:type_name -> protowire.UnbanResponseMessage
|
||||||
98, // 97: protowire.KaspadMessage.stopNotifyingUtxosChangedRequest:type_name -> protowire.StopNotifyingUtxosChangedRequestMessage
|
97, // 97: protowire.KaspadMessage.getInfoRequest:type_name -> protowire.GetInfoRequestMessage
|
||||||
99, // 98: protowire.KaspadMessage.stopNotifyingUtxosChangedResponse:type_name -> protowire.StopNotifyingUtxosChangedResponseMessage
|
98, // 98: protowire.KaspadMessage.getInfoResponse:type_name -> protowire.GetInfoResponseMessage
|
||||||
100, // 99: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideRequest:type_name -> protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
99, // 99: protowire.KaspadMessage.stopNotifyingUtxosChangedRequest:type_name -> protowire.StopNotifyingUtxosChangedRequestMessage
|
||||||
101, // 100: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideResponse:type_name -> protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
100, // 100: protowire.KaspadMessage.stopNotifyingUtxosChangedResponse:type_name -> protowire.StopNotifyingUtxosChangedResponseMessage
|
||||||
102, // 101: protowire.KaspadMessage.pruningPointUTXOSetOverrideNotification:type_name -> protowire.PruningPointUTXOSetOverrideNotificationMessage
|
101, // 101: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideRequest:type_name -> protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||||
103, // 102: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideRequest:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
102, // 102: protowire.KaspadMessage.notifyPruningPointUTXOSetOverrideResponse:type_name -> protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||||
104, // 103: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideResponse:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
103, // 103: protowire.KaspadMessage.pruningPointUTXOSetOverrideNotification:type_name -> protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||||
105, // 104: protowire.KaspadMessage.estimateNetworkHashesPerSecondRequest:type_name -> protowire.EstimateNetworkHashesPerSecondRequestMessage
|
104, // 104: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideRequest:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||||
106, // 105: protowire.KaspadMessage.estimateNetworkHashesPerSecondResponse:type_name -> protowire.EstimateNetworkHashesPerSecondResponseMessage
|
105, // 105: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideResponse:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||||
107, // 106: protowire.KaspadMessage.notifyVirtualDaaScoreChangedRequest:type_name -> protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
106, // 106: protowire.KaspadMessage.estimateNetworkHashesPerSecondRequest:type_name -> protowire.EstimateNetworkHashesPerSecondRequestMessage
|
||||||
108, // 107: protowire.KaspadMessage.notifyVirtualDaaScoreChangedResponse:type_name -> protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
107, // 107: protowire.KaspadMessage.estimateNetworkHashesPerSecondResponse:type_name -> protowire.EstimateNetworkHashesPerSecondResponseMessage
|
||||||
109, // 108: protowire.KaspadMessage.virtualDaaScoreChangedNotification:type_name -> protowire.VirtualDaaScoreChangedNotificationMessage
|
108, // 108: protowire.KaspadMessage.notifyVirtualDaaScoreChangedRequest:type_name -> protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||||
0, // 109: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
109, // 109: protowire.KaspadMessage.notifyVirtualDaaScoreChangedResponse:type_name -> protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||||
0, // 110: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
110, // 110: protowire.KaspadMessage.virtualDaaScoreChangedNotification:type_name -> protowire.VirtualDaaScoreChangedNotificationMessage
|
||||||
0, // 111: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
0, // 111: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||||
0, // 112: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
0, // 112: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||||
111, // [111:113] is the sub-list for method output_type
|
0, // 113: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||||
109, // [109:111] is the sub-list for method input_type
|
0, // 114: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||||
109, // [109:109] is the sub-list for extension type_name
|
113, // [113:115] is the sub-list for method output_type
|
||||||
109, // [109:109] is the sub-list for extension extendee
|
111, // [111:113] is the sub-list for method input_type
|
||||||
0, // [0:109] is the sub-list for field type_name
|
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() }
|
func init() { file_messages_proto_init() }
|
||||||
@ -2638,6 +2677,7 @@ func file_messages_proto_init() {
|
|||||||
(*KaspadMessage_RequestAddresses)(nil),
|
(*KaspadMessage_RequestAddresses)(nil),
|
||||||
(*KaspadMessage_RequestRelayBlocks)(nil),
|
(*KaspadMessage_RequestRelayBlocks)(nil),
|
||||||
(*KaspadMessage_RequestTransactions)(nil),
|
(*KaspadMessage_RequestTransactions)(nil),
|
||||||
|
(*KaspadMessage_IbdBlock)(nil),
|
||||||
(*KaspadMessage_InvRelayBlock)(nil),
|
(*KaspadMessage_InvRelayBlock)(nil),
|
||||||
(*KaspadMessage_InvTransactions)(nil),
|
(*KaspadMessage_InvTransactions)(nil),
|
||||||
(*KaspadMessage_Ping)(nil),
|
(*KaspadMessage_Ping)(nil),
|
||||||
@ -2647,6 +2687,7 @@ func file_messages_proto_init() {
|
|||||||
(*KaspadMessage_TransactionNotFound)(nil),
|
(*KaspadMessage_TransactionNotFound)(nil),
|
||||||
(*KaspadMessage_Reject)(nil),
|
(*KaspadMessage_Reject)(nil),
|
||||||
(*KaspadMessage_PruningPointUtxoSetChunk)(nil),
|
(*KaspadMessage_PruningPointUtxoSetChunk)(nil),
|
||||||
|
(*KaspadMessage_RequestIBDBlocks)(nil),
|
||||||
(*KaspadMessage_UnexpectedPruningPoint)(nil),
|
(*KaspadMessage_UnexpectedPruningPoint)(nil),
|
||||||
(*KaspadMessage_IbdBlockLocator)(nil),
|
(*KaspadMessage_IbdBlockLocator)(nil),
|
||||||
(*KaspadMessage_IbdBlockLocatorHighestHash)(nil),
|
(*KaspadMessage_IbdBlockLocatorHighestHash)(nil),
|
||||||
@ -2658,11 +2699,11 @@ func file_messages_proto_init() {
|
|||||||
(*KaspadMessage_RequestBlockBlueWork)(nil),
|
(*KaspadMessage_RequestBlockBlueWork)(nil),
|
||||||
(*KaspadMessage_BlockBlueWork)(nil),
|
(*KaspadMessage_BlockBlueWork)(nil),
|
||||||
(*KaspadMessage_RequestPruningPointAndItsAnticone)(nil),
|
(*KaspadMessage_RequestPruningPointAndItsAnticone)(nil),
|
||||||
(*KaspadMessage_IbdBlocks)(nil),
|
(*KaspadMessage_BlockHeaders)(nil),
|
||||||
(*KaspadMessage_RequestNextIbdBlocks)(nil),
|
(*KaspadMessage_RequestNextHeaders)(nil),
|
||||||
(*KaspadMessage_DoneIbdBlocks)(nil),
|
(*KaspadMessage_DoneHeaders)(nil),
|
||||||
(*KaspadMessage_RequestPruningPointUTXOSet)(nil),
|
(*KaspadMessage_RequestPruningPointUTXOSet)(nil),
|
||||||
(*KaspadMessage_RequestIbdBlocks)(nil),
|
(*KaspadMessage_RequestHeaders)(nil),
|
||||||
(*KaspadMessage_RequestBlockLocator)(nil),
|
(*KaspadMessage_RequestBlockLocator)(nil),
|
||||||
(*KaspadMessage_GetCurrentNetworkRequest)(nil),
|
(*KaspadMessage_GetCurrentNetworkRequest)(nil),
|
||||||
(*KaspadMessage_GetCurrentNetworkResponse)(nil),
|
(*KaspadMessage_GetCurrentNetworkResponse)(nil),
|
||||||
|
@ -15,6 +15,7 @@ message KaspadMessage {
|
|||||||
RequestAddressesMessage requestAddresses = 6;
|
RequestAddressesMessage requestAddresses = 6;
|
||||||
RequestRelayBlocksMessage requestRelayBlocks = 10;
|
RequestRelayBlocksMessage requestRelayBlocks = 10;
|
||||||
RequestTransactionsMessage requestTransactions = 12;
|
RequestTransactionsMessage requestTransactions = 12;
|
||||||
|
BlockMessage ibdBlock = 13;
|
||||||
InvRelayBlockMessage invRelayBlock = 14;
|
InvRelayBlockMessage invRelayBlock = 14;
|
||||||
InvTransactionsMessage invTransactions = 15;
|
InvTransactionsMessage invTransactions = 15;
|
||||||
PingMessage ping = 16;
|
PingMessage ping = 16;
|
||||||
@ -24,6 +25,7 @@ message KaspadMessage {
|
|||||||
TransactionNotFoundMessage transactionNotFound = 21;
|
TransactionNotFoundMessage transactionNotFound = 21;
|
||||||
RejectMessage reject = 22;
|
RejectMessage reject = 22;
|
||||||
PruningPointUtxoSetChunkMessage pruningPointUtxoSetChunk = 25;
|
PruningPointUtxoSetChunkMessage pruningPointUtxoSetChunk = 25;
|
||||||
|
RequestIBDBlocksMessage requestIBDBlocks = 26;
|
||||||
UnexpectedPruningPointMessage unexpectedPruningPoint = 27;
|
UnexpectedPruningPointMessage unexpectedPruningPoint = 27;
|
||||||
IbdBlockLocatorMessage ibdBlockLocator = 30;
|
IbdBlockLocatorMessage ibdBlockLocator = 30;
|
||||||
IbdBlockLocatorHighestHashMessage ibdBlockLocatorHighestHash = 31;
|
IbdBlockLocatorHighestHashMessage ibdBlockLocatorHighestHash = 31;
|
||||||
@ -35,11 +37,11 @@ message KaspadMessage {
|
|||||||
RequestBlockBlueWorkMessage requestBlockBlueWork = 38;
|
RequestBlockBlueWorkMessage requestBlockBlueWork = 38;
|
||||||
BlockBlueWorkMessage blockBlueWork = 39;
|
BlockBlueWorkMessage blockBlueWork = 39;
|
||||||
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone = 40;
|
RequestPruningPointAndItsAnticoneMessage requestPruningPointAndItsAnticone = 40;
|
||||||
IbdBlocksMessage ibdBlocks = 41;
|
BlockHeadersMessage blockHeaders = 41;
|
||||||
RequestNextIbdBlocksMessage requestNextIbdBlocks = 42;
|
RequestNextHeadersMessage requestNextHeaders = 42;
|
||||||
DoneIbdBlocksMessage doneIbdBlocks = 43;
|
DoneHeadersMessage DoneHeaders = 43;
|
||||||
RequestPruningPointUTXOSetMessage requestPruningPointUTXOSet = 44;
|
RequestPruningPointUTXOSetMessage requestPruningPointUTXOSet = 44;
|
||||||
RequestIbdBlocksMessage requestIbdBlocks = 45;
|
RequestHeadersMessage requestHeaders = 45;
|
||||||
RequestBlockLocatorMessage requestBlockLocator = 46;
|
RequestBlockLocatorMessage requestBlockLocator = 46;
|
||||||
|
|
||||||
GetCurrentNetworkRequestMessage getCurrentNetworkRequest = 1001;
|
GetCurrentNetworkRequestMessage getCurrentNetworkRequest = 1001;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -86,15 +86,15 @@ message BlockLocatorMessage{
|
|||||||
repeated Hash hashes = 1;
|
repeated Hash hashes = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RequestIbdBlocksMessage{
|
message RequestHeadersMessage{
|
||||||
Hash lowHash = 1;
|
Hash lowHash = 1;
|
||||||
Hash highHash = 2;
|
Hash highHash = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RequestNextIbdBlocksMessage{
|
message RequestNextHeadersMessage{
|
||||||
}
|
}
|
||||||
|
|
||||||
message DoneIbdBlocksMessage{
|
message DoneHeadersMessage{
|
||||||
}
|
}
|
||||||
|
|
||||||
message RequestRelayBlocksMessage{
|
message RequestRelayBlocksMessage{
|
||||||
@ -170,6 +170,10 @@ message RequestNextPruningPointUtxoSetChunkMessage {
|
|||||||
message DonePruningPointUtxoSetChunksMessage {
|
message DonePruningPointUtxoSetChunksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message RequestIBDBlocksMessage{
|
||||||
|
repeated Hash hashes = 1;
|
||||||
|
}
|
||||||
|
|
||||||
message UnexpectedPruningPointMessage{
|
message UnexpectedPruningPointMessage{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,8 +189,8 @@ message IbdBlockLocatorHighestHashMessage {
|
|||||||
message IbdBlockLocatorHighestHashNotFoundMessage {
|
message IbdBlockLocatorHighestHashNotFoundMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
message IbdBlocksMessage {
|
message BlockHeadersMessage {
|
||||||
repeated BlockMessage blocks = 1;
|
repeated BlockHeader blockHeaders = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RequestPruningPointAndItsAnticoneMessage {
|
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"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (x *KaspadMessage_RequestIbdBlocks) toAppMessage() (appmessage.Message, error) {
|
func (x *KaspadMessage_RequestIBDBlocks) toAppMessage() (appmessage.Message, error) {
|
||||||
if x == nil {
|
if x == nil {
|
||||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestIBDBlocks is nil")
|
return nil, errors.Wrapf(errorNil, "KaspadMessage_RequestIBDBlocks is nil")
|
||||||
}
|
}
|
||||||
lowHash, err := x.RequestIbdBlocks.LowHash.toDomain()
|
return x.RequestIBDBlocks.toAppMessage()
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RequestIbdBlocksMessage) toAppMessage() (appmessage.Message, error) {
|
func (x *RequestIBDBlocksMessage) toAppMessage() (appmessage.Message, error) {
|
||||||
if x == nil {
|
if x == nil {
|
||||||
return nil, errors.Wrapf(errorNil, "RequestIBDBlocksMessage is nil")
|
return nil, errors.Wrapf(errorNil, "RequestIBDBlocksMessage is nil")
|
||||||
}
|
}
|
||||||
lowHash, err := x.LowHash.toDomain()
|
hashes, err := protoHashesToDomain(x.Hashes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
return &appmessage.MsgRequestIBDBlocks{Hashes: hashes}, nil
|
||||||
highHash, err := x.HighHash.toDomain()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &appmessage.MsgRequestIBDBlocks{
|
|
||||||
LowHash: lowHash,
|
|
||||||
HighHash: highHash,
|
|
||||||
}, nil
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *KaspadMessage_RequestIbdBlocks) fromAppMessage(msgRequestmsgRequestIBDBlocks *appmessage.MsgRequestIBDBlocks) error {
|
func (x *KaspadMessage_RequestIBDBlocks) fromAppMessage(msgRequestIBDBlocks *appmessage.MsgRequestIBDBlocks) error {
|
||||||
x.RequestIbdBlocks = &RequestIbdBlocksMessage{
|
x.RequestIBDBlocks = &RequestIBDBlocksMessage{
|
||||||
LowHash: domainHashToProto(msgRequestmsgRequestIBDBlocks.LowHash),
|
Hashes: domainHashesToProto(msgRequestIBDBlocks.Hashes),
|
||||||
HighHash: domainHashToProto(msgRequestmsgRequestIBDBlocks.HighHash),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
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
|
return payload, nil
|
||||||
case *appmessage.MsgRequestIBDBlocks:
|
case *appmessage.MsgRequestIBDBlocks:
|
||||||
payload := new(KaspadMessage_RequestIbdBlocks)
|
payload := new(KaspadMessage_RequestIBDBlocks)
|
||||||
err := payload.fromAppMessage(message)
|
err := payload.fromAppMessage(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return payload, nil
|
return payload, nil
|
||||||
case *appmessage.MsgRequestNextIBDBlocks:
|
case *appmessage.MsgRequestNextHeaders:
|
||||||
payload := new(KaspadMessage_RequestNextIbdBlocks)
|
payload := new(KaspadMessage_RequestNextHeaders)
|
||||||
err := payload.fromAppMessage(message)
|
err := payload.fromAppMessage(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return payload, nil
|
return payload, nil
|
||||||
case *appmessage.MsgDoneIBDBlocks:
|
case *appmessage.MsgDoneHeaders:
|
||||||
payload := new(KaspadMessage_DoneIbdBlocks)
|
payload := new(KaspadMessage_DoneHeaders)
|
||||||
err := payload.fromAppMessage(message)
|
err := payload.fromAppMessage(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -233,8 +233,8 @@ func toP2PPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return payload, nil
|
return payload, nil
|
||||||
case *appmessage.IBDBlocksMessage:
|
case *appmessage.BlockHeadersMessage:
|
||||||
payload := new(KaspadMessage_IbdBlocks)
|
payload := new(KaspadMessage_BlockHeaders)
|
||||||
err := payload.fromAppMessage(message)
|
err := payload.fromAppMessage(message)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -289,6 +289,20 @@ func toP2PPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return payload, nil
|
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:
|
default:
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user