Skip to content

fix: invalid txs_results returned for legacy ABCI responses (backport #3031) - #3435

Merged
andynog merged 15 commits into
v0.38.xfrom
mergify/bp/v0.38.x/pr-3031
Jul 9, 2024
Merged

andynog merged 15 commits into
v0.38.xfrom
mergify/bp/v0.38.x/pr-3031

Conversation

@mergify

@mergify mergify Bot commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

close: #3002

This PR fixes the issue reported above.

This is not a storage issue in particular, the results are still in storage after an upgrade, but not returned properly by the RPC endpoint. The fix is to make the /block_results endpoint in v0.38 to return properly a legacy ABCI response created with v0.37.

Once this fix is merged on v0.38 and a patch release is cut, any node on v0.38 (e.g. an archive node) that applies the patch release, should have the results returned properly by the RPC /block_results endpoint.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

This is an automatic backport of pull request #3031 done by [Mergify](https://mergify.com).

close: #3002

This PR fixes the issue reported above.

This is not a storage issue in particular, the results are still in
storage after an upgrade, but not returned properly by the RPC endpoint.
The fix is to make the `/block_results` endpoint in `v0.38` to return
properly a legacy ABCI response created with `v0.37`.

Once this fix is merged on `v0.38` and a patch release is cut, any node
on `v0.38` (e.g. an archive node) that applies the patch release, should
have the results returned properly by the RPC `/block_results` endpoint.

---

#### PR checklist

- [X] Tests written/updated
- [x] 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: Sergio Mena <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Anton Kaliaev <[email protected]>
Co-authored-by: Daniel Wedul <[email protected]>
(cherry picked from commit db6b608)

# Conflicts:
#	state/errors.go
#	state/state_test.go
#	state/store.go
#	state/store_test.go
@mergify
mergify Bot requested a review from a team as a code owner July 5, 2024 15:56
@mergify mergify Bot added the conflicts label Jul 5, 2024
@mergify

mergify Bot commented Jul 5, 2024

Copy link
Copy Markdown
Contributor Author

Cherry-pick of db6b608 has failed:

On branch mergify/bp/v0.38.x/pr-3031
Your branch is up to date with 'origin/v0.38.x'.

You are currently cherry-picking commit db6b60822.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   .changelog/unreleased/bug-fixes/3002-invalid-txs-results.md
	modified:   rpc/core/blocks.go
	modified:   rpc/core/blocks_test.go
	new file:   state/compatibility_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   state/errors.go
	both modified:   state/state_test.go
	both modified:   state/store.go
	both modified:   state/store_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@andynog andynog self-assigned this Jul 5, 2024
@andynog

andynog commented Jul 5, 2024

Copy link
Copy Markdown
Contributor

there are many conflicts in this backport, will manually take care of it

@andynog

andynog commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

Comments for the reviewers of this backport. I had to manually go through and implement some of the backport changes to adapt them to v0.38.x.

There are some changes from the original PR that needed some "adaptation"

  • There is an error log message that I've added to the BlockResults in the rpc/core/blocks.go as opposed to the one in state/store because the Logger is not available in there. We'd need to include a logger in the StoreOptions that is part of the dbStore so this would need a lot of changes that could even be breaking. Logging the message in rpc is fine because the method from store is only called from there.

  • The compatibility_test tests from the original PR are not really usable in v0.38.x because we don't have the versioned protos in there. Most of the tests in compatibility are related to the versioned protos. But I've kept and adapted some logic so we can at least try to simulate and test the saving of a legacy ABCI response to the store and the loading as a ResponseFinalizeBlock.

@andynog
andynog requested a review from sergio-mena July 8, 2024 20:39
Comment thread rpc/core/blocks.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/compatibility_test.go Resolved
Comment thread state/state_test.go Resolved
Comment thread state/store.go Resolved

@sergio-mena sergio-mena left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through diff-of-diffs. All discrepancies I saw are explained by this. So LGTM

@andynog
andynog merged commit 0792c8b into v0.38.x Jul 9, 2024
@andynog
andynog deleted the mergify/bp/v0.38.x/pr-3031 branch July 9, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants