Compare commits

...

2 Commits

Author SHA1 Message Date
Ori Newman
53706c2f9f bignet debug 2020-09-02 15:43:00 +03:00
Ori Newman
917fa11706 bignet debug 2020-09-02 14:53:38 +03:00
9 changed files with 36 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ func (*FlowContext) HandleError(err error, flowName string, isStopping *uint32,
panic(err)
}
log.Errorf("error from %s: %+v", flowName, err)
log.Errorf("error from %s: %s", flowName, err)
}
if atomic.AddUint32(isStopping, 1) == 1 {

View File

@@ -26,6 +26,7 @@ func (f *FlowContext) AddTransaction(tx *util.Tx) error {
f.transactionsToRebroadcast[*tx.ID()] = tx
inv := appmessage.NewMsgInvTransaction([]*daghash.TxID{tx.ID()})
log.Criticalf("~~~~~ FlowContext.AddTransaction() broadcasting %s", tx.ID())
return f.Broadcast(inv)
}

View File

@@ -48,6 +48,10 @@ func (flow *handleRelayedTransactionsFlow) start() error {
return err
}
for _, txID := range inv.TxIDs {
log.Criticalf("~~~~~ handleRelayedTransactionsFlow.start() got %s", txID)
}
requestedIDs, err := flow.requestInvTransactions(inv)
if err != nil {
return err
@@ -137,6 +141,7 @@ func (flow *handleRelayedTransactionsFlow) readInv() (*appmessage.MsgInvTransact
func (flow *handleRelayedTransactionsFlow) broadcastAcceptedTransactions(acceptedTxs []*mempool.TxDesc) error {
idsToBroadcast := make([]*daghash.TxID, len(acceptedTxs))
for i, tx := range acceptedTxs {
log.Criticalf("~~~~~ broadcastAcceptedTransactions() broadcasting %s", tx.Tx.ID())
idsToBroadcast[i] = tx.Tx.ID()
}
inv := appmessage.NewMsgInvTransaction(idsToBroadcast)
@@ -187,6 +192,7 @@ func (flow *handleRelayedTransactionsFlow) receiveTransactions(requestedTransact
continue
}
tx := util.NewTx(msgTx)
log.Criticalf("~~~~~ receiveTransactions() got %s", tx.ID())
if !tx.ID().IsEqual(expectedID) {
return protocolerrors.Errorf(true, "expected transaction %s, but got %s",
expectedID, tx.ID())

View File

@@ -30,6 +30,7 @@ func (flow *handleRequestedTransactionsFlow) start() error {
}
for _, transactionID := range msgRequestTransactions.IDs {
log.Criticalf("~~~~~ handleRequestedTransactionsFlow.start() tx %s was requested", transactionID)
tx, ok := flow.TxPool().FetchTransaction(transactionID)
if !ok {

View File

@@ -0,0 +1,9 @@
package relaytransactions
import (
"github.com/kaspanet/kaspad/infrastructure/logger"
"github.com/kaspanet/kaspad/util/panics"
)
var log, _ = logger.Get(logger.SubsystemTags.PROT)
var spawn = panics.GoroutineWrapperFunc(log)

View File

@@ -33,6 +33,10 @@ func (dag *BlockDAG) processBlockNoLock(block *util.Block, flags BehaviorFlags)
blockHash := block.Hash()
log.Tracef("Processing block %s", blockHash)
for _, tx := range block.Transactions() {
log.Criticalf("~~~~~ processBlockNoLock block %s tx %s", block.Hash(), tx.ID())
}
err = dag.checkDuplicateBlock(blockHash, flags)
if err != nil {
return false, false, err

View File

@@ -7,6 +7,7 @@ package mempool
import (
"container/list"
"fmt"
"runtime/debug"
"sync"
"sync/atomic"
"time"
@@ -498,6 +499,7 @@ func (mp *TxPool) removeTransactionWithDiff(tx *util.Tx, diff *blockdag.UTXODiff
txDesc, _ := mp.fetchTxDesc(txID)
if txDesc.depCount == 0 {
log.Criticalf("~~~~~ removeTransactionWithDiff delete %s stack %s", txID, debug.Stack())
delete(mp.pool, *txID)
} else {
delete(mp.depends, *txID)
@@ -571,6 +573,7 @@ func (mp *TxPool) processRemovedTransactionDependencies(tx *util.Tx) {
if _, ok := mp.depends[*txD.Tx.ID()]; ok {
delete(mp.depends, *txD.Tx.ID())
mp.pool[*txD.Tx.ID()] = txD
log.Criticalf("~~~~~ processRemovedTransactionDependencies adds %s stack %s", txD.Tx.ID(), debug.Stack())
}
}
}
@@ -652,6 +655,7 @@ func (mp *TxPool) addTransaction(tx *util.Tx, fee uint64, parentsInPool []*appme
}
if len(parentsInPool) == 0 {
log.Criticalf("~~~~~ addTransaction adds %s stack %s", tx.ID(), debug.Stack())
mp.pool[*tx.ID()] = txD
} else {
mp.depends[*tx.ID()] = txD

View File

@@ -29,6 +29,7 @@ func handleSendRawTransaction(s *Server, cmd interface{}, closeChan <-chan struc
}
tx := util.NewTx(&msgTx)
log.Criticalf("~~~~~ handleSendRawTransaction got %s", tx.ID())
err = s.protocolManager.AddTransaction(tx)
if err != nil {
if !errors.As(err, &mempool.RuleError{}) {

9
util/bigintpool/log.go Normal file
View File

@@ -0,0 +1,9 @@
package bigintpool
import (
"github.com/kaspanet/kaspad/infrastructure/logger"
"github.com/kaspanet/kaspad/util/panics"
)
var log, _ = logger.Get(logger.SubsystemTags.UTIL)
var spawn = panics.GoroutineWrapperFunc(log)