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

refactor(x/auth): v2 adaptable tx instead of double decode #15910

Merged
merged 16 commits into from
Apr 26, 2023

Conversation

kocubinski
Copy link
Member

@kocubinski kocubinski commented Apr 21, 2023

Description

Removes double decoding in SigVerificationAnteHandler which was introduced in #15822.

Introduces an adapter on the wrapper struct in tx builder to return a x/tx/signing.TxData struct for interoperability with x/tx.

Background

The idealized version of the SDK doesn't need this because the entire transaction stack is powered by x/tx instead of x/auth/tx. However this would be a giant refactor and diff, and I think it's OK to depend on both modules for a period of transition time. I propose that shipping smaller, incremental changes, even if they include throw away code like this, will move the SDK to that idealized state faster than a large "all at once" refactor.


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
  • added ! to 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
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • 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.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added the C:CLI label Apr 24, 2023
@github-actions github-actions bot added the C:Rosetta Issues and PR related to Rosetta label Apr 24, 2023
@kocubinski kocubinski marked this pull request as ready for review April 24, 2023 17:37
@kocubinski kocubinski requested a review from a team as a code owner April 24, 2023 17:37
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This seems like a somewhat convoluted way to deal with this. What's the alternative?

@kocubinski
Copy link
Member Author

This seems like a somewhat convoluted way to deal with this. What's the alternative?

What about this seems convoluted? I don't have an alternative right now. Can you suggest one or make a specific criticism?

@aaronc
Copy link
Member

aaronc commented Apr 24, 2023

This seems like a somewhat convoluted way to deal with this. What's the alternative?

What about this seems convoluted? I don't have an alternative right now. Can you suggest one or make a specific criticism?

It's just the fact that we need to pull things out with an interface - a lot of indirection when there's really only one concrete type that can implement this interface. I guess it's okay for now. But does seem like evidence of the point I was making earlier today about ante handler/sdk.Tx convolution

Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

utACK

@kocubinski
Copy link
Member Author

Thanks. I agree with the points you made about how things look now and I think we should consider them as we move towards x/tx away from x/auth/tx. I updated the PR with some more background.

// GetSignBytesAdapter returns the sign bytes for a given transaction and sign mode. It accepts the arguments expected
// for signing in x/auth/tx and converts them to the arguments expected by the txsigning.HandlerMap, then applies
// HandlerMap.GetSignBytes to get the sign bytes.
func GetSignBytesAdapter(
Copy link
Member

Choose a reason for hiding this comment

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

nit: changelog for public api break

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

No, just make sure we update any previous CHANGELOG entry referring to this

@kocubinski kocubinski added this pull request to the merge queue Apr 26, 2023
Merged via the queue into main with commit 00b78fa Apr 26, 2023
@kocubinski kocubinski deleted the kocubinski/adpatable-tx branch April 26, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI C:Rosetta Issues and PR related to Rosetta C:x/auth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants