diff --git a/app/appmessage/rpc_get_block.go b/app/appmessage/rpc_get_block.go index 4e57406c5..91403402b 100644 --- a/app/appmessage/rpc_get_block.go +++ b/app/appmessage/rpc_get_block.go @@ -58,6 +58,7 @@ type BlockVerboseData struct { Difficulty float64 ParentHashes []string SelectedParentHash string + BlueScore uint64 } // TransactionVerboseData holds verbose data about a transaction diff --git a/app/protocol/flowcontext/orphans.go b/app/protocol/flowcontext/orphans.go index 08010e623..896059432 100644 --- a/app/protocol/flowcontext/orphans.go +++ b/app/protocol/flowcontext/orphans.go @@ -13,6 +13,8 @@ func (f *FlowContext) AddOrphan(orphanBlock *externalapi.DomainBlock) { orphanHash := consensusserialization.BlockHash(orphanBlock) f.orphans[*orphanHash] = orphanBlock + + log.Infof("Received a block with missing parents, adding to orphan pool: %s", orphanHash) } // UnorphanBlocks removes the block from the orphan set, and remove all of the blocks that are not orphans anymore. diff --git a/app/protocol/flows/blockrelay/handle_relay_invs.go b/app/protocol/flows/blockrelay/handle_relay_invs.go index 09cedc656..3f10eff38 100644 --- a/app/protocol/flows/blockrelay/handle_relay_invs.go +++ b/app/protocol/flows/blockrelay/handle_relay_invs.go @@ -249,6 +249,8 @@ func (flow *handleRelayInvsFlow) processAndRelayBlock(requestQueue *hashesQueueS return err } + log.Infof("Accepted block %s via relay", blockHash) + err = flow.StartIBDIfRequired() if err != nil { return err diff --git a/app/rpc/rpccontext/verbosedata.go b/app/rpc/rpccontext/verbosedata.go index c286d7d72..ad6dbd775 100644 --- a/app/rpc/rpccontext/verbosedata.go +++ b/app/rpc/rpccontext/verbosedata.go @@ -3,6 +3,7 @@ package rpccontext import ( "encoding/hex" "fmt" + "github.com/kaspanet/kaspad/domain/consensus/utils/blocks" "math/big" "strconv" @@ -25,6 +26,11 @@ func (ctx *Context) BuildBlockVerboseData(block *externalapi.DomainBlock, includ hash := consensusserialization.BlockHash(block) blockHeader := block.Header + blueScore, err := blocks.ExtractBlueScore(block) + if err != nil { + return nil, err + } + result := &appmessage.BlockVerboseData{ Hash: hash.String(), Version: blockHeader.Version, @@ -37,6 +43,7 @@ func (ctx *Context) BuildBlockVerboseData(block *externalapi.DomainBlock, includ Time: blockHeader.TimeInMilliseconds, Bits: strconv.FormatInt(int64(blockHeader.Bits), 16), Difficulty: ctx.GetDifficultyRatio(blockHeader.Bits, ctx.Config.ActiveNetParams), + BlueScore: blueScore, } txIDs := make([]string, len(block.Transactions)) diff --git a/app/rpc/rpchandlers/submit_block.go b/app/rpc/rpchandlers/submit_block.go index 728a099af..eca17c389 100644 --- a/app/rpc/rpchandlers/submit_block.go +++ b/app/rpc/rpchandlers/submit_block.go @@ -21,7 +21,7 @@ func HandleSubmitBlock(context *rpccontext.Context, _ *router.Router, request ap return errorMessage, nil } - log.Infof("Accepted domainBlock %s via submitBlock", consensusserialization.BlockHash(domainBlock)) + log.Infof("Accepted block %s via submitBlock", consensusserialization.BlockHash(domainBlock)) response := appmessage.NewSubmitBlockResponseMessage() return response, nil