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

chore: UX Mempool Tweaks #15121

Merged
merged 5 commits into from
Feb 22, 2023
Merged

chore: UX Mempool Tweaks #15121

merged 5 commits into from
Feb 22, 2023

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Feb 22, 2023

Description

  • Following the robustness principle (thanks @kocubinski for pointing out the name that I never knew)
    • Make mempool types public
    • Return concrete types from constructors
  • Use the bech32 address instead of the public key HEX string
  • Implement NextSenderTx (I'm open to adding this to the interface)

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)

@alexanderbez alexanderbez added the backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release label Feb 22, 2023
@alexanderbez alexanderbez marked this pull request as ready for review February 22, 2023 00:28
@alexanderbez alexanderbez requested a review from a team as a code owner February 22, 2023 00:28
@alexanderbez alexanderbez requested review from JeancarloBarrios and kocubinski and removed request for a team February 22, 2023 00:28
@alexanderbez alexanderbez enabled auto-merge (squash) February 22, 2023 00:28
@alexanderbez alexanderbez requested review from facundomedica and removed request for amaury1093 and tac0turtle February 22, 2023 00:31
// i.e. the next valid transaction for the sender. If no such transaction exists,
// nil will be returned.
func (mp *SenderNonceMempool) NextSenderTx(sender string) sdk.Tx {
senderIndex, ok := mp.senders[sender]
Copy link
Member

Choose a reason for hiding this comment

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

The linter makes a good point, I'm somewhat distracted by differing receiver names too when reading code.

Copy link
Member

@kocubinski kocubinski left a comment

Choose a reason for hiding this comment

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

Looks good to me, just nit where I'm only agreeing with the linter.

@alexanderbez alexanderbez merged commit 77660ec into main Feb 22, 2023
@alexanderbez alexanderbez deleted the bez/mempool-tweaks branch February 22, 2023 02:21
mergify bot pushed a commit that referenced this pull request Feb 22, 2023
(cherry picked from commit 77660ec)

# Conflicts:
#	types/mempool/priority_nonce.go
#	types/mempool/priority_nonce_test.go
@kocubinski
Copy link
Member

Oh interesting, I didn't expect that approval to auto merge, I thought the linter was blocking a merge.

@@ -183,7 +196,7 @@ func (snm *senderNonceMempool) Remove(tx sdk.Tx) error {
}

sig := sigs[0]
sender := sig.PubKey.Address().String()
sender := sdk.AccAddress(sig.PubKey.Address()).String()
Copy link
Member

@tac0turtle tac0turtle Feb 22, 2023

Choose a reason for hiding this comment

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

we shouldnt use bech32, this will move from being a global to local to auth. At least the mempool should not sue the global as a bare minimum

Copy link
Contributor Author

@alexanderbez alexanderbez Feb 22, 2023

Choose a reason for hiding this comment

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

Bech32 isn't going anywhere. When/if we figure out a tenable replacement for the global, that'll simple be passed into the mempool constructor just as it is anywhere else it's needed. Bech32 is the correct approach for sender indexes.

@alexanderbez
Copy link
Contributor Author

Yeah I didn't see that. I'll make a followup shortly

@alexanderbez
Copy link
Contributor Author

@Mergifyio backport release/v0.47.x

@mergify
Copy link
Contributor

mergify bot commented Feb 22, 2023

backport release/v0.47.x

✅ Backports have been created

alexanderbez added a commit that referenced this pull request Feb 22, 2023
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants