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: misscounters grpc-web get api #2547

Merged
merged 12 commits into from
Jun 14, 2024
Merged

fix: misscounters grpc-web get api #2547

merged 12 commits into from
Jun 14, 2024

Conversation

gsk967
Copy link
Collaborator

@gsk967 gsk967 commented Jun 13, 2024

Description

Previously this api is not showing the all validators miss counter , it will be fixed in this PR

Summary by CodeRabbit

  • Bug Fixes

    • Improved accuracy by fixing the MissCounters GRPC-Web API to correctly retrieve all miss counters.
  • New Features

    • Enhanced logging for interest accrual, oracle, and auction funding operations to provide better visibility into module rewards.
  • Refactor

    • Simplified the retrieval of miss counters by adding a new method to fetch all counters at once.

@gsk967 gsk967 requested review from a team as code owners June 13, 2024 14:29
Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

These changes primarily enhance logging capabilities across different modules and optimize how miss counters are retrieved. The updates aim to improve transparency and diagnostic capabilities in the system by introducing detailed logs for various operations and simplifying the process of fetching data.

Changes

Files Change Summary
.../interest.go Added logging statements to AccrueAllInterest to log rewards for oracle and auction before funding modules.
.../oracle.go Updated logging in fundModules to include string representations of toOracleCheck and toAuctionCheck.
.../grpc_query.go and .../keeper.go Replaced iteration code in grpc_query.go with GetAllMissCounters. Added GetAllMissCounters function in keeper.go.
CHANGELOG.md Documented a bug fix in version v6.4.0 related to MissCounters grpc-web get API result.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Keeper
    participant Oracle as Oracle Module
    participant Auction as Auction Module

    User->>Keeper: Request to Accrue Interest
    Keeper->>Oracle: Log rewards for Oracle
    Keeper->>Auction: Log rewards for Auction
    Keeper->>Keeper: AccrueAllInterest processing
    Keeper->>Keeper: fundModules(toOracle, toAuction)
    Keeper->>Oracle: Check toOracle
    Keeper->>Auction: Check toAuction
    
    Note over Keeper: Use GetAllMissCounters in grpc_query.go
    
    User->>Keeper: Request Miss Counters
    Keeper->>Oracle: GetAllMissCounters
    Oracle->>Keeper: Return Miss Counters
    Keeper->>User: Provide Miss Counters
Loading

Poem

Brighter logs ignite the night,
With values clear in every byte. ✨
Miss counters swiftly we now fetch,
No looping woes to make us kvetch.
In code's vast sea, both near and far,
We chart our course by each new star. 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 30.76923% with 9 lines in your changes missing coverage. Please review.

Project coverage is 62.76%. Comparing base (7f05ad4) to head (9ec095f).
Report is 499 commits behind head on main.

Current head 9ec095f differs from pull request most recent head 6805c6f

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

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2547       +/-   ##
===========================================
- Coverage   75.38%   62.76%   -12.63%     
===========================================
  Files         100      275      +175     
  Lines        8025    15950     +7925     
===========================================
+ Hits         6050    10011     +3961     
- Misses       1589     5165     +3576     
- Partials      386      774      +388     
Files Coverage Δ
x/leverage/keeper/interest.go 71.42% <100.00%> (+7.99%) ⬆️
x/leverage/keeper/oracle.go 58.97% <100.00%> (-8.86%) ⬇️
x/oracle/keeper/grpc_query.go 82.25% <0.00%> (-8.52%) ⬇️
x/oracle/keeper/keeper.go 76.56% <0.00%> (-8.58%) ⬇️

... and 234 files with indirect coverage changes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dd68c1a and 9ec095f.

Files selected for processing (4)
  • x/leverage/keeper/interest.go (1 hunks)
  • x/leverage/keeper/oracle.go (1 hunks)
  • x/oracle/keeper/grpc_query.go (1 hunks)
  • x/oracle/keeper/keeper.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/leverage/keeper/interest.go
Additional context used
GitHub Check: codecov/patch
x/oracle/keeper/grpc_query.go

