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

perf(x/auth): only check memo when memo is present #13528

Merged
merged 6 commits into from
Oct 13, 2022
Merged

Conversation

technicallyty
Copy link
Contributor

Description

  • changes the ValidateMemoDecorator ante handler to only check the memo if one is included in the tx, which saves adtl' gas as reading params incurs a flat read gas cost.

Closes: n/a


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)

@technicallyty technicallyty requested a review from a team as a code owner October 13, 2022 00:41
)
if memoLength > 0 {
params := vmd.ak.GetParams(ctx)
if uint64(memoLength) > params.MaxMemoCharacters {

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
@julienrbrt
Copy link
Member

julienrbrt commented Oct 13, 2022

@technicallyty can you update

baseGas := uint64(52864) // baseGas is the gas consumed before tx msg
for fixing the tests?

@technicallyty
Copy link
Contributor Author

does this change need a changelog entry? @alexanderbez @julienrbrt @tac0turtle

@julienrbrt
Copy link
Member

does this change need a changelog entry? @alexanderbez @julienrbrt @tac0turtle

Sure, why not one under improvements.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Merging #13528 (ac07a8b) into main (89c65f4) will not change coverage.
The diff coverage is 100.00%.

❗ Current head ac07a8b differs from pull request most recent head 04247f5. Consider uploading reports for the commit 04247f5 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #13528   +/-   ##
=======================================
  Coverage   53.92%   53.92%           
=======================================
  Files         643      643           
  Lines       55464    55464           
=======================================
  Hits        29909    29909           
  Misses      23153    23153           
  Partials     2402     2402           
Impacted Files Coverage Δ
x/auth/ante/basic.go 79.27% <100.00%> (ø)

@julienrbrt julienrbrt enabled auto-merge (squash) October 13, 2022 19:33
@julienrbrt julienrbrt merged commit 81d033e into main Oct 13, 2022
@julienrbrt julienrbrt deleted the ty/perf_memo_check branch October 13, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants