From f4a803f14a2f5bc5c17d75fcd1131b9249bba133 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 24 Apr 2024 00:42:07 +0800 Subject: [PATCH] chore(blocksync): improve err message (#2872) Closes #2871 --- #### PR checklist - [ ] ~~Tests written/updated~~ - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [ ] ~~Updated relevant documentation (`docs/` or `spec/`) and code comments~~ - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec Co-authored-by: Andy Nogueira --- internal/blocksync/reactor.go | 2 +- state/validation.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/blocksync/reactor.go b/internal/blocksync/reactor.go index 641b723c3a2..9cc3c65856f 100644 --- a/internal/blocksync/reactor.go +++ b/internal/blocksync/reactor.go @@ -496,7 +496,7 @@ FOR_LOOP: } } if err != nil { - bcR.Logger.Error("Error in validation", "err", err) + bcR.Logger.Error("Invalid block", "height", first.Height, "err", err) peerID := bcR.pool.RemovePeerAndRedoAllPeerRequests(first.Height) peer := bcR.Switch.Peers().Get(peerID) if peer != nil { diff --git a/state/validation.go b/state/validation.go index f5d17a35d41..4b1bb92232c 100644 --- a/state/validation.go +++ b/state/validation.go @@ -54,7 +54,7 @@ func validateBlock(state State, block *types.Block) error { // Validate app info if !bytes.Equal(block.AppHash, state.AppHash) { - return fmt.Errorf("wrong Block.Header.AppHash. Expected %X, got %v", + return fmt.Errorf("wrong Block.Header.AppHash. Expected %X, got %v. Check ABCI app for non-determinism", state.AppHash, block.AppHash, )