Skip to content

Commit

Permalink
chore(blocksync): improve err message (cometbft#2872)
Browse files Browse the repository at this point in the history
Closes cometbft#2871

<!--

Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->

---

#### 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 <me@andynogueira.dev>
  • Loading branch information
melekes and andynog authored Apr 23, 2024
1 parent 71cd087 commit f4a803f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/blocksync/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion state/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit f4a803f

Please sign in to comment.