From 88e4eec625d2df6a7e404d55314d6a7336b87388 Mon Sep 17 00:00:00 2001 From: Eugene Kim Date: Thu, 29 Aug 2019 20:38:57 -0700 Subject: [PATCH] Revert "Merge pull request #1455 from chaosma/master" This reverts commit 5d6e619a07562dfe9bbca9fb5bcab0c3349ab1ff, reversing changes made to df37360c3ae8e3674a260153bb2db1fad4e69963. --- consensus/consensus_v2.go | 2 +- core/blockchain.go | 4 +--- node/node_cross_shard.go | 2 +- node/node_newblock.go | 5 +---- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index a4f74f478..f0295c962 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -960,7 +960,7 @@ func (consensus *Consensus) tryCatchup() { if consensus.BlockVerifier == nil { // do nothing } else if err := consensus.BlockVerifier(block); err != nil { - consensus.getLogger().Info().Err(err).Msg("[TryCatchup]block verification faied") + consensus.getLogger().Info().Msg("[TryCatchup]block verification faied") return } diff --git a/core/blockchain.go b/core/blockchain.go index a033c566d..ba39b1c8e 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1150,9 +1150,7 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) { return n, errors.New("proposed cross links are not sorted") } for _, crossLink := range *crossLinks { - if err := bc.WriteCrossLinks(types.CrossLinks{crossLink}, false); err == nil { - utils.Logger().Info().Uint64("blockNum", crossLink.BlockNum().Uint64()).Uint32("shardID", crossLink.ShardID()).Msg("[InsertChain] Cross Link Added to Beaconchain") - } + bc.WriteCrossLinks(types.CrossLinks{crossLink}, false) bc.DeleteCrossLinks(types.CrossLinks{crossLink}, true) bc.WriteShardLastCrossLink(crossLink.ShardID(), crossLink) } diff --git a/node/node_cross_shard.go b/node/node_cross_shard.go index 35b5eebd0..2b560e567 100644 --- a/node/node_cross_shard.go +++ b/node/node_cross_shard.go @@ -282,6 +282,6 @@ func (node *Node) ProcessReceiptMessage(msgPayload []byte) { // TODO: remove in future if not useful node.Blockchain().WriteCXReceipts(cxp.MerkleProof.ShardID, cxp.MerkleProof.BlockNum.Uint64(), cxp.MerkleProof.BlockHash, cxp.Receipts, true) - utils.Logger().Debug().Interface("cxp", cxp).Msg("[ProcessReceiptMessage] Add CXReceiptsProof to pending Receipts") + utils.Logger().Debug().Msg("[ProcessReceiptMessage] Add CXReceiptsProof to pending Receipts") node.AddPendingReceipts(&cxp) } diff --git a/node/node_newblock.go b/node/node_newblock.go index 53a7193f5..0b302b790 100644 --- a/node/node_newblock.go +++ b/node/node_newblock.go @@ -222,7 +222,6 @@ func (node *Node) proposeReceiptsProof() []*types.CXReceiptsProof { for _, cxp := range node.pendingCXReceipts { // check double spent if node.Blockchain().IsSpent(cxp) { - utils.Logger().Debug().Interface("cxp", cxp).Msg("[proposeReceiptsProof] CXReceipt is spent") continue } hash := cxp.MerkleProof.BlockHash @@ -234,17 +233,15 @@ func (node *Node) proposeReceiptsProof() []*types.CXReceiptsProof { } if err := node.compareCrosslinkWithReceipts(cxp); err != nil { - utils.Logger().Debug().Err(err).Interface("cxp", cxp).Msg("[proposeReceiptsProof] CrossLink Verify Fail") if err != ErrCrosslinkVerificationFail { pendingReceiptsList = append(pendingReceiptsList, cxp) } } else { - utils.Logger().Debug().Interface("cxp", cxp).Msg("[proposeReceiptsProof] CXReceipts Added") validReceiptsList = append(validReceiptsList, cxp) } } node.pendingCXReceipts = pendingReceiptsList node.pendingCXMutex.Unlock() - utils.Logger().Debug().Msgf("[proposeReceiptsProof] number of validReceipts %d, pendingReceipts %d", len(validReceiptsList), len(pendingReceiptsList)) + utils.Logger().Debug().Msgf("[proposeReceiptsProof] number of validReceipts %d", len(validReceiptsList)) return validReceiptsList }