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(streamer): added streamer pagination #1100

Merged
merged 15 commits into from
Sep 10, 2024
Merged

Conversation

keruch
Copy link
Contributor

@keruch keruch commented Aug 13, 2024

Description

Added streamer pagination. ADR: https://www.notion.so/dymension/ADR-x-Streamer-Pagination-ad21ef72458e472cad9fb6f9932c16cd.

  • Added a BeforeEpochStart hook
  • Modified a AfterEpochEnd hook
  • Added EndBlock
  • Now rewards are distributed not in a single block, but along the whole epoch
  • Added stream iterator

Please pay special attention to


Closes #1010

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 <- only in one place and under my supervision
  • 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.

@keruch keruch self-assigned this Aug 13, 2024
Copy link
Contributor

coderabbitai bot commented Aug 13, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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 Configuration 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.

x/streamer/keeper/abci.go Fixed Show fixed Hide fixed
x/streamer/keeper/abci.go Fixed Show fixed Hide fixed
x/streamer/keeper/abci.go Fixed Show fixed Hide fixed
x/streamer/keeper/abci.go Fixed Show fixed Hide fixed
x/streamer/keeper/abci.go Fixed Show fixed Hide fixed
x/streamer/keeper/hooks.go Fixed Show fixed Hide fixed
x/streamer/keeper/abci.go Dismissed Show dismissed Hide dismissed
@keruch keruch force-pushed the kirill/1010-streamer-pagination branch from f99c175 to c1f91a6 Compare August 19, 2024 16:42
@keruch keruch marked this pull request as ready for review August 19, 2024 17:09
@keruch keruch requested a review from a team as a code owner August 19, 2024 17:09
x/streamer/module.go Dismissed Show dismissed Hide dismissed
x/streamer/module.go Dismissed Show dismissed Hide dismissed
x/streamer/keeper/hooks.go Show resolved Hide resolved
x/streamer/keeper/hooks.go Show resolved Hide resolved
x/streamer/keeper/distribute.go Outdated Show resolved Hide resolved
x/streamer/keeper/hooks.go Outdated Show resolved Hide resolved
x/streamer/keeper/keeper.go Outdated Show resolved Hide resolved
x/streamer/keeper/abci.go Show resolved Hide resolved
Copy link
Contributor

@zale144 zale144 left a comment

Choose a reason for hiding this comment

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

nice work. left some comments

x/streamer/keeper/abci.go Outdated Show resolved Hide resolved
x/streamer/keeper/distribute.go Outdated Show resolved Hide resolved
x/streamer/keeper/hooks.go Outdated Show resolved Hide resolved
x/streamer/module.go Show resolved Hide resolved
@keruch keruch force-pushed the kirill/1010-streamer-pagination branch from 1fcc4e7 to 81e138c Compare August 29, 2024 17:12
@omritoptix
Copy link
Contributor

@keruch build fails

@keruch keruch force-pushed the kirill/1010-streamer-pagination branch from 25caeb2 to a1e983b Compare September 3, 2024 08:37
zale144
zale144 previously approved these changes Sep 3, 2024
Copy link
Contributor

@zale144 zale144 left a comment

Choose a reason for hiding this comment

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

very nice

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 32.17993% with 980 lines in your changes missing coverage. Please review.

Project coverage is 25.37%. Comparing base (61d5ab1) to head (54f08aa).
Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
x/streamer/types/events.pb.go 1.02% 582 Missing ⚠️
x/streamer/types/streamer.pb.go 36.06% 184 Missing and 27 partials ⚠️
x/streamer/types/genesis.pb.go 0.00% 53 Missing ⚠️
x/streamer/types/params.pb.go 0.00% 30 Missing ⚠️
x/streamer/types/stream.pb.go 45.28% 21 Missing and 8 partials ⚠️
x/streamer/keeper/hooks.go 63.76% 16 Missing and 9 partials ⚠️
x/streamer/keeper/distribute.go 81.15% 9 Missing and 4 partials ⚠️
x/streamer/keeper/abci.go 71.42% 8 Missing and 4 partials ⚠️
app/upgrades/v4/upgrade.go 40.00% 4 Missing and 2 partials ⚠️
x/streamer/keeper/genesis.go 70.00% 3 Missing and 3 partials ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1100      +/-   ##
==========================================
- Coverage   28.22%   25.37%   -2.86%     
==========================================
  Files         332      502     +170     
  Lines       52494    99084   +46590     
==========================================
+ Hits        14818    25139   +10321     
- Misses      35346    70713   +35367     
- Partials     2330     3232     +902     

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

x/streamer/keeper/distribute.go Outdated Show resolved Hide resolved
x/streamer/keeper/distribute.go Show resolved Hide resolved
x/streamer/keeper/distribute.go Outdated Show resolved Hide resolved
@keruch keruch requested a review from mtsitrin September 9, 2024 14:25
@mtsitrin mtsitrin merged commit 8a7b79e into main Sep 10, 2024
14 of 130 checks passed
@mtsitrin mtsitrin deleted the kirill/1010-streamer-pagination branch September 10, 2024 18:34
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 pagination ability on streamer
4 participants