Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(abci): add unwrapper to handle join error #23712

Open
wants to merge 5 commits into
base: release/v0.50.x
Choose a base branch
from

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Feb 15, 2025

Description

Closes: #23709


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@mmsqe mmsqe marked this pull request as ready for review February 27, 2025 01:01
@mmsqe mmsqe requested a review from a team as a code owner February 27, 2025 01:01
Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

Nice work!
I am not sure about the error selection though.

@@ -4,6 +4,7 @@ import (
"bytes"
"context"
"crypto/sha256"
"errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

the same errors package as in baseapp should be used

errors/abci.go Outdated
@@ -59,6 +59,16 @@ func abciCode(err error) uint32 {
}

for {
if c, ok := err.(interface{ Unwrap() []error }); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to have this interface extracted with some meaningful name

errs := c.Unwrap()
for _, e := range errs {
if e != nil {
err = e
Copy link
Contributor

@alpe alpe Mar 10, 2025

Choose a reason for hiding this comment

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

I am not sure if "first error" wins is correct. You could also have first coder error win. or last... it would be good to understand the scenario better. I have commented on the issue.
Skipping any nil errors does make sense though. This could be achieved by using Go stdlib errors.Join in baseapp as well.

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