Add more log for aws debugging

pull/69/head
Rongjian Lan 6 years ago
parent 888a865843
commit f6963f44af
  1. 4
      blockchain/utxopool.go
  2. 2
      client/client.go
  3. 4
      consensus/consensus_leader.go
  4. 3
      consensus/consensus_validator.go

@ -9,6 +9,7 @@ import (
"github.com/dedis/kyber/sign/schnorr"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/log"
"math/rand"
"sync"
)
@ -408,6 +409,9 @@ func (utxoPool *UTXOPool) SelectTransactionsForNewBlock(transactions []*Transact
err, crossShard := utxoPool.VerifyOneTransaction(tx, &spentTXOs)
if len(selected) < maxNumTxs {
if err != nil && rand.Intn(10) < 1 {
log.Warn("Invalid Transaction", "Reason", err)
}
if err == nil || crossShard {
if crossShard {
proof := CrossShardTxProof{Accept: err == nil, TxID: tx.ID, TxInput: getShardTxInput(tx, utxoPool.ShardID)}

@ -61,7 +61,7 @@ func (client *Client) handleProofOfLockMessage(proofs *[]blockchain.CrossShardTx
//fmt.Printf("PENDING CLIENT TX - %d\n", len(client.PendingCrossTxs))
// Loop through the newly received list of proofs
client.PendingCrossTxsMutex.Lock()
log.Info("CLIENT PENDING TX", "num", len(client.PendingCrossTxs))
log.Info("CLIENT PENDING CROSS TX", "num", len(client.PendingCrossTxs))
for _, proof := range *proofs {
// Find the corresponding pending cross tx
txAndProofs, ok := client.PendingCrossTxs[proof.TxID]

@ -168,6 +168,7 @@ func (consensus *Consensus) processCommitMessage(payload []byte, targetState Con
point := crypto.Ed25519Curve.Point()
point.UnmarshalBinary(commitment)
(*commitments)[validatorId] = point
consensus.Log.Debug("Received new commit message", "num", len(*commitments))
// Set the bitmap indicate this validate signed. TODO: figure out how to resolve the inconsistency of validators from commit and response messages
bitmap.SetKey(value.PubKey, true)
}
@ -177,7 +178,7 @@ func (consensus *Consensus) processCommitMessage(payload []byte, targetState Con
}
if len((*commitments)) >= len(consensus.publicKeys) && consensus.state < targetState {
consensus.Log.Debug("Enough commitments received with signatures", "num", len((*commitments)), "state", consensus.state)
consensus.Log.Debug("Enough commitments received with signatures", "num", len(*commitments), "state", consensus.state)
// Broadcast challenge
msgTypeToSend := proto_consensus.CHALLENGE // targetState == CHALLENGE_DONE
@ -297,6 +298,7 @@ func (consensus *Consensus) processResponseMessage(payload []byte, targetState C
shouldProcess = false
} else {
(*responses)[validatorId] = responseScalar
consensus.Log.Debug("Received new response message", "num", len(*responses))
// Set the bitmap indicate this validate signed. TODO: figure out how to resolve the inconsistency of validators from commit and response messages
consensus.bitmap.SetKey(value.PubKey, true)
}

@ -27,6 +27,7 @@ func (consensus *Consensus) ProcessMessageValidator(message []byte) {
consensus.Log.Error("Failed to get consensus message payload", "err", err, "consensus", consensus)
}
consensus.Log.Info("Received consensus Message", "type", msgType)
switch msgType {
case proto_consensus.ANNOUNCE:
consensus.processAnnounceMessage(payload)
@ -68,8 +69,6 @@ func (consensus *Consensus) processAnnounceMessage(payload []byte) {
offset += 64
//#### END: Read payload data
consensus.Log.Info("Received Announce Message", "LeaderId", leaderId)
copy(consensus.blockHash[:], blockHash[:])
// Verify block data

Loading…
Cancel
Save