mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-02-23 03:48:20 +00:00
Compare commits
2 Commits
v0.10.4-de
...
v0.10.2-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91866dd61c | ||
|
|
3e57560b12 |
@@ -137,9 +137,6 @@ const (
|
||||
CmdPruningPointUTXOSetOverrideNotificationMessage
|
||||
CmdStopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
CmdStopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
CmdNotifyVirtualDaaScoreChangedRequestMessage
|
||||
CmdNotifyVirtualDaaScoreChangedResponseMessage
|
||||
CmdVirtualDaaScoreChangedNotificationMessage
|
||||
)
|
||||
|
||||
// ProtocolMessageCommandToString maps all MessageCommands to their string representation
|
||||
@@ -251,9 +248,6 @@ var RPCMessageCommandToString = map[MessageCommand]string{
|
||||
CmdPruningPointUTXOSetOverrideNotificationMessage: "PruningPointUTXOSetOverrideNotification",
|
||||
CmdStopNotifyingPruningPointUTXOSetOverrideRequestMessage: "StopNotifyingPruningPointUTXOSetOverrideRequest",
|
||||
CmdStopNotifyingPruningPointUTXOSetOverrideResponseMessage: "StopNotifyingPruningPointUTXOSetOverrideResponse",
|
||||
CmdNotifyVirtualDaaScoreChangedRequestMessage: "NotifyVirtualDaaScoreChangedRequest",
|
||||
CmdNotifyVirtualDaaScoreChangedResponseMessage: "NotifyVirtualDaaScoreChangedResponse",
|
||||
CmdVirtualDaaScoreChangedNotificationMessage: "VirtualDaaScoreChangedNotification",
|
||||
}
|
||||
|
||||
// Message is an interface that describes a kaspa message. A type that
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package appmessage
|
||||
|
||||
// NotifyVirtualDaaScoreChangedRequestMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyVirtualDaaScoreChangedRequestMessage struct {
|
||||
baseMessage
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *NotifyVirtualDaaScoreChangedRequestMessage) Command() MessageCommand {
|
||||
return CmdNotifyVirtualDaaScoreChangedRequestMessage
|
||||
}
|
||||
|
||||
// NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message
|
||||
func NewNotifyVirtualDaaScoreChangedRequestMessage() *NotifyVirtualDaaScoreChangedRequestMessage {
|
||||
return &NotifyVirtualDaaScoreChangedRequestMessage{}
|
||||
}
|
||||
|
||||
// NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyVirtualDaaScoreChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *NotifyVirtualDaaScoreChangedResponseMessage) Command() MessageCommand {
|
||||
return CmdNotifyVirtualDaaScoreChangedResponseMessage
|
||||
}
|
||||
|
||||
// NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message
|
||||
func NewNotifyVirtualDaaScoreChangedResponseMessage() *NotifyVirtualDaaScoreChangedResponseMessage {
|
||||
return &NotifyVirtualDaaScoreChangedResponseMessage{}
|
||||
}
|
||||
|
||||
// VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type VirtualDaaScoreChangedNotificationMessage struct {
|
||||
baseMessage
|
||||
VirtualDaaScore uint64
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
func (msg *VirtualDaaScoreChangedNotificationMessage) Command() MessageCommand {
|
||||
return CmdVirtualDaaScoreChangedNotificationMessage
|
||||
}
|
||||
|
||||
// NewVirtualDaaScoreChangedNotificationMessage returns a instance of the message
|
||||
func NewVirtualDaaScoreChangedNotificationMessage(
|
||||
virtualDaaScore uint64) *VirtualDaaScoreChangedNotificationMessage {
|
||||
|
||||
return &VirtualDaaScoreChangedNotificationMessage{
|
||||
VirtualDaaScore: virtualDaaScore,
|
||||
}
|
||||
}
|
||||
@@ -49,9 +49,8 @@ func (flow *handleRequestHeadersFlow) start() error {
|
||||
|
||||
// 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)
|
||||
const maxBlueScoreDifference = 1 << 10
|
||||
blockHashes, _, err := flow.Domain().Consensus().GetHashesBetween(lowHash, highHash, maxBlueScoreDifference)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ func (f *fakeRelayInvsContext) GetBlockAcceptanceData(blockHash *externalapi.Dom
|
||||
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) {
|
||||
func (f *fakeRelayInvsContext) GetHashesBetween(lowHash, highHash *externalapi.DomainHash, maxBlueScoreDifference uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
panic(errors.Errorf("called unimplemented function from test '%s'", f.testName))
|
||||
}
|
||||
|
||||
|
||||
@@ -64,11 +64,6 @@ func (m *Manager) NotifyBlockAddedToDAG(block *externalapi.DomainBlock, blockIns
|
||||
return err
|
||||
}
|
||||
|
||||
err = m.notifyVirtualDaaScoreChanged()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = m.notifyVirtualSelectedParentChainChanged(blockInsertionResult)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -158,19 +153,6 @@ func (m *Manager) notifyVirtualSelectedParentBlueScoreChanged() error {
|
||||
return m.context.NotificationManager.NotifyVirtualSelectedParentBlueScoreChanged(notification)
|
||||
}
|
||||
|
||||
func (m *Manager) notifyVirtualDaaScoreChanged() error {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualDaaScoreChanged")
|
||||
defer onEnd()
|
||||
|
||||
virtualInfo, err := m.context.Domain.Consensus().GetVirtualInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
notification := appmessage.NewVirtualDaaScoreChangedNotificationMessage(virtualInfo.DAAScore)
|
||||
return m.context.NotificationManager.NotifyVirtualDaaScoreChanged(notification)
|
||||
}
|
||||
|
||||
func (m *Manager) notifyVirtualSelectedParentChainChanged(blockInsertionResult *externalapi.BlockInsertionResult) error {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualSelectedParentChainChanged")
|
||||
defer onEnd()
|
||||
|
||||
@@ -44,7 +44,6 @@ var handlers = map[appmessage.MessageCommand]handler{
|
||||
appmessage.CmdGetInfoRequestMessage: rpchandlers.HandleGetInfo,
|
||||
appmessage.CmdNotifyPruningPointUTXOSetOverrideRequestMessage: rpchandlers.HandleNotifyPruningPointUTXOSetOverrideRequest,
|
||||
appmessage.CmdStopNotifyingPruningPointUTXOSetOverrideRequestMessage: rpchandlers.HandleStopNotifyingPruningPointUTXOSetOverrideRequest,
|
||||
appmessage.CmdNotifyVirtualDaaScoreChangedRequestMessage: rpchandlers.HandleNotifyVirtualDaaScoreChanged,
|
||||
}
|
||||
|
||||
func (m *Manager) routerInitializer(router *router.Router, netConnection *netadapter.NetConnection) {
|
||||
|
||||
@@ -30,7 +30,6 @@ type NotificationListener struct {
|
||||
propagateFinalityConflictResolvedNotifications bool
|
||||
propagateUTXOsChangedNotifications bool
|
||||
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
|
||||
propagateVirtualDaaScoreChangedNotifications bool
|
||||
propagatePruningPointUTXOSetOverrideNotifications bool
|
||||
|
||||
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
|
||||
@@ -182,25 +181,6 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged(
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotifyVirtualDaaScoreChanged notifies the notification manager that the DAG's
|
||||
// virtual DAA score has changed
|
||||
func (nm *NotificationManager) NotifyVirtualDaaScoreChanged(
|
||||
notification *appmessage.VirtualDaaScoreChangedNotificationMessage) error {
|
||||
|
||||
nm.RLock()
|
||||
defer nm.RUnlock()
|
||||
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateVirtualDaaScoreChangedNotifications {
|
||||
err := router.OutgoingRoute().Enqueue(notification)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// NotifyPruningPointUTXOSetOverride notifies the notification manager that the UTXO index
|
||||
// reset due to pruning point change via IBD.
|
||||
func (nm *NotificationManager) NotifyPruningPointUTXOSetOverride() error {
|
||||
@@ -328,12 +308,6 @@ func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNo
|
||||
nl.propagateVirtualSelectedParentBlueScoreChangedNotifications = true
|
||||
}
|
||||
|
||||
// PropagateVirtualDaaScoreChangedNotifications instructs the listener to send
|
||||
// virtual DAA score notifications to the remote listener
|
||||
func (nl *NotificationListener) PropagateVirtualDaaScoreChangedNotifications() {
|
||||
nl.propagateVirtualDaaScoreChangedNotifications = true
|
||||
}
|
||||
|
||||
// PropagatePruningPointUTXOSetOverrideNotifications instructs the listener to send pruning point UTXO set override notifications
|
||||
// to the remote listener.
|
||||
func (nl *NotificationListener) PropagatePruningPointUTXOSetOverrideNotifications() {
|
||||
|
||||
@@ -8,6 +8,12 @@ import (
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
)
|
||||
|
||||
const (
|
||||
// maxBlocksInGetBlocksResponse is the max amount of blocks that are
|
||||
// allowed in a GetBlocksResult.
|
||||
maxBlocksInGetBlocksResponse = 1000
|
||||
)
|
||||
|
||||
// HandleGetBlocks handles the respectively named RPC command
|
||||
func HandleGetBlocks(context *rpccontext.Context, _ *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||
getBlocksRequest := request.(*appmessage.GetBlocksRequestMessage)
|
||||
@@ -49,11 +55,7 @@ func HandleGetBlocks(context *rpccontext.Context, _ *router.Router, request appm
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// We use +1 because lowHash is also returned
|
||||
// maxBlocks MUST be >= MergeSetSizeLimit + 1
|
||||
maxBlocks := context.Config.NetParams().MergeSetSizeLimit + 1
|
||||
blockHashes, highHash, err := context.Domain.Consensus().GetHashesBetween(lowHash, virtualSelectedParent, maxBlocks)
|
||||
blockHashes, highHash, err := context.Domain.Consensus().GetHashesBetween(lowHash, virtualSelectedParent, maxBlocksInGetBlocksResponse)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -72,6 +74,12 @@ func HandleGetBlocks(context *rpccontext.Context, _ *router.Router, request appm
|
||||
blockHashes = append(blockHashes, virtualSelectedParentAnticone...)
|
||||
}
|
||||
|
||||
// Both GetHashesBetween and Anticone might return more then the allowed number of blocks, so
|
||||
// trim any extra blocks.
|
||||
if len(blockHashes) > maxBlocksInGetBlocksResponse {
|
||||
blockHashes = blockHashes[:maxBlocksInGetBlocksResponse]
|
||||
}
|
||||
|
||||
// Prepare the response
|
||||
response := appmessage.NewGetBlocksResponseMessage()
|
||||
response.BlockHashes = hashes.ToStrings(blockHashes)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package rpchandlers
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
)
|
||||
|
||||
// HandleNotifyVirtualDaaScoreChanged handles the respectively named RPC command
|
||||
func HandleNotifyVirtualDaaScoreChanged(context *rpccontext.Context, router *router.Router, _ appmessage.Message) (appmessage.Message, error) {
|
||||
listener, err := context.NotificationManager.Listener(router)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateVirtualDaaScoreChangedNotifications()
|
||||
|
||||
response := appmessage.NewNotifyVirtualDaaScoreChangedResponseMessage()
|
||||
return response, nil
|
||||
}
|
||||
@@ -1,12 +1,3 @@
|
||||
Kaspad v0.10.4 - 2021-07-05
|
||||
===========================
|
||||
* Make use of maxBlocks instead of maxBlueScoreDifference in antiPastHashesBetween (#1774)
|
||||
|
||||
Kaspad v0.10.3 - 2021-06-06
|
||||
===========================
|
||||
Non-breaking changes:
|
||||
* Implement NotifyVirtualDaaScoreChanged (#1737)
|
||||
|
||||
Kaspad v0.10.2 - 2021-05-18
|
||||
===========================
|
||||
Non-breaking changes:
|
||||
|
||||
@@ -226,7 +226,7 @@ func (s *consensus) GetBlockAcceptanceData(blockHash *externalapi.DomainHash) (e
|
||||
return s.acceptanceDataStore.Get(s.databaseContext, stagingArea, blockHash)
|
||||
}
|
||||
|
||||
func (s *consensus) GetHashesBetween(lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (
|
||||
func (s *consensus) GetHashesBetween(lowHash, highHash *externalapi.DomainHash, maxBlueScoreDifference uint64) (
|
||||
hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
|
||||
s.lock.Lock()
|
||||
@@ -243,7 +243,7 @@ func (s *consensus) GetHashesBetween(lowHash, highHash *externalapi.DomainHash,
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return s.syncManager.GetHashesBetween(stagingArea, lowHash, highHash, maxBlocks)
|
||||
return s.syncManager.GetHashesBetween(stagingArea, lowHash, highHash, maxBlueScoreDifference)
|
||||
}
|
||||
|
||||
func (s *consensus) GetMissingBlockBodyHashes(highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
|
||||
@@ -314,7 +314,6 @@ func (f *factory) NewConsensus(config *Config, db infrastructuredatabase.Databas
|
||||
syncManager := syncmanager.New(
|
||||
dbManager,
|
||||
genesisHash,
|
||||
config.MergeSetSizeLimit,
|
||||
dagTraversalManager,
|
||||
dagTopologyManager,
|
||||
ghostdagManager,
|
||||
|
||||
@@ -13,7 +13,7 @@ type Consensus interface {
|
||||
GetBlockRelations(blockHash *DomainHash) (parents []*DomainHash, selectedParent *DomainHash, children []*DomainHash, err error)
|
||||
GetBlockAcceptanceData(blockHash *DomainHash) (AcceptanceData, error)
|
||||
|
||||
GetHashesBetween(lowHash, highHash *DomainHash, maxBlocks uint64) (hashes []*DomainHash, actualHighHash *DomainHash, err error)
|
||||
GetHashesBetween(lowHash, highHash *DomainHash, maxBlueScoreDifference uint64) (hashes []*DomainHash, actualHighHash *DomainHash, err error)
|
||||
GetMissingBlockBodyHashes(highHash *DomainHash) ([]*DomainHash, error)
|
||||
GetPruningPointUTXOs(expectedPruningPointHash *DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||
GetVirtualUTXOs(expectedVirtualParents []*DomainHash, fromOutpoint *DomainOutpoint, limit int) ([]*OutpointAndUTXOEntryPair, error)
|
||||
|
||||
@@ -4,7 +4,7 @@ import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
||||
|
||||
// SyncManager exposes functions to support sync between kaspad nodes
|
||||
type SyncManager interface {
|
||||
GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlocks uint64) (
|
||||
GetHashesBetween(stagingArea *StagingArea, lowHash, highHash *externalapi.DomainHash, maxBlueScoreDifference uint64) (
|
||||
hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error)
|
||||
GetMissingBlockBodyHashes(stagingArea *StagingArea, highHash *externalapi.DomainHash) (
|
||||
[]*externalapi.DomainHash, error)
|
||||
|
||||
@@ -7,19 +7,11 @@ import (
|
||||
)
|
||||
|
||||
// antiPastHashesBetween returns the hashes of the blocks between the
|
||||
// lowHash's antiPast and highHash's antiPast, or up to `maxBlocks`, if non-zero.
|
||||
// lowHash's antiPast and highHash's antiPast, or up to
|
||||
// `maxBlueScoreDifference`, if non-zero.
|
||||
// The result excludes lowHash and includes highHash. If lowHash == highHash, returns nothing.
|
||||
// If maxBlocks != 0 then maxBlocks MUST be >= MergeSetSizeLimit + 1
|
||||
// because it returns blocks with MergeSet granularity,
|
||||
// so if MergeSet > maxBlocks, function will return nothing
|
||||
func (sm *syncManager) antiPastHashesBetween(stagingArea *model.StagingArea, lowHash, highHash *externalapi.DomainHash,
|
||||
maxBlocks uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
|
||||
// Sanity check, for debugging only
|
||||
if maxBlocks != 0 && maxBlocks < sm.mergeSetSizeLimit+1 {
|
||||
return nil, nil,
|
||||
errors.Errorf("maxBlocks (%d) MUST be >= MergeSetSizeLimit + 1 (%d)", maxBlocks, sm.mergeSetSizeLimit+1)
|
||||
}
|
||||
maxBlueScoreDifference uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
|
||||
// If lowHash is not in the selectedParentChain of highHash - SelectedChildIterator will fail.
|
||||
// Therefore, we traverse down lowHash's selectedParentChain until we reach a block that is in
|
||||
@@ -44,6 +36,23 @@ func (sm *syncManager) antiPastHashesBetween(stagingArea *model.StagingArea, low
|
||||
lowBlockGHOSTDAGData.BlueScore(), highBlockGHOSTDAGData.BlueScore())
|
||||
}
|
||||
|
||||
if maxBlueScoreDifference != 0 {
|
||||
// In order to get no more then maxBlueScoreDifference
|
||||
// blocks from the future of the lowHash (including itself),
|
||||
// we iterate the selected parent chain of the highNode and
|
||||
// stop once we reach
|
||||
// highBlockBlueScore-lowBlockBlueScore+1 <= maxBlueScoreDifference.
|
||||
// That stop point becomes the new highHash.
|
||||
// Using blueScore as an approximation is considered to be
|
||||
// fairly accurate because we presume that most DAG blocks are
|
||||
// blue.
|
||||
highHash, err = sm.findHighHashAccordingToMaxBlueScoreDifference(stagingArea,
|
||||
lowHash, highHash, maxBlueScoreDifference, highBlockGHOSTDAGData, lowBlockGHOSTDAGData)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// Collect all hashes by concatenating the merge-sets of all blocks between highHash and lowHash
|
||||
blockHashes := []*externalapi.DomainHash{}
|
||||
iterator, err := sm.dagTraversalManager.SelectedChildIterator(stagingArea, highHash, lowHash)
|
||||
@@ -67,12 +76,6 @@ func (sm *syncManager) antiPastHashesBetween(stagingArea *model.StagingArea, low
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if maxBlocks != 0 && uint64(len(blockHashes)+len(sortedMergeSet)) > maxBlocks {
|
||||
break
|
||||
}
|
||||
|
||||
highHash = current
|
||||
|
||||
// append to blockHashes all blocks in sortedMergeSet which are not in the past of originalLowHash
|
||||
for _, blockHash := range sortedMergeSet {
|
||||
isInPastOfOriginalLowHash, err := sm.dagTopologyManager.IsAncestorOf(stagingArea, blockHash, originalLowHash)
|
||||
@@ -133,6 +136,37 @@ func (sm *syncManager) getSortedMergeSet(stagingArea *model.StagingArea, current
|
||||
return sortedMergeSet, nil
|
||||
}
|
||||
|
||||
func (sm *syncManager) findHighHashAccordingToMaxBlueScoreDifference(stagingArea *model.StagingArea,
|
||||
lowHash *externalapi.DomainHash, highHash *externalapi.DomainHash, maxBlueScoreDifference uint64,
|
||||
highBlockGHOSTDAGData *model.BlockGHOSTDAGData, lowBlockGHOSTDAGData *model.BlockGHOSTDAGData) (
|
||||
*externalapi.DomainHash, error) {
|
||||
|
||||
if highBlockGHOSTDAGData.BlueScore()-lowBlockGHOSTDAGData.BlueScore() <= maxBlueScoreDifference {
|
||||
return highHash, nil
|
||||
}
|
||||
|
||||
iterator, err := sm.dagTraversalManager.SelectedChildIterator(stagingArea, highHash, lowHash)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer iterator.Close()
|
||||
for ok := iterator.First(); ok; ok = iterator.Next() {
|
||||
highHashCandidate, err := iterator.Get()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
highBlockGHOSTDAGData, err = sm.ghostdagDataStore.Get(sm.databaseContext, stagingArea, highHashCandidate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if highBlockGHOSTDAGData.BlueScore()-lowBlockGHOSTDAGData.BlueScore() > maxBlueScoreDifference {
|
||||
break
|
||||
}
|
||||
highHash = highHashCandidate
|
||||
}
|
||||
return highHash, nil
|
||||
}
|
||||
|
||||
func (sm *syncManager) findLowHashInHighHashSelectedParentChain(stagingArea *model.StagingArea,
|
||||
lowHash *externalapi.DomainHash, highHash *externalapi.DomainHash) (*externalapi.DomainHash, error) {
|
||||
for {
|
||||
|
||||
@@ -21,15 +21,12 @@ type syncManager struct {
|
||||
blockStore model.BlockStore
|
||||
pruningStore model.PruningStore
|
||||
headersSelectedChainStore model.HeadersSelectedChainStore
|
||||
|
||||
mergeSetSizeLimit uint64
|
||||
}
|
||||
|
||||
// New instantiates a new SyncManager
|
||||
func New(
|
||||
databaseContext model.DBReader,
|
||||
genesisBlockHash *externalapi.DomainHash,
|
||||
mergeSetSizeLimit uint64,
|
||||
dagTraversalManager model.DAGTraversalManager,
|
||||
dagTopologyManager model.DAGTopologyManager,
|
||||
ghostdagManager model.GHOSTDAGManager,
|
||||
@@ -61,12 +58,12 @@ func New(
|
||||
}
|
||||
|
||||
func (sm *syncManager) GetHashesBetween(stagingArea *model.StagingArea, lowHash, highHash *externalapi.DomainHash,
|
||||
maxBlocks uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
maxBlueScoreDifference uint64) (hashes []*externalapi.DomainHash, actualHighHash *externalapi.DomainHash, err error) {
|
||||
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "GetHashesBetween")
|
||||
defer onEnd()
|
||||
|
||||
return sm.antiPastHashesBetween(stagingArea, lowHash, highHash, maxBlocks)
|
||||
return sm.antiPastHashesBetween(stagingArea, lowHash, highHash, maxBlueScoreDifference)
|
||||
}
|
||||
|
||||
func (sm *syncManager) GetMissingBlockBodyHashes(stagingArea *model.StagingArea, highHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.12.3
|
||||
// source: messages.proto
|
||||
|
||||
package protowire
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -20,6 +21,10 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type KaspadMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -129,9 +134,6 @@ type KaspadMessage struct {
|
||||
// *KaspadMessage_PruningPointUTXOSetOverrideNotification
|
||||
// *KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideRequest
|
||||
// *KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideResponse
|
||||
// *KaspadMessage_NotifyVirtualDaaScoreChangedRequest
|
||||
// *KaspadMessage_NotifyVirtualDaaScoreChangedResponse
|
||||
// *KaspadMessage_VirtualDaaScoreChangedNotification
|
||||
Payload isKaspadMessage_Payload `protobuf_oneof:"payload"`
|
||||
}
|
||||
|
||||
@@ -895,27 +897,6 @@ func (x *KaspadMessage) GetStopNotifyingPruningPointUTXOSetOverrideResponse() *S
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetNotifyVirtualDaaScoreChangedRequest() *NotifyVirtualDaaScoreChangedRequestMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_NotifyVirtualDaaScoreChangedRequest); ok {
|
||||
return x.NotifyVirtualDaaScoreChangedRequest
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetNotifyVirtualDaaScoreChangedResponse() *NotifyVirtualDaaScoreChangedResponseMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_NotifyVirtualDaaScoreChangedResponse); ok {
|
||||
return x.NotifyVirtualDaaScoreChangedResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage) GetVirtualDaaScoreChangedNotification() *VirtualDaaScoreChangedNotificationMessage {
|
||||
if x, ok := x.GetPayload().(*KaspadMessage_VirtualDaaScoreChangedNotification); ok {
|
||||
return x.VirtualDaaScoreChangedNotification
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isKaspadMessage_Payload interface {
|
||||
isKaspadMessage_Payload()
|
||||
}
|
||||
@@ -1332,18 +1313,6 @@ type KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideResponse struct {
|
||||
StopNotifyingPruningPointUTXOSetOverrideResponse *StopNotifyingPruningPointUTXOSetOverrideResponseMessage `protobuf:"bytes,1071,opt,name=stopNotifyingPruningPointUTXOSetOverrideResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_NotifyVirtualDaaScoreChangedRequest struct {
|
||||
NotifyVirtualDaaScoreChangedRequest *NotifyVirtualDaaScoreChangedRequestMessage `protobuf:"bytes,1072,opt,name=notifyVirtualDaaScoreChangedRequest,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_NotifyVirtualDaaScoreChangedResponse struct {
|
||||
NotifyVirtualDaaScoreChangedResponse *NotifyVirtualDaaScoreChangedResponseMessage `protobuf:"bytes,1073,opt,name=notifyVirtualDaaScoreChangedResponse,proto3,oneof"`
|
||||
}
|
||||
|
||||
type KaspadMessage_VirtualDaaScoreChangedNotification struct {
|
||||
VirtualDaaScoreChangedNotification *VirtualDaaScoreChangedNotificationMessage `protobuf:"bytes,1074,opt,name=virtualDaaScoreChangedNotification,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*KaspadMessage_Addresses) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_Block) isKaspadMessage_Payload() {}
|
||||
@@ -1550,19 +1519,13 @@ func (*KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideRequest) isKaspadMe
|
||||
|
||||
func (*KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideResponse) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_NotifyVirtualDaaScoreChangedRequest) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_NotifyVirtualDaaScoreChangedResponse) isKaspadMessage_Payload() {}
|
||||
|
||||
func (*KaspadMessage_VirtualDaaScoreChangedNotification) isKaspadMessage_Payload() {}
|
||||
|
||||
var File_messages_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_messages_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x09, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x1a, 0x09, 0x70, 0x32, 0x70,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x09, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x22, 0xcb, 0x58, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x6f, 0x22, 0xa4, 0x55, 0x0a, 0x0d, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69,
|
||||
0x72, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73,
|
||||
@@ -2243,48 +2206,21 @@ var file_messages_proto_rawDesc = []byte{
|
||||
0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x30, 0x73, 0x74, 0x6f,
|
||||
0x70, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x75, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53, 0x65, 0x74, 0x4f, 0x76, 0x65,
|
||||
0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8a, 0x01,
|
||||
0x0a, 0x23, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44,
|
||||
0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0xb0, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56,
|
||||
0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x23, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72,
|
||||
0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e,
|
||||
0x67, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x8d, 0x01, 0x0a, 0x24, 0x6e,
|
||||
0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x18, 0xb1, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72,
|
||||
0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e,
|
||||
0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x48, 0x00, 0x52, 0x24, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72, 0x74,
|
||||
0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67,
|
||||
0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x22, 0x76,
|
||||
0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x18, 0xb2, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x2e, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53,
|
||||
0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66,
|
||||
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00,
|
||||
0x52, 0x22, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32,
|
||||
0x50, 0x0a, 0x03, 0x50, 0x32, 0x50, 0x12, 0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77,
|
||||
0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||
0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61,
|
||||
0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30,
|
||||
0x01, 0x32, 0x50, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e,
|
||||
0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28,
|
||||
0x01, 0x30, 0x01, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61,
|
||||
0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a,
|
||||
0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0x50, 0x0a, 0x03, 0x50, 0x32, 0x50, 0x12,
|
||||
0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||
0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73,
|
||||
0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x50, 0x0a, 0x03, 0x52, 0x50,
|
||||
0x43, 0x12, 0x49, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65,
|
||||
0x61, 0x6d, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b,
|
||||
0x61, 0x73, 0x70, 0x61, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x4b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x4d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x26, 0x5a, 0x24,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61,
|
||||
0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x61, 0x73, 0x70, 0x61, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x77, 0x69, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -2404,9 +2340,6 @@ var file_messages_proto_goTypes = []interface{}{
|
||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 100: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 101: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 102: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 103: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 104: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 105: protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
}
|
||||
var file_messages_proto_depIdxs = []int32{
|
||||
1, // 0: protowire.KaspadMessage.addresses:type_name -> protowire.AddressesMessage
|
||||
@@ -2512,18 +2445,15 @@ var file_messages_proto_depIdxs = []int32{
|
||||
100, // 100: protowire.KaspadMessage.pruningPointUTXOSetOverrideNotification:type_name -> protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
101, // 101: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideRequest:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
102, // 102: protowire.KaspadMessage.stopNotifyingPruningPointUTXOSetOverrideResponse:type_name -> protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
103, // 103: protowire.KaspadMessage.notifyVirtualDaaScoreChangedRequest:type_name -> protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
104, // 104: protowire.KaspadMessage.notifyVirtualDaaScoreChangedResponse:type_name -> protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
105, // 105: protowire.KaspadMessage.virtualDaaScoreChangedNotification:type_name -> protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
0, // 106: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 107: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 108: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 109: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
108, // [108:110] is the sub-list for method output_type
|
||||
106, // [106:108] is the sub-list for method input_type
|
||||
106, // [106:106] is the sub-list for extension type_name
|
||||
106, // [106:106] is the sub-list for extension extendee
|
||||
0, // [0:106] is the sub-list for field type_name
|
||||
0, // 103: protowire.P2P.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 104: protowire.RPC.MessageStream:input_type -> protowire.KaspadMessage
|
||||
0, // 105: protowire.P2P.MessageStream:output_type -> protowire.KaspadMessage
|
||||
0, // 106: protowire.RPC.MessageStream:output_type -> protowire.KaspadMessage
|
||||
105, // [105:107] is the sub-list for method output_type
|
||||
103, // [103:105] is the sub-list for method input_type
|
||||
103, // [103:103] is the sub-list for extension type_name
|
||||
103, // [103:103] is the sub-list for extension extendee
|
||||
0, // [0:103] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_messages_proto_init() }
|
||||
@@ -2651,9 +2581,6 @@ func file_messages_proto_init() {
|
||||
(*KaspadMessage_PruningPointUTXOSetOverrideNotification)(nil),
|
||||
(*KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideRequest)(nil),
|
||||
(*KaspadMessage_StopNotifyingPruningPointUTXOSetOverrideResponse)(nil),
|
||||
(*KaspadMessage_NotifyVirtualDaaScoreChangedRequest)(nil),
|
||||
(*KaspadMessage_NotifyVirtualDaaScoreChangedResponse)(nil),
|
||||
(*KaspadMessage_VirtualDaaScoreChangedNotification)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
|
||||
@@ -112,9 +112,6 @@ message KaspadMessage {
|
||||
PruningPointUTXOSetOverrideNotificationMessage pruningPointUTXOSetOverrideNotification = 1069;
|
||||
StopNotifyingPruningPointUTXOSetOverrideRequestMessage stopNotifyingPruningPointUTXOSetOverrideRequest = 1070;
|
||||
StopNotifyingPruningPointUTXOSetOverrideResponseMessage stopNotifyingPruningPointUTXOSetOverrideResponse = 1071;
|
||||
NotifyVirtualDaaScoreChangedRequestMessage notifyVirtualDaaScoreChangedRequest = 1072;
|
||||
NotifyVirtualDaaScoreChangedResponseMessage notifyVirtualDaaScoreChangedResponse = 1073;
|
||||
VirtualDaaScoreChangedNotificationMessage virtualDaaScoreChangedNotification = 1074;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
const _ = grpc.SupportPackageIsVersion6
|
||||
|
||||
// P2PClient is the client API for P2P service.
|
||||
//
|
||||
@@ -30,7 +29,7 @@ func NewP2PClient(cc grpc.ClientConnInterface) P2PClient {
|
||||
}
|
||||
|
||||
func (c *p2PClient) MessageStream(ctx context.Context, opts ...grpc.CallOption) (P2P_MessageStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &P2P_ServiceDesc.Streams[0], "/protowire.P2P/MessageStream", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &_P2P_serviceDesc.Streams[0], "/protowire.P2P/MessageStream", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -72,20 +71,13 @@ type P2PServer interface {
|
||||
type UnimplementedP2PServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedP2PServer) MessageStream(P2P_MessageStreamServer) error {
|
||||
func (*UnimplementedP2PServer) MessageStream(P2P_MessageStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method MessageStream not implemented")
|
||||
}
|
||||
func (UnimplementedP2PServer) mustEmbedUnimplementedP2PServer() {}
|
||||
func (*UnimplementedP2PServer) mustEmbedUnimplementedP2PServer() {}
|
||||
|
||||
// UnsafeP2PServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to P2PServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeP2PServer interface {
|
||||
mustEmbedUnimplementedP2PServer()
|
||||
}
|
||||
|
||||
func RegisterP2PServer(s grpc.ServiceRegistrar, srv P2PServer) {
|
||||
s.RegisterService(&P2P_ServiceDesc, srv)
|
||||
func RegisterP2PServer(s *grpc.Server, srv P2PServer) {
|
||||
s.RegisterService(&_P2P_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _P2P_MessageStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
@@ -114,10 +106,7 @@ func (x *p2PMessageStreamServer) Recv() (*KaspadMessage, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// P2P_ServiceDesc is the grpc.ServiceDesc for P2P service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var P2P_ServiceDesc = grpc.ServiceDesc{
|
||||
var _P2P_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "protowire.P2P",
|
||||
HandlerType: (*P2PServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
@@ -148,7 +137,7 @@ func NewRPCClient(cc grpc.ClientConnInterface) RPCClient {
|
||||
}
|
||||
|
||||
func (c *rPCClient) MessageStream(ctx context.Context, opts ...grpc.CallOption) (RPC_MessageStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &RPC_ServiceDesc.Streams[0], "/protowire.RPC/MessageStream", opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &_RPC_serviceDesc.Streams[0], "/protowire.RPC/MessageStream", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -190,20 +179,13 @@ type RPCServer interface {
|
||||
type UnimplementedRPCServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedRPCServer) MessageStream(RPC_MessageStreamServer) error {
|
||||
func (*UnimplementedRPCServer) MessageStream(RPC_MessageStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method MessageStream not implemented")
|
||||
}
|
||||
func (UnimplementedRPCServer) mustEmbedUnimplementedRPCServer() {}
|
||||
func (*UnimplementedRPCServer) mustEmbedUnimplementedRPCServer() {}
|
||||
|
||||
// UnsafeRPCServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RPCServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRPCServer interface {
|
||||
mustEmbedUnimplementedRPCServer()
|
||||
}
|
||||
|
||||
func RegisterRPCServer(s grpc.ServiceRegistrar, srv RPCServer) {
|
||||
s.RegisterService(&RPC_ServiceDesc, srv)
|
||||
func RegisterRPCServer(s *grpc.Server, srv RPCServer) {
|
||||
s.RegisterService(&_RPC_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _RPC_MessageStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
@@ -232,10 +214,7 @@ func (x *rPCMessageStreamServer) Recv() (*KaspadMessage, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// RPC_ServiceDesc is the grpc.ServiceDesc for RPC service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RPC_ServiceDesc = grpc.ServiceDesc{
|
||||
var _RPC_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "protowire.RPC",
|
||||
HandlerType: (*RPCServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.12.3
|
||||
// source: p2p.proto
|
||||
|
||||
package protowire
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -20,6 +21,10 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type RequestAddressesMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
||||
@@ -4,42 +4,32 @@
|
||||
## Table of Contents
|
||||
|
||||
- [rpc.proto](#rpc.proto)
|
||||
- [RPCError](#protowire.RPCError)
|
||||
- [RpcBlock](#protowire.RpcBlock)
|
||||
- [RpcBlockHeader](#protowire.RpcBlockHeader)
|
||||
- [RpcBlockVerboseData](#protowire.RpcBlockVerboseData)
|
||||
- [RpcTransaction](#protowire.RpcTransaction)
|
||||
- [RpcTransactionInput](#protowire.RpcTransactionInput)
|
||||
- [RpcScriptPublicKey](#protowire.RpcScriptPublicKey)
|
||||
- [RpcTransactionOutput](#protowire.RpcTransactionOutput)
|
||||
- [RpcOutpoint](#protowire.RpcOutpoint)
|
||||
- [RpcUtxoEntry](#protowire.RpcUtxoEntry)
|
||||
- [RpcTransactionVerboseData](#protowire.RpcTransactionVerboseData)
|
||||
- [RpcTransactionInputVerboseData](#protowire.RpcTransactionInputVerboseData)
|
||||
- [RpcTransactionOutputVerboseData](#protowire.RpcTransactionOutputVerboseData)
|
||||
- [GetCurrentNetworkRequestMessage](#protowire.GetCurrentNetworkRequestMessage)
|
||||
- [GetCurrentNetworkResponseMessage](#protowire.GetCurrentNetworkResponseMessage)
|
||||
- [SubmitBlockRequestMessage](#protowire.SubmitBlockRequestMessage)
|
||||
- [SubmitBlockResponseMessage](#protowire.SubmitBlockResponseMessage)
|
||||
- [GetBlockTemplateRequestMessage](#protowire.GetBlockTemplateRequestMessage)
|
||||
- [GetBlockTemplateResponseMessage](#protowire.GetBlockTemplateResponseMessage)
|
||||
- [NotifyBlockAddedRequestMessage](#protowire.NotifyBlockAddedRequestMessage)
|
||||
- [NotifyBlockAddedResponseMessage](#protowire.NotifyBlockAddedResponseMessage)
|
||||
- [BlockAddedNotificationMessage](#protowire.BlockAddedNotificationMessage)
|
||||
- [GetPeerAddressesRequestMessage](#protowire.GetPeerAddressesRequestMessage)
|
||||
- [GetPeerAddressesResponseMessage](#protowire.GetPeerAddressesResponseMessage)
|
||||
- [GetPeerAddressesKnownAddressMessage](#protowire.GetPeerAddressesKnownAddressMessage)
|
||||
- [GetSelectedTipHashRequestMessage](#protowire.GetSelectedTipHashRequestMessage)
|
||||
- [GetSelectedTipHashResponseMessage](#protowire.GetSelectedTipHashResponseMessage)
|
||||
- [GetMempoolEntryRequestMessage](#protowire.GetMempoolEntryRequestMessage)
|
||||
- [GetMempoolEntryResponseMessage](#protowire.GetMempoolEntryResponseMessage)
|
||||
- [GetMempoolEntriesRequestMessage](#protowire.GetMempoolEntriesRequestMessage)
|
||||
- [GetMempoolEntriesResponseMessage](#protowire.GetMempoolEntriesResponseMessage)
|
||||
- [MempoolEntry](#protowire.MempoolEntry)
|
||||
- [GetConnectedPeerInfoRequestMessage](#protowire.GetConnectedPeerInfoRequestMessage)
|
||||
- [GetConnectedPeerInfoResponseMessage](#protowire.GetConnectedPeerInfoResponseMessage)
|
||||
- [GetConnectedPeerInfoMessage](#protowire.GetConnectedPeerInfoMessage)
|
||||
- [AddPeerRequestMessage](#protowire.AddPeerRequestMessage)
|
||||
- [RPCError](#protowire.RPCError)
|
||||
- [GetCurrentNetworkRequestMessage](#protowire.GetCurrentNetworkRequestMessage)
|
||||
- [GetCurrentNetworkResponseMessage](#protowire.GetCurrentNetworkResponseMessage)
|
||||
- [SubmitBlockRequestMessage](#protowire.SubmitBlockRequestMessage)
|
||||
- [RpcBlock](#protowire.RpcBlock)
|
||||
- [RpcBlockHeader](#protowire.RpcBlockHeader)
|
||||
- [SubmitBlockResponseMessage](#protowire.SubmitBlockResponseMessage)
|
||||
- [GetBlockTemplateRequestMessage](#protowire.GetBlockTemplateRequestMessage)
|
||||
- [GetBlockTemplateResponseMessage](#protowire.GetBlockTemplateResponseMessage)
|
||||
- [NotifyBlockAddedRequestMessage](#protowire.NotifyBlockAddedRequestMessage)
|
||||
- [NotifyBlockAddedResponseMessage](#protowire.NotifyBlockAddedResponseMessage)
|
||||
- [BlockAddedNotificationMessage](#protowire.BlockAddedNotificationMessage)
|
||||
- [GetPeerAddressesRequestMessage](#protowire.GetPeerAddressesRequestMessage)
|
||||
- [GetPeerAddressesResponseMessage](#protowire.GetPeerAddressesResponseMessage)
|
||||
- [GetPeerAddressesKnownAddressMessage](#protowire.GetPeerAddressesKnownAddressMessage)
|
||||
- [GetSelectedTipHashRequestMessage](#protowire.GetSelectedTipHashRequestMessage)
|
||||
- [GetSelectedTipHashResponseMessage](#protowire.GetSelectedTipHashResponseMessage)
|
||||
- [GetMempoolEntryRequestMessage](#protowire.GetMempoolEntryRequestMessage)
|
||||
- [GetMempoolEntryResponseMessage](#protowire.GetMempoolEntryResponseMessage)
|
||||
- [GetMempoolEntriesRequestMessage](#protowire.GetMempoolEntriesRequestMessage)
|
||||
- [GetMempoolEntriesResponseMessage](#protowire.GetMempoolEntriesResponseMessage)
|
||||
- [MempoolEntry](#protowire.MempoolEntry)
|
||||
- [GetConnectedPeerInfoRequestMessage](#protowire.GetConnectedPeerInfoRequestMessage)
|
||||
- [GetConnectedPeerInfoResponseMessage](#protowire.GetConnectedPeerInfoResponseMessage)
|
||||
- [GetConnectedPeerInfoMessage](#protowire.GetConnectedPeerInfoMessage)
|
||||
- [AddPeerRequestMessage](#protowire.AddPeerRequestMessage)
|
||||
- [AddPeerResponseMessage](#protowire.AddPeerResponseMessage)
|
||||
- [SubmitTransactionRequestMessage](#protowire.SubmitTransactionRequestMessage)
|
||||
- [SubmitTransactionResponseMessage](#protowire.SubmitTransactionResponseMessage)
|
||||
@@ -50,6 +40,10 @@
|
||||
- [AcceptedBlock](#protowire.AcceptedBlock)
|
||||
- [GetBlockRequestMessage](#protowire.GetBlockRequestMessage)
|
||||
- [GetBlockResponseMessage](#protowire.GetBlockResponseMessage)
|
||||
- [BlockVerboseData](#protowire.BlockVerboseData)
|
||||
- [TransactionVerboseData](#protowire.TransactionVerboseData)
|
||||
- [TransactionVerboseInput](#protowire.TransactionVerboseInput)
|
||||
- [TransactionVerboseOutput](#protowire.TransactionVerboseOutput)
|
||||
- [GetSubnetworkRequestMessage](#protowire.GetSubnetworkRequestMessage)
|
||||
- [GetSubnetworkResponseMessage](#protowire.GetSubnetworkResponseMessage)
|
||||
- [GetVirtualSelectedParentChainFromBlockRequestMessage](#protowire.GetVirtualSelectedParentChainFromBlockRequestMessage)
|
||||
@@ -76,6 +70,12 @@
|
||||
- [UtxosByAddressesEntry](#protowire.UtxosByAddressesEntry)
|
||||
- [StopNotifyingUtxosChangedRequestMessage](#protowire.StopNotifyingUtxosChangedRequestMessage)
|
||||
- [StopNotifyingUtxosChangedResponseMessage](#protowire.StopNotifyingUtxosChangedResponseMessage)
|
||||
- [RpcTransaction](#protowire.RpcTransaction)
|
||||
- [RpcTransactionInput](#protowire.RpcTransactionInput)
|
||||
- [RpcScriptPublicKey](#protowire.RpcScriptPublicKey)
|
||||
- [RpcTransactionOutput](#protowire.RpcTransactionOutput)
|
||||
- [RpcOutpoint](#protowire.RpcOutpoint)
|
||||
- [RpcUtxoEntry](#protowire.RpcUtxoEntry)
|
||||
- [GetUtxosByAddressesRequestMessage](#protowire.GetUtxosByAddressesRequestMessage)
|
||||
- [GetUtxosByAddressesResponseMessage](#protowire.GetUtxosByAddressesResponseMessage)
|
||||
- [GetVirtualSelectedParentBlueScoreRequestMessage](#protowire.GetVirtualSelectedParentBlueScoreRequestMessage)
|
||||
@@ -83,9 +83,6 @@
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedRequestMessage](#protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)
|
||||
- [NotifyVirtualSelectedParentBlueScoreChangedResponseMessage](#protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)
|
||||
- [VirtualSelectedParentBlueScoreChangedNotificationMessage](#protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage)
|
||||
- [NotifyVirtualDaaScoreChangedRequestMessage](#protowire.NotifyVirtualDaaScoreChangedRequestMessage)
|
||||
- [NotifyVirtualDaaScoreChangedResponseMessage](#protowire.NotifyVirtualDaaScoreChangedResponseMessage)
|
||||
- [VirtualDaaScoreChangedNotificationMessage](#protowire.VirtualDaaScoreChangedNotificationMessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideRequestMessage](#protowire.NotifyPruningPointUTXOSetOverrideRequestMessage)
|
||||
- [NotifyPruningPointUTXOSetOverrideResponseMessage](#protowire.NotifyPruningPointUTXOSetOverrideResponseMessage)
|
||||
- [PruningPointUTXOSetOverrideNotificationMessage](#protowire.PruningPointUTXOSetOverrideNotificationMessage)
|
||||
@@ -135,218 +132,6 @@ Receivers of any ResponseMessage are expected to check whether its error field i
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcBlock"></a>
|
||||
|
||||
### RpcBlock
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| header | [RpcBlockHeader](#protowire.RpcBlockHeader) | | |
|
||||
| transactions | [RpcTransaction](#protowire.RpcTransaction) | repeated | |
|
||||
| verboseData | [RpcBlockVerboseData](#protowire.RpcBlockVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcBlockHeader"></a>
|
||||
|
||||
### RpcBlockHeader
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| parentHashes | [string](#string) | repeated | |
|
||||
| hashMerkleRoot | [string](#string) | | |
|
||||
| acceptedIdMerkleRoot | [string](#string) | | |
|
||||
| utxoCommitment | [string](#string) | | |
|
||||
| timestamp | [int64](#int64) | | |
|
||||
| bits | [uint32](#uint32) | | |
|
||||
| nonce | [uint64](#uint64) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcBlockVerboseData"></a>
|
||||
|
||||
### RpcBlockVerboseData
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| hash | [string](#string) | | |
|
||||
| difficulty | [double](#double) | | |
|
||||
| selectedParentHash | [string](#string) | | |
|
||||
| transactionIds | [string](#string) | repeated | |
|
||||
| isHeaderOnly | [bool](#bool) | | |
|
||||
| blueScore | [uint64](#uint64) | | |
|
||||
| childrenHashes | [string](#string) | repeated | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransaction"></a>
|
||||
|
||||
### RpcTransaction
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| inputs | [RpcTransactionInput](#protowire.RpcTransactionInput) | repeated | |
|
||||
| outputs | [RpcTransactionOutput](#protowire.RpcTransactionOutput) | repeated | |
|
||||
| lockTime | [uint64](#uint64) | | |
|
||||
| subnetworkId | [string](#string) | | |
|
||||
| gas | [uint64](#uint64) | | |
|
||||
| payload | [string](#string) | | |
|
||||
| verboseData | [RpcTransactionVerboseData](#protowire.RpcTransactionVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionInput"></a>
|
||||
|
||||
### RpcTransactionInput
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| previousOutpoint | [RpcOutpoint](#protowire.RpcOutpoint) | | |
|
||||
| signatureScript | [string](#string) | | |
|
||||
| sequence | [uint64](#uint64) | | |
|
||||
| verboseData | [RpcTransactionInputVerboseData](#protowire.RpcTransactionInputVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcScriptPublicKey"></a>
|
||||
|
||||
### RpcScriptPublicKey
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| scriptPublicKey | [string](#string) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionOutput"></a>
|
||||
|
||||
### RpcTransactionOutput
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| amount | [uint64](#uint64) | | |
|
||||
| scriptPublicKey | [RpcScriptPublicKey](#protowire.RpcScriptPublicKey) | | |
|
||||
| verboseData | [RpcTransactionOutputVerboseData](#protowire.RpcTransactionOutputVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcOutpoint"></a>
|
||||
|
||||
### RpcOutpoint
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| transactionId | [string](#string) | | |
|
||||
| index | [uint32](#uint32) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcUtxoEntry"></a>
|
||||
|
||||
### RpcUtxoEntry
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| amount | [uint64](#uint64) | | |
|
||||
| scriptPublicKey | [RpcScriptPublicKey](#protowire.RpcScriptPublicKey) | | |
|
||||
| blockDaaScore | [uint64](#uint64) | | |
|
||||
| isCoinbase | [bool](#bool) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionVerboseData"></a>
|
||||
|
||||
### RpcTransactionVerboseData
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| transactionId | [string](#string) | | |
|
||||
| hash | [string](#string) | | |
|
||||
| size | [uint64](#uint64) | | |
|
||||
| blockHash | [string](#string) | | |
|
||||
| blockTime | [uint64](#uint64) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionInputVerboseData"></a>
|
||||
|
||||
### RpcTransactionInputVerboseData
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionOutputVerboseData"></a>
|
||||
|
||||
### RpcTransactionOutputVerboseData
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| scriptPublicKeyType | [string](#string) | | |
|
||||
| scriptPublicKeyAddress | [string](#string) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.GetCurrentNetworkRequestMessage"></a>
|
||||
|
||||
### GetCurrentNetworkRequestMessage
|
||||
@@ -378,27 +163,44 @@ Possible networks are: Mainnet, Testnet, Simnet, Devnet
|
||||
<a name="protowire.SubmitBlockRequestMessage"></a>
|
||||
|
||||
### SubmitBlockRequestMessage
|
||||
SubmitBlockRequestMessage requests to submit a block into the DAG.
|
||||
Blocks are generally expected to have been generated using the getBlockTemplate call.
|
||||
|
||||
SubmitBlockRequestMessage requests to submit a block into the DAG. Blocks are generally expected to have been generated
|
||||
using the getBlockTemplate call.
|
||||
|
||||
See: GetBlockTemplateRequestMessage
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| block | [RpcBlock](#protowire.RpcBlock) | | |
|
||||
|
||||
<a name="protowire.RpcBlock"></a>
|
||||
|
||||
### RpcBlock
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| header | [RpcBlockHeader](#protowire.RpcBlockHeader) | | |
|
||||
| transactions | [RpcTransaction](#protowire.RpcTransaction) | repeated | |
|
||||
|
||||
<a name="protowire.RpcBlockHeader"></a>
|
||||
|
||||
### RpcBlockHeader
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| parentHashes | [string](#string) | repeated | |
|
||||
| hashMerkleRoot | [string](#string) | | |
|
||||
| acceptedIdMerkleRoot | [string](#string) | | |
|
||||
| utxoCommitment | [string](#string) | | |
|
||||
| timestamp | [int64](#int64) | | |
|
||||
| bits | [uint32](#uint32) | | |
|
||||
| nonce | [uint64](#uint64) | | |
|
||||
|
||||
<a name="protowire.SubmitBlockResponseMessage"></a>
|
||||
|
||||
### SubmitBlockResponseMessage
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| rejectReason | [SubmitBlockResponseMessage.RejectReason](#protowire.SubmitBlockResponseMessage.RejectReason) | | |
|
||||
@@ -482,7 +284,7 @@ See: NotifyBlockAddedRequestMessage
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| block | [RpcBlock](#protowire.RpcBlock) | | |
|
||||
| blockVerboseData | [BlockVerboseData](#protowire.BlockVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
@@ -627,7 +429,7 @@ currently in the mempool.
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| fee | [uint64](#uint64) | | |
|
||||
| transaction | [RpcTransaction](#protowire.RpcTransaction) | | |
|
||||
| transactionVerboseData | [TransactionVerboseData](#protowire.TransactionVerboseData) | | |
|
||||
|
||||
|
||||
|
||||
@@ -849,7 +651,8 @@ GetBlockRequestMessage requests information about a specific block
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| block | [RpcBlock](#protowire.RpcBlock) | | |
|
||||
| blockHash | [string](#string) | | |
|
||||
| blockVerboseData | [BlockVerboseData](#protowire.BlockVerboseData) | | |
|
||||
| error | [RPCError](#protowire.RPCError) | | |
|
||||
|
||||
|
||||
@@ -857,6 +660,75 @@ GetBlockRequestMessage requests information about a specific block
|
||||
|
||||
|
||||
|
||||
<a name="protowire.BlockVerboseData"></a>
|
||||
|
||||
### BlockVerboseData
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| hash | [string](#string) | | |
|
||||
| block | [RpcBlock](#protowire.RpcBlock) | | |
|
||||
| transactionVerboseData | [TransactionVerboseData](#protowire.TransactionVerboseData) | repeated | |
|
||||
| difficulty | [double](#double) | | |
|
||||
| childrenHashes | [string](#string) | repeated | |
|
||||
| selectedParentHash | [string](#string) | | |
|
||||
| transactionIDs | [string](#string) | repeated | |
|
||||
| isHeaderOnly | [bool](#bool) | | |
|
||||
| blueScore | [uint64](#uint64) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.TransactionVerboseData"></a>
|
||||
|
||||
### TransactionVerboseData
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| txId | [string](#string) | | |
|
||||
| hash | [string](#string) | | |
|
||||
| size | [uint64](#uint64) | | |
|
||||
| transactionVerboseInputs | [TransactionVerboseInput](#protowire.TransactionVerboseInput) | repeated | |
|
||||
| transactionVerboseOutputs | [TransactionVerboseOutput](#protowire.TransactionVerboseOutput) | repeated | |
|
||||
| blockHash | [string](#string) | | |
|
||||
| blockTime | [uint64](#uint64) | | |
|
||||
| transaction | [RpcTransaction](#protowire.RpcTransaction) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.TransactionVerboseInput"></a>
|
||||
|
||||
### TransactionVerboseInput
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.TransactionVerboseOutput"></a>
|
||||
|
||||
### TransactionVerboseOutput
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| scriptPublicKeyType | [string](#string) | | |
|
||||
| scriptPublicKeyAddress | [string](#string) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.GetSubnetworkRequestMessage"></a>
|
||||
|
||||
### GetSubnetworkRequestMessage
|
||||
@@ -933,7 +805,7 @@ kaspad's current virtual.
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| lowHash | [string](#string) | | |
|
||||
| includeBlocks | [bool](#bool) | | |
|
||||
| includeBlockVerboseData | [bool](#bool) | | |
|
||||
| includeTransactionVerboseData | [bool](#bool) | | |
|
||||
|
||||
|
||||
@@ -950,7 +822,7 @@ kaspad's current virtual.
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| blockHashes | [string](#string) | repeated | |
|
||||
| blocks | [RpcBlock](#protowire.RpcBlock) | repeated | |
|
||||
| blockVerboseData | [BlockVerboseData](#protowire.BlockVerboseData) | repeated | |
|
||||
| error | [RPCError](#protowire.RPCError) | | |
|
||||
|
||||
|
||||
@@ -1013,7 +885,6 @@ of this kaspad's DAG.
|
||||
| pastMedianTime | [int64](#int64) | | |
|
||||
| virtualParentHashes | [string](#string) | repeated | |
|
||||
| pruningPointHash | [string](#string) | | |
|
||||
| virtualDaaScore | [uint64](#uint64) | | |
|
||||
| error | [RPCError](#protowire.RPCError) | | |
|
||||
|
||||
|
||||
@@ -1270,6 +1141,110 @@ See: UtxosChangedNotificationMessage
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransaction"></a>
|
||||
|
||||
### RpcTransaction
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| inputs | [RpcTransactionInput](#protowire.RpcTransactionInput) | repeated | |
|
||||
| outputs | [RpcTransactionOutput](#protowire.RpcTransactionOutput) | repeated | |
|
||||
| lockTime | [uint64](#uint64) | | |
|
||||
| subnetworkId | [string](#string) | | |
|
||||
| gas | [uint64](#uint64) | | |
|
||||
| payload | [string](#string) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionInput"></a>
|
||||
|
||||
### RpcTransactionInput
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| previousOutpoint | [RpcOutpoint](#protowire.RpcOutpoint) | | |
|
||||
| signatureScript | [string](#string) | | |
|
||||
| sequence | [uint64](#uint64) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcScriptPublicKey"></a>
|
||||
|
||||
### RpcScriptPublicKey
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| version | [uint32](#uint32) | | |
|
||||
| scriptPublicKey | [string](#string) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcTransactionOutput"></a>
|
||||
|
||||
### RpcTransactionOutput
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| amount | [uint64](#uint64) | | |
|
||||
| scriptPublicKey | [RpcScriptPublicKey](#protowire.RpcScriptPublicKey) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcOutpoint"></a>
|
||||
|
||||
### RpcOutpoint
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| transactionId | [string](#string) | | |
|
||||
| index | [uint32](#uint32) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.RpcUtxoEntry"></a>
|
||||
|
||||
### RpcUtxoEntry
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| amount | [uint64](#uint64) | | |
|
||||
| scriptPublicKey | [RpcScriptPublicKey](#protowire.RpcScriptPublicKey) | | |
|
||||
| blockDaaScore | [uint64](#uint64) | | |
|
||||
| isCoinbase | [bool](#bool) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.GetUtxosByAddressesRequestMessage"></a>
|
||||
|
||||
### GetUtxosByAddressesRequestMessage
|
||||
@@ -1376,52 +1351,6 @@ See NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
|
||||
|
||||
|
||||
<a name="protowire.NotifyVirtualDaaScoreChangedRequestMessage"></a>
|
||||
|
||||
### NotifyVirtualDaaScoreChangedRequestMessage
|
||||
NotifyVirtualDaaScoreChangedRequestMessage registers this connection for
|
||||
virtualDaaScoreChanged notifications.
|
||||
|
||||
See: VirtualDaaScoreChangedNotificationMessage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.NotifyVirtualDaaScoreChangedResponseMessage"></a>
|
||||
|
||||
### NotifyVirtualDaaScoreChangedResponseMessage
|
||||
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| error | [RPCError](#protowire.RPCError) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.VirtualDaaScoreChangedNotificationMessage"></a>
|
||||
|
||||
### VirtualDaaScoreChangedNotificationMessage
|
||||
VirtualDaaScoreChangedNotificationMessage is sent whenever the DAA score
|
||||
of the virtual changes.
|
||||
|
||||
See NotifyVirtualDaaScoreChangedRequestMessage
|
||||
|
||||
|
||||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| virtualDaaScore | [uint64](#uint64) | | |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="protowire.NotifyPruningPointUTXOSetOverrideRequestMessage"></a>
|
||||
|
||||
### NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.12.3
|
||||
// source: rpc.proto
|
||||
|
||||
package protowire
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -30,6 +31,10 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type SubmitBlockResponseMessage_RejectReason int32
|
||||
|
||||
const (
|
||||
@@ -4481,146 +4486,6 @@ func (x *VirtualSelectedParentBlueScoreChangedNotificationMessage) GetVirtualSel
|
||||
return 0
|
||||
}
|
||||
|
||||
// NotifyVirtualDaaScoreChangedRequestMessage registers this connection for
|
||||
// virtualDaaScoreChanged notifications.
|
||||
//
|
||||
// See: VirtualDaaScoreChangedNotificationMessage
|
||||
type NotifyVirtualDaaScoreChangedRequestMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedRequestMessage) Reset() {
|
||||
*x = NotifyVirtualDaaScoreChangedRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[79]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedRequestMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NotifyVirtualDaaScoreChangedRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[79]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NotifyVirtualDaaScoreChangedRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyVirtualDaaScoreChangedRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{79}
|
||||
}
|
||||
|
||||
type NotifyVirtualDaaScoreChangedResponseMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Error *RPCError `protobuf:"bytes,1000,opt,name=error,proto3" json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedResponseMessage) Reset() {
|
||||
*x = NotifyVirtualDaaScoreChangedResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[80]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedResponseMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NotifyVirtualDaaScoreChangedResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[80]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NotifyVirtualDaaScoreChangedResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyVirtualDaaScoreChangedResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{80}
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedResponseMessage) GetError() *RPCError {
|
||||
if x != nil {
|
||||
return x.Error
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// VirtualDaaScoreChangedNotificationMessage is sent whenever the DAA score
|
||||
// of the virtual changes.
|
||||
//
|
||||
// See NotifyVirtualDaaScoreChangedRequestMessage
|
||||
type VirtualDaaScoreChangedNotificationMessage struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
VirtualDaaScore uint64 `protobuf:"varint,1,opt,name=virtualDaaScore,proto3" json:"virtualDaaScore,omitempty"`
|
||||
}
|
||||
|
||||
func (x *VirtualDaaScoreChangedNotificationMessage) Reset() {
|
||||
*x = VirtualDaaScoreChangedNotificationMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[81]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *VirtualDaaScoreChangedNotificationMessage) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*VirtualDaaScoreChangedNotificationMessage) ProtoMessage() {}
|
||||
|
||||
func (x *VirtualDaaScoreChangedNotificationMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[81]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use VirtualDaaScoreChangedNotificationMessage.ProtoReflect.Descriptor instead.
|
||||
func (*VirtualDaaScoreChangedNotificationMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{81}
|
||||
}
|
||||
|
||||
func (x *VirtualDaaScoreChangedNotificationMessage) GetVirtualDaaScore() uint64 {
|
||||
if x != nil {
|
||||
return x.VirtualDaaScore
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// NotifyPruningPointUTXOSetOverrideRequestMessage registers this connection for
|
||||
// pruning point UTXO set override notifications.
|
||||
//
|
||||
@@ -4636,7 +4501,7 @@ type NotifyPruningPointUTXOSetOverrideRequestMessage struct {
|
||||
func (x *NotifyPruningPointUTXOSetOverrideRequestMessage) Reset() {
|
||||
*x = NotifyPruningPointUTXOSetOverrideRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[82]
|
||||
mi := &file_rpc_proto_msgTypes[79]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4649,7 +4514,7 @@ func (x *NotifyPruningPointUTXOSetOverrideRequestMessage) String() string {
|
||||
func (*NotifyPruningPointUTXOSetOverrideRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyPruningPointUTXOSetOverrideRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[82]
|
||||
mi := &file_rpc_proto_msgTypes[79]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4662,7 +4527,7 @@ func (x *NotifyPruningPointUTXOSetOverrideRequestMessage) ProtoReflect() protore
|
||||
|
||||
// Deprecated: Use NotifyPruningPointUTXOSetOverrideRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyPruningPointUTXOSetOverrideRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{82}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{79}
|
||||
}
|
||||
|
||||
type NotifyPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
@@ -4676,7 +4541,7 @@ type NotifyPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) Reset() {
|
||||
*x = NotifyPruningPointUTXOSetOverrideResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[83]
|
||||
mi := &file_rpc_proto_msgTypes[80]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4689,7 +4554,7 @@ func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) String() string {
|
||||
func (*NotifyPruningPointUTXOSetOverrideResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[83]
|
||||
mi := &file_rpc_proto_msgTypes[80]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4702,7 +4567,7 @@ func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) ProtoReflect() protor
|
||||
|
||||
// Deprecated: Use NotifyPruningPointUTXOSetOverrideResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyPruningPointUTXOSetOverrideResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{83}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{80}
|
||||
}
|
||||
|
||||
func (x *NotifyPruningPointUTXOSetOverrideResponseMessage) GetError() *RPCError {
|
||||
@@ -4725,7 +4590,7 @@ type PruningPointUTXOSetOverrideNotificationMessage struct {
|
||||
func (x *PruningPointUTXOSetOverrideNotificationMessage) Reset() {
|
||||
*x = PruningPointUTXOSetOverrideNotificationMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[84]
|
||||
mi := &file_rpc_proto_msgTypes[81]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4738,7 +4603,7 @@ func (x *PruningPointUTXOSetOverrideNotificationMessage) String() string {
|
||||
func (*PruningPointUTXOSetOverrideNotificationMessage) ProtoMessage() {}
|
||||
|
||||
func (x *PruningPointUTXOSetOverrideNotificationMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[84]
|
||||
mi := &file_rpc_proto_msgTypes[81]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4751,7 +4616,7 @@ func (x *PruningPointUTXOSetOverrideNotificationMessage) ProtoReflect() protoref
|
||||
|
||||
// Deprecated: Use PruningPointUTXOSetOverrideNotificationMessage.ProtoReflect.Descriptor instead.
|
||||
func (*PruningPointUTXOSetOverrideNotificationMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{84}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{81}
|
||||
}
|
||||
|
||||
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage unregisters this connection for
|
||||
@@ -4769,7 +4634,7 @@ type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct {
|
||||
func (x *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) Reset() {
|
||||
*x = StopNotifyingPruningPointUTXOSetOverrideRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[85]
|
||||
mi := &file_rpc_proto_msgTypes[82]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4782,7 +4647,7 @@ func (x *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) String() string
|
||||
func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[85]
|
||||
mi := &file_rpc_proto_msgTypes[82]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4795,7 +4660,7 @@ func (x *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) ProtoReflect()
|
||||
|
||||
// Deprecated: Use StopNotifyingPruningPointUTXOSetOverrideRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*StopNotifyingPruningPointUTXOSetOverrideRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{85}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{82}
|
||||
}
|
||||
|
||||
type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
@@ -4809,7 +4674,7 @@ type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
func (x *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) Reset() {
|
||||
*x = StopNotifyingPruningPointUTXOSetOverrideResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[86]
|
||||
mi := &file_rpc_proto_msgTypes[83]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4822,7 +4687,7 @@ func (x *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) String() strin
|
||||
func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[86]
|
||||
mi := &file_rpc_proto_msgTypes[83]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4835,7 +4700,7 @@ func (x *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) ProtoReflect()
|
||||
|
||||
// Deprecated: Use StopNotifyingPruningPointUTXOSetOverrideResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*StopNotifyingPruningPointUTXOSetOverrideResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{86}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{83}
|
||||
}
|
||||
|
||||
func (x *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) GetError() *RPCError {
|
||||
@@ -4857,7 +4722,7 @@ type BanRequestMessage struct {
|
||||
func (x *BanRequestMessage) Reset() {
|
||||
*x = BanRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[87]
|
||||
mi := &file_rpc_proto_msgTypes[84]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4870,7 +4735,7 @@ func (x *BanRequestMessage) String() string {
|
||||
func (*BanRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *BanRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[87]
|
||||
mi := &file_rpc_proto_msgTypes[84]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4883,7 +4748,7 @@ func (x *BanRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use BanRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*BanRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{87}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{84}
|
||||
}
|
||||
|
||||
func (x *BanRequestMessage) GetIp() string {
|
||||
@@ -4904,7 +4769,7 @@ type BanResponseMessage struct {
|
||||
func (x *BanResponseMessage) Reset() {
|
||||
*x = BanResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[88]
|
||||
mi := &file_rpc_proto_msgTypes[85]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4917,7 +4782,7 @@ func (x *BanResponseMessage) String() string {
|
||||
func (*BanResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *BanResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[88]
|
||||
mi := &file_rpc_proto_msgTypes[85]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4930,7 +4795,7 @@ func (x *BanResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use BanResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*BanResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{88}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{85}
|
||||
}
|
||||
|
||||
func (x *BanResponseMessage) GetError() *RPCError {
|
||||
@@ -4952,7 +4817,7 @@ type UnbanRequestMessage struct {
|
||||
func (x *UnbanRequestMessage) Reset() {
|
||||
*x = UnbanRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[89]
|
||||
mi := &file_rpc_proto_msgTypes[86]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -4965,7 +4830,7 @@ func (x *UnbanRequestMessage) String() string {
|
||||
func (*UnbanRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *UnbanRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[89]
|
||||
mi := &file_rpc_proto_msgTypes[86]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -4978,7 +4843,7 @@ func (x *UnbanRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use UnbanRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*UnbanRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{89}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{86}
|
||||
}
|
||||
|
||||
func (x *UnbanRequestMessage) GetIp() string {
|
||||
@@ -4999,7 +4864,7 @@ type UnbanResponseMessage struct {
|
||||
func (x *UnbanResponseMessage) Reset() {
|
||||
*x = UnbanResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[90]
|
||||
mi := &file_rpc_proto_msgTypes[87]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -5012,7 +4877,7 @@ func (x *UnbanResponseMessage) String() string {
|
||||
func (*UnbanResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *UnbanResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[90]
|
||||
mi := &file_rpc_proto_msgTypes[87]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -5025,7 +4890,7 @@ func (x *UnbanResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use UnbanResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*UnbanResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{90}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{87}
|
||||
}
|
||||
|
||||
func (x *UnbanResponseMessage) GetError() *RPCError {
|
||||
@@ -5045,7 +4910,7 @@ type GetInfoRequestMessage struct {
|
||||
func (x *GetInfoRequestMessage) Reset() {
|
||||
*x = GetInfoRequestMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[91]
|
||||
mi := &file_rpc_proto_msgTypes[88]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -5058,7 +4923,7 @@ func (x *GetInfoRequestMessage) String() string {
|
||||
func (*GetInfoRequestMessage) ProtoMessage() {}
|
||||
|
||||
func (x *GetInfoRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[91]
|
||||
mi := &file_rpc_proto_msgTypes[88]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -5071,7 +4936,7 @@ func (x *GetInfoRequestMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetInfoRequestMessage.ProtoReflect.Descriptor instead.
|
||||
func (*GetInfoRequestMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{91}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{88}
|
||||
}
|
||||
|
||||
type GetInfoResponseMessage struct {
|
||||
@@ -5087,7 +4952,7 @@ type GetInfoResponseMessage struct {
|
||||
func (x *GetInfoResponseMessage) Reset() {
|
||||
*x = GetInfoResponseMessage{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rpc_proto_msgTypes[92]
|
||||
mi := &file_rpc_proto_msgTypes[89]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@@ -5100,7 +4965,7 @@ func (x *GetInfoResponseMessage) String() string {
|
||||
func (*GetInfoResponseMessage) ProtoMessage() {}
|
||||
|
||||
func (x *GetInfoResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rpc_proto_msgTypes[92]
|
||||
mi := &file_rpc_proto_msgTypes[89]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@@ -5113,7 +4978,7 @@ func (x *GetInfoResponseMessage) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use GetInfoResponseMessage.ProtoReflect.Descriptor instead.
|
||||
func (*GetInfoResponseMessage) Descriptor() ([]byte, []int) {
|
||||
return file_rpc_proto_rawDescGZIP(), []int{92}
|
||||
return file_rpc_proto_rawDescGZIP(), []int{89}
|
||||
}
|
||||
|
||||
func (x *GetInfoResponseMessage) GetP2PId() string {
|
||||
@@ -5718,20 +5583,6 @@ var file_rpc_proto_rawDesc = []byte{
|
||||
0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x75, 0x65, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1e, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x53, 0x65,
|
||||
0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x42, 0x6c, 0x75, 0x65,
|
||||
0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x2c, 0x0a, 0x2a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56,
|
||||
0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68,
|
||||
0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x22, 0x59, 0x0a, 0x2b, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x56, 0x69, 0x72,
|
||||
0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x68, 0x61, 0x6e,
|
||||
0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
||||
0x67, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0xe8, 0x07, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x77, 0x69, 0x72, 0x65, 0x2e, 0x52,
|
||||
0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x55,
|
||||
0x0a, 0x29, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72,
|
||||
0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x76,
|
||||
0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x44, 0x61, 0x61,
|
||||
0x53, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x31, 0x0a, 0x2f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x50,
|
||||
0x72, 0x75, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x55, 0x54, 0x58, 0x4f, 0x53,
|
||||
0x65, 0x74, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
@@ -5796,7 +5647,7 @@ func file_rpc_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_rpc_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 93)
|
||||
var file_rpc_proto_msgTypes = make([]protoimpl.MessageInfo, 90)
|
||||
var file_rpc_proto_goTypes = []interface{}{
|
||||
(SubmitBlockResponseMessage_RejectReason)(0), // 0: protowire.SubmitBlockResponseMessage.RejectReason
|
||||
(*RPCError)(nil), // 1: protowire.RPCError
|
||||
@@ -5878,20 +5729,17 @@ var file_rpc_proto_goTypes = []interface{}{
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)(nil), // 77: protowire.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage
|
||||
(*NotifyVirtualSelectedParentBlueScoreChangedResponseMessage)(nil), // 78: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage
|
||||
(*VirtualSelectedParentBlueScoreChangedNotificationMessage)(nil), // 79: protowire.VirtualSelectedParentBlueScoreChangedNotificationMessage
|
||||
(*NotifyVirtualDaaScoreChangedRequestMessage)(nil), // 80: protowire.NotifyVirtualDaaScoreChangedRequestMessage
|
||||
(*NotifyVirtualDaaScoreChangedResponseMessage)(nil), // 81: protowire.NotifyVirtualDaaScoreChangedResponseMessage
|
||||
(*VirtualDaaScoreChangedNotificationMessage)(nil), // 82: protowire.VirtualDaaScoreChangedNotificationMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 83: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 84: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 85: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 86: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 87: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
(*BanRequestMessage)(nil), // 88: protowire.BanRequestMessage
|
||||
(*BanResponseMessage)(nil), // 89: protowire.BanResponseMessage
|
||||
(*UnbanRequestMessage)(nil), // 90: protowire.UnbanRequestMessage
|
||||
(*UnbanResponseMessage)(nil), // 91: protowire.UnbanResponseMessage
|
||||
(*GetInfoRequestMessage)(nil), // 92: protowire.GetInfoRequestMessage
|
||||
(*GetInfoResponseMessage)(nil), // 93: protowire.GetInfoResponseMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideRequestMessage)(nil), // 80: protowire.NotifyPruningPointUTXOSetOverrideRequestMessage
|
||||
(*NotifyPruningPointUTXOSetOverrideResponseMessage)(nil), // 81: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage
|
||||
(*PruningPointUTXOSetOverrideNotificationMessage)(nil), // 82: protowire.PruningPointUTXOSetOverrideNotificationMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage)(nil), // 83: protowire.StopNotifyingPruningPointUTXOSetOverrideRequestMessage
|
||||
(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage)(nil), // 84: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage
|
||||
(*BanRequestMessage)(nil), // 85: protowire.BanRequestMessage
|
||||
(*BanResponseMessage)(nil), // 86: protowire.BanResponseMessage
|
||||
(*UnbanRequestMessage)(nil), // 87: protowire.UnbanRequestMessage
|
||||
(*UnbanResponseMessage)(nil), // 88: protowire.UnbanResponseMessage
|
||||
(*GetInfoRequestMessage)(nil), // 89: protowire.GetInfoRequestMessage
|
||||
(*GetInfoResponseMessage)(nil), // 90: protowire.GetInfoResponseMessage
|
||||
}
|
||||
var file_rpc_proto_depIdxs = []int32{
|
||||
3, // 0: protowire.RpcBlock.header:type_name -> protowire.RpcBlockHeader
|
||||
@@ -5953,17 +5801,16 @@ var file_rpc_proto_depIdxs = []int32{
|
||||
1, // 56: protowire.GetUtxosByAddressesResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 57: protowire.GetVirtualSelectedParentBlueScoreResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 58: protowire.NotifyVirtualSelectedParentBlueScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 59: protowire.NotifyVirtualDaaScoreChangedResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 60: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 61: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 62: protowire.BanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 63: protowire.UnbanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 64: protowire.GetInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
65, // [65:65] is the sub-list for method output_type
|
||||
65, // [65:65] is the sub-list for method input_type
|
||||
65, // [65:65] is the sub-list for extension type_name
|
||||
65, // [65:65] is the sub-list for extension extendee
|
||||
0, // [0:65] is the sub-list for field type_name
|
||||
1, // 59: protowire.NotifyPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 60: protowire.StopNotifyingPruningPointUTXOSetOverrideResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 61: protowire.BanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 62: protowire.UnbanResponseMessage.error:type_name -> protowire.RPCError
|
||||
1, // 63: protowire.GetInfoResponseMessage.error:type_name -> protowire.RPCError
|
||||
64, // [64:64] is the sub-list for method output_type
|
||||
64, // [64:64] is the sub-list for method input_type
|
||||
64, // [64:64] is the sub-list for extension type_name
|
||||
64, // [64:64] is the sub-list for extension extendee
|
||||
0, // [0:64] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rpc_proto_init() }
|
||||
@@ -6921,42 +6768,6 @@ func file_rpc_proto_init() {
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyVirtualDaaScoreChangedRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyVirtualDaaScoreChangedResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*VirtualDaaScoreChangedNotificationMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyPruningPointUTXOSetOverrideRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -6968,7 +6779,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyPruningPointUTXOSetOverrideResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -6980,7 +6791,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PruningPointUTXOSetOverrideNotificationMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -6992,7 +6803,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StopNotifyingPruningPointUTXOSetOverrideRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7004,7 +6815,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StopNotifyingPruningPointUTXOSetOverrideResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7016,7 +6827,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BanRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7028,7 +6839,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*BanResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7040,7 +6851,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UnbanRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7052,7 +6863,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*UnbanResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7064,7 +6875,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetInfoRequestMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7076,7 +6887,7 @@ func file_rpc_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rpc_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_rpc_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetInfoResponseMessage); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@@ -7095,7 +6906,7 @@ func file_rpc_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_rpc_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 93,
|
||||
NumMessages: 90,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
||||
@@ -528,25 +528,6 @@ message VirtualSelectedParentBlueScoreChangedNotificationMessage {
|
||||
uint64 virtualSelectedParentBlueScore = 1;
|
||||
}
|
||||
|
||||
// NotifyVirtualDaaScoreChangedRequestMessage registers this connection for
|
||||
// virtualDaaScoreChanged notifications.
|
||||
//
|
||||
// See: VirtualDaaScoreChangedNotificationMessage
|
||||
message NotifyVirtualDaaScoreChangedRequestMessage {
|
||||
}
|
||||
|
||||
message NotifyVirtualDaaScoreChangedResponseMessage {
|
||||
RPCError error = 1000;
|
||||
}
|
||||
|
||||
// VirtualDaaScoreChangedNotificationMessage is sent whenever the DAA score
|
||||
// of the virtual changes.
|
||||
//
|
||||
// See NotifyVirtualDaaScoreChangedRequestMessage
|
||||
message VirtualDaaScoreChangedNotificationMessage {
|
||||
uint64 virtualDaaScore = 1;
|
||||
}
|
||||
|
||||
// NotifyPruningPointUTXOSetOverrideRequestMessage registers this connection for
|
||||
// pruning point UTXO set override notifications.
|
||||
//
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package protowire
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (x *KaspadMessage_NotifyVirtualDaaScoreChangedRequest) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_NotifyVirtualDaaScoreChangedRequest is nil")
|
||||
}
|
||||
return &appmessage.NotifyVirtualDaaScoreChangedRequestMessage{}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_NotifyVirtualDaaScoreChangedRequest) fromAppMessage(_ *appmessage.NotifyVirtualDaaScoreChangedRequestMessage) error {
|
||||
x.NotifyVirtualDaaScoreChangedRequest = &NotifyVirtualDaaScoreChangedRequestMessage{}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_NotifyVirtualDaaScoreChangedResponse) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_NotifyVirtualDaaScoreChangedResponse is nil")
|
||||
}
|
||||
return x.NotifyVirtualDaaScoreChangedResponse.toAppMessage()
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_NotifyVirtualDaaScoreChangedResponse) fromAppMessage(message *appmessage.NotifyVirtualDaaScoreChangedResponseMessage) error {
|
||||
var err *RPCError
|
||||
if message.Error != nil {
|
||||
err = &RPCError{Message: message.Error.Message}
|
||||
}
|
||||
x.NotifyVirtualDaaScoreChangedResponse = &NotifyVirtualDaaScoreChangedResponseMessage{
|
||||
Error: err,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *NotifyVirtualDaaScoreChangedResponseMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "NotifyVirtualDaaScoreChangedResponseMessage is nil")
|
||||
}
|
||||
rpcErr, err := x.Error.toAppMessage()
|
||||
// Error is an optional field
|
||||
if err != nil && !errors.Is(err, errorNil) {
|
||||
return nil, err
|
||||
}
|
||||
return &appmessage.NotifyVirtualDaaScoreChangedResponseMessage{
|
||||
Error: rpcErr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_VirtualDaaScoreChangedNotification) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "KaspadMessage_VirtualDaaScoreChangedNotification is nil")
|
||||
}
|
||||
return x.VirtualDaaScoreChangedNotification.toAppMessage()
|
||||
}
|
||||
|
||||
func (x *KaspadMessage_VirtualDaaScoreChangedNotification) fromAppMessage(message *appmessage.VirtualDaaScoreChangedNotificationMessage) error {
|
||||
x.VirtualDaaScoreChangedNotification = &VirtualDaaScoreChangedNotificationMessage{
|
||||
VirtualDaaScore: message.VirtualDaaScore,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *VirtualDaaScoreChangedNotificationMessage) toAppMessage() (appmessage.Message, error) {
|
||||
if x == nil {
|
||||
return nil, errors.Wrapf(errorNil, "VirtualDaaScoreChangedNotificationMessage is nil")
|
||||
}
|
||||
return &appmessage.VirtualDaaScoreChangedNotificationMessage{
|
||||
VirtualDaaScore: x.VirtualDaaScore,
|
||||
}, nil
|
||||
}
|
||||
@@ -779,27 +779,6 @@ func toRPCPayload(message appmessage.Message) (isKaspadMessage_Payload, error) {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.NotifyVirtualDaaScoreChangedRequestMessage:
|
||||
payload := new(KaspadMessage_NotifyVirtualDaaScoreChangedRequest)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.NotifyVirtualDaaScoreChangedResponseMessage:
|
||||
payload := new(KaspadMessage_NotifyVirtualDaaScoreChangedResponse)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
case *appmessage.VirtualDaaScoreChangedNotificationMessage:
|
||||
payload := new(KaspadMessage_VirtualDaaScoreChangedNotification)
|
||||
err := payload.fromAppMessage(message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return payload, nil
|
||||
default:
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package rpcclient
|
||||
|
||||
import (
|
||||
"github.com/kaspanet/kaspad/app/appmessage"
|
||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// RegisterForVirtualDaaScoreChangedNotifications sends an RPC request respective to the function's
|
||||
// name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification
|
||||
// using the given handler function
|
||||
func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications(
|
||||
onVirtualDaaScoreChanged func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualDaaScoreChangedRequestMessage())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
response, err := c.route(appmessage.CmdNotifyVirtualDaaScoreChangedResponseMessage).DequeueWithTimeout(c.timeout)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
notifyVirtualDaaScoreChangedResponse := response.(*appmessage.NotifyVirtualDaaScoreChangedResponseMessage)
|
||||
if notifyVirtualDaaScoreChangedResponse.Error != nil {
|
||||
return c.convertRPCError(notifyVirtualDaaScoreChangedResponse.Error)
|
||||
}
|
||||
spawn("RegisterForVirtualDaaScoreChangedNotifications", func() {
|
||||
for {
|
||||
notification, err := c.route(appmessage.CmdVirtualDaaScoreChangedNotificationMessage).Dequeue()
|
||||
if err != nil {
|
||||
if errors.Is(err, routerpkg.ErrRouteClosed) {
|
||||
break
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
VirtualDaaScoreChangedNotification := notification.(*appmessage.VirtualDaaScoreChangedNotificationMessage)
|
||||
onVirtualDaaScoreChanged(VirtualDaaScoreChangedNotification)
|
||||
}
|
||||
})
|
||||
return nil
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) {
|
||||
func TestVirtualSelectedParentBlueScore(t *testing.T) {
|
||||
// Setup a single kaspad instance
|
||||
harnessParams := &harnessParams{
|
||||
p2pAddress: p2pAddress1,
|
||||
@@ -38,30 +38,15 @@ func TestVirtualSelectedParentBlueScoreAndVirtualDAAScore(t *testing.T) {
|
||||
"blue score change notifications: %s", err)
|
||||
}
|
||||
|
||||
// Register to virtual DAA score changes
|
||||
onVirtualDaaScoreChangedChan := make(chan *appmessage.VirtualDaaScoreChangedNotificationMessage)
|
||||
err = kaspad.rpcClient.RegisterForVirtualDaaScoreChangedNotifications(
|
||||
func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage) {
|
||||
onVirtualDaaScoreChangedChan <- notification
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to register for virtual DAA score change notifications: %s", err)
|
||||
}
|
||||
|
||||
// Mine some blocks and make sure that the notifications
|
||||
// report correct values
|
||||
// report correct blue score values
|
||||
const blockAmountToMine = 100
|
||||
for i := 0; i < blockAmountToMine; i++ {
|
||||
mineNextBlock(t, kaspad)
|
||||
blueScoreChangedNotification := <-onVirtualSelectedParentBlueScoreChangedChan
|
||||
if blueScoreChangedNotification.VirtualSelectedParentBlueScore != 1+uint64(i) {
|
||||
notification := <-onVirtualSelectedParentBlueScoreChangedChan
|
||||
if notification.VirtualSelectedParentBlueScore != 1+uint64(i) {
|
||||
t.Fatalf("Unexpected virtual selected parent blue score. Want: %d, got: %d",
|
||||
1+uint64(i), blueScoreChangedNotification.VirtualSelectedParentBlueScore)
|
||||
}
|
||||
daaScoreChangedNotification := <-onVirtualDaaScoreChangedChan
|
||||
if daaScoreChangedNotification.VirtualDaaScore > 1+uint64(i) {
|
||||
t.Fatalf("Unexpected virtual DAA score. Want: %d, got: %d",
|
||||
1+uint64(i), daaScoreChangedNotification.VirtualDaaScore)
|
||||
1+uint64(i), notification.VirtualSelectedParentBlueScore)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ const validCharacters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrs
|
||||
const (
|
||||
appMajor uint = 0
|
||||
appMinor uint = 10
|
||||
appPatch uint = 4
|
||||
appPatch uint = 2
|
||||
)
|
||||
|
||||
// appBuild is defined as a variable so it can be overridden during the build
|
||||
|
||||
Reference in New Issue
Block a user