[warning] 383-383: x/oracle/keeper/grpc_query.go#L383
Added line #L383 was not covered by tests

x/oracle/keeper/keeper.go

[warning] 255-261: x/oracle/keeper/keeper.go#L255-L261
Added lines #L255 - L261 were not covered by tests


[warning] 263-263: x/oracle/keeper/keeper.go#L263
Added line #L263 was not covered by tests

Additional comments not posted (1)
x/leverage/keeper/oracle.go (1)

288-289: The updated logging statements in the fundModules function enhance transparency by detailing the assets funded to oracle and auction modules. This is beneficial for debugging and auditing purposes.

x/oracle/keeper/grpc_query.go Show resolved Hide resolved
x/oracle/keeper/keeper.go Show resolved Hide resolved
x/oracle/keeper/keeper.go Show resolved Hide resolved
@gsk967 gsk967 enabled auto-merge June 14, 2024 12:26
@gsk967 gsk967 added the skip-e2e-test Skip the e2e tests label Jun 14, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9ec095f and 6805c6f.

Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional context used
LanguageTool
CHANGELOG.md

[grammar] ~117-~117: Using ‘plenty’ without ‘of’ is considered to be informal. (PLENTY_OF_NOUNS)
Context: .../pull/2368) Fix inflow amount calculation. Previously, the inflow amount of the t...


[grammar] ~219-~219: Did you mean “limiting”? Or maybe you should add a pronoun? In active voice, ‘allow’ + ‘to’ takes an object, usually a pronoun. (ALLOW_TO)
Context: ...veragedLiquidate.MaxRepay` which allows to limit the liquidation size using the leverage...


[grammar] ~352-~352: The singular proper name ‘Bridge’ must be used with a third-person or a past tense verb. (HE_VERB_AGR)
Context: ...-network/umee/pull/1967) Gravity Bridge phase out phase-2: disable Umee -> Ethereum t...


[grammar] ~353-~353: The singular proper name ‘Bridge’ must be used with a third-person or a past tense verb. (HE_VERB_AGR)
Context: ...-network/umee/pull/1967) Gravity Bridge phase out phase-2: disable Umee -> Ethereum t...


[grammar] ~403-~403: Make sure that the singular noun after the number ‘4.1’ is correct. (CD_POINT_CD_NN)
Context: ...e/pull/1807) Fixes BNB ibc denom in 4.1 migration - [1812](https://github.com/umee-networ...


[style] ~421-~421: In contexts where ‘if’ is followed by ‘or’, using ‘whether’ may be more appropriate (and formal). (IF_WHETHER)
Context: ...rowandMsgRepay` won't return errors if there is nothing to withdraw, borrow or...


[duplication] ~472-~472: Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Context: ...e/pull/1555) Updates IBC to v5.1.0 that adds adds optional memo field to `FungibleTokenPa...


[uncategorized] ~529-~529: A comma may be missing after the conjunctive/linking adverb ‘Also’. (SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
Context: ...ableLend, docs, and internal functions. Also QueryLoaned similar queries to QuerySup...


[misspelling] ~533-~533: This word is normally spelled as one. (EN_COMPOUNDS_PROTO_TYPES)
Context: ...roto getters in x/leverage and x/oracle proto types. - [1126](https://github.com/umee-netwo...


[duplication] ~652-~652: Possible typo: you repeated a word (ENGLISH_WORD_REPEAT_RULE)
Context: ...k/umee/pull/1358/files) Disable Gravity Bridge bridge messages. ### Improvements - [#1355](...

Additional comments not posted (1)
CHANGELOG.md (1)

67-67: Confirm the clarity and accuracy of the changelog entry for PR #2547.

@hoffmabc
Copy link

LGTM

@gsk967 gsk967 disabled auto-merge June 14, 2024 15:11
@hoffmabc hoffmabc merged commit 503e148 into main Jun 14, 2024
31 of 38 checks passed
@hoffmabc hoffmabc deleted the sai/fix_misscounters_grpc branch June 14, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-e2e-test Skip the e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants