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

feat(delayedack): Add type filter for delayedack query #860

Merged
merged 7 commits into from
May 29, 2024

Conversation

zale144
Copy link
Contributor

@zale144 zale144 commented Apr 23, 2024

Description

Add delayedack filter by type


Closes #850

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.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here

----;

For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

---;

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

@zale144 zale144 marked this pull request as ready for review April 23, 2024 11:11
@zale144 zale144 requested a review from a team as a code owner April 23, 2024 11:11
Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 36.43411% with 82 lines in your changes are missing coverage. Please review.

Project coverage is 29.11%. Comparing base (90e8b37) to head (1d66088).
Report is 23 commits behind head on main.

Current head 1d66088 differs from pull request most recent head c784cc9

Please upload reports for the commit c784cc9 to get more accurate results.

Files Patch % Lines
x/delayedack/client/cli/query.go 0.00% 39 Missing ⚠️
x/delayedack/types/query.pb.go 0.00% 30 Missing ⚠️
x/delayedack/keeper/grpc_query.go 0.00% 7 Missing ⚠️
x/common/types/rollapp_packet.pb.go 33.33% 2 Missing ⚠️
x/common/types/type.pb.go 71.42% 2 Missing ⚠️
x/common/types/rollapp_packet.go 50.00% 1 Missing ⚠️
x/delayedack/keeper/fraud.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #860      +/-   ##
==========================================
- Coverage   29.13%   29.11%   -0.03%     
==========================================
  Files         242      243       +1     
  Lines       33644    33729      +85     
==========================================
+ Hits         9803     9819      +16     
- Misses      22385    22453      +68     
- Partials     1456     1457       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zale144 zale144 changed the title (feat) Add type filter for delayedack feat(delayedack): Add type filter for delayedack query Apr 23, 2024
}

if len(args) > 2 {
typeStr := strings.ToUpper(args[2])
Copy link
Contributor

@trinitys7 trinitys7 Apr 24, 2024

Choose a reason for hiding this comment

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

As I understand in the code, in order to filter by type, we need to filter it by status first. We should make the code separate between status and type. Let do them same as this, check if the first argument start with ON_ ... . If yes then it should be filtered by type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in packets-by-rollapp the status and type are optional filters. In packets-by-status the type is optional. But you still have packets-by-type so you can use that to filter by type alone, granted the status will be PENDING by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

What I mean is like, when you assert like that, the filter must always be status first, and then after that it can be type. So it's kinda annoying if I want to filter just by type

@omritoptix
Copy link
Contributor

omritoptix commented May 20, 2024

@zale144 I would avoid the refactor of moving types to the types common for 2 reasons:

  1. I don't think it's a common type around the system by itself (unlike status) as it's part of a rollapp packet which is already a common type.
  2. I would like to avoid all the refactors to simplify this pr and it's reviewing.

if there is a way to avoid it and minimize changes would be preferred imo unless I'm missing something.

mtsitrin
mtsitrin previously approved these changes May 22, 2024
mtsitrin
mtsitrin previously approved these changes May 27, 2024
@mtsitrin mtsitrin merged commit 57eca21 into main May 29, 2024
38 of 86 checks passed
@mtsitrin mtsitrin deleted the zale144/850-query-delayedack-by-type branch May 29, 2024 06:57
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.

Add ability to filter delayedack by type
4 participants