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(app/block-sdk): Implement v25 upgrade handler #7935

Closed

Conversation

nivasan1
Copy link

@nivasan1 nivasan1 commented Apr 2, 2024

In This PR

  • This PR is based on the block-sdk integration
  • The files relevant for review are in /app/upgrades/v25
  • I set the default parameters of the auction module here
    • Happy to change these as necessary, of specific relevance would be
    1. MinReserveFee - The minimum amount you need to outbid the highest bid (think of as a spam prevention)
    2. AuctionReserveFee - The minimum amount an address can bid (as an sdk.Coin)
    3. EscrowAddress - The address to which the auction revenue less proposer fee should go
    4. ProposerFee - What % of auction revenue should go to a proposer (currently 20%)

adds to this PR => skip-mev#2

🤜 🤛 From Skip!

In This PR

  • I integrate the block-sdk
    • I integrate the mev, free, default lanes (ordered accordingly) into the LaneMempool which will be used as the app's Mempool
    • I integrate the Prepare / ProcessProposal handlers and custom CheckTx handler
    • Modules
      • I integrate the x/auction module, and the corresponding AnteHandler for the auction module
    • I integrate the ante.IgnoreDecorator with the freeLane, and the DeductFees ante-handler: this will skip the DeductFees ante-handler for any txs that originate from the freeLane

Testing

  • We've tested this integration against our own set of load-tests. These tests, spin up a network of 5 nodes (3 val, 1 seed, 1 full). Perform various perturbations against them (killing, restarting, disconnecting from the network, etc.), and periodically send a load of 350 tx/sec for 90s. The output from one of our trials is here, happy to go through these in more depth / review the methodology.
  • In order for the e2e tests to work, I had to modify the ante_no_seq ante-handlers to ignore signature verification, while incrementing sequence #s, I leave a comment in the section describing why.

Let's Discuss

  • I chose to use stable defaults here (tx-capacity of each lane) and here (block-space allocated to each lane), let me know if any of the parameters are confusing or should be changed
  • regarding the auction-module
    • I imagine that the full integration requires the v23 upgrade-handler (store-migration, genesis-state / parameters, etc.), I am happy to implement those as a separate PR if that is desired
    • Auction module's parameters are here, take a look at these or we can go ahead w/ the defaults, some things to consider
      • What denomination would we like the auction to accept (there can only be a single denom accepted)
      • What would be the desired max bundle size (maximal # of txs that a bid can include)
      • What address would we like the auction revenue to be sent to? How much of it should we give to proposers?
  • re the free-lane: We currently are matching the distributiontypes.WithdrawDelegatorRewards tx, the process of adding more txs to this lane is simple, we just need to identify which types we want!

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added support for block SDK, including auction module integration and MEV lanes configuration.
    • Introduced Osmosis v25 upgrade with new constants, configurations, and upgrade handlers.
  • Refactor
    • Updated ante handlers to include block SDK parameters and new decorators for auction functionality.
    • Modified app initialization to incorporate block SDK packages, upgrade imports, and mempool configurations.
  • Tests
    • Added tests for MEV lanes functionality and v25 upgrade process.
  • Chores
    • Updated version tags for Osmosis in test configurations.
    • Upgraded E2E_UPGRADE_VERSION from "v24" to "v25" across various configurations.

nivasan1 and others added 5 commits April 2, 2024 08:28
temp

update branch to latest osmo

remove load-test modifications

set lane block-space

update block-sdk to latest release

update go versions in gomod / work files

update match handler

docs

nop process proposal

nit
@nivasan1 nivasan1 requested review from a team, mattverse and nicolaslara as code owners April 2, 2024 21:03
Copy link
Contributor

coderabbitai bot commented Apr 2, 2024

Walkthrough

This update ushers in a significant advancement in the application, integrating the block-sdk with auction capabilities and upgrading to version v25. It encompasses updates across various configuration files, new imports, and enhancements to the ante-handler mechanisms. Additionally, it introduces differentiated transaction handling through lanes, initializes the auction module, and prepares for the v25 upgrade with specific upgrade handlers and tests.

Changes

Files Changes
.vscode/launch.json, Makefile Updated E2E_UPGRADE_VERSION from v24 to v25.
app/ante.go, app/ante_no_seq.go Added imports for block-sdk and cosmos-sdk/client. Defined BlockSDKAnteHandlerParams, modified NewAnteHandler, and introduced new decorators.
app/app.go, app/keepers/keepers.go, app/keepers/modules.go, app/modules.go Integrated block-sdk packages and auction module, updated structures, and initialization functions for auction functionality.
app/lanes.go, app/lanes_test.go Introduced MEV, Free, and Default lanes functionality along with related tests.
app/upgrades/v25/... Added constants, upgrade handler, and tests for the v25 upgrade.
tests/e2e/containers/config.go Updated version tags for Osmosis and initialization repositories.

"In the realm of code, where changes abound,
A rabbit hopped in, upgrades it found.
With a flick and a hop, v25 in sight,
Auctions and lanes, set up just right.
🎉🐇 Let's celebrate, for progress we cheer,
Onward we go, with no hint of fear!"


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 329bf60 and be8d828.
Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • app/upgrades/v25/upgrades.go (1 hunks)
Additional comments not posted (2)
app/upgrades/v25/upgrades.go (2)

26-29: Update to block-sdk parameters correctly handles potential errors.


30-30: Consider adding a comment explaining why deprecated historical TWAPs are being deleted, to improve code readability and maintainability.


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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@github-actions github-actions bot added C:x/epochs T:build C:app-wiring Changes to the app folder labels Apr 2, 2024
app/keepers/keepers.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Outdated Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/app.go Show resolved Hide resolved
app/lanes_test.go Show resolved Hide resolved
@czarcas7ic czarcas7ic closed this Apr 2, 2024
@czarcas7ic czarcas7ic reopened this Apr 2, 2024
@czarcas7ic
Copy link
Member

I fixed some lingering issues with regards to E2E and the v24 -> v25 upgrade. See #7933

If you pull in those changes, that should also reduce the diff of this PR to what actually matters as well

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you!

@github-actions github-actions bot added the Stale label Apr 14, 2024
@PaddyMc PaddyMc removed the Stale label Apr 15, 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: 2

Actionable comments outside the diff hunks (3)
CHANGELOG.md (3)

Line range hint 584-584: Avoid using bare URLs. Provide descriptive text for the hyperlink.

- * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev
+ * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev. [View Pull Request](https://github.com/osmosis-labs/osmosis/pull/7935)

Line range hint 642-642: Avoid using bare URLs. Provide descriptive text for the hyperlink.

- * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev
+ * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev. [View Pull Request](https://github.com/osmosis-labs/osmosis/pull/7935)

Line range hint 1223-1223: Ensure there are no empty links in the document.

- * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev
+ * [#7935](https://github.com/osmosis-labs/osmosis/pull/7935) Add block sdk and top of block auction from skip-mev. [View Pull Request](https://github.com/osmosis-labs/osmosis/pull/7935)

CHANGELOG.md Show resolved Hide resolved
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

Actionable comments outside the diff hunks (9)
CHANGELOG.md (9)

Line range hint 325-325: Correct the punctuation in the heading.

- ### State Breaking:
+ ### State Breaking

Line range hint 986-986: Ensure heading levels increment by one level at a time.

- #### Features
+ ### Features

Line range hint 998-998: Ensure heading levels increment by one level at a time.

- #### Minor improvements & Bug Fixes
+ ### Minor improvements & Bug Fixes

Line range hint 1007-1007: Ensure heading levels increment by one level at a time.

- #### SDK fork updates
+ ### SDK fork updates

Line range hint 1012-1012: Ensure heading levels increment by one level at a time.

- #### IAVL fork updates
+ ### IAVL fork updates

Line range hint 1064-1064: Ensure heading levels increment by one level at a time.

- #### Features
+ ### Features

Line range hint 588-588: Wrap bare URLs in Markdown link syntax for better readability.

- https://github.com/osmosis-labs/osmosis/releases/tag/v6.4.0
+ [v6.4.0](https://github.com/osmosis-labs/osmosis/releases/tag/v6.4.0)

Line range hint 646-646: Wrap bare URLs in Markdown link syntax for better readability.

- https://github.com/osmosis-labs/osmosis/releases/tag/v6.3.1
+ [v6.3.1](https://github.com/osmosis-labs/osmosis/releases/tag/v6.3.1)

Line range hint 1227-1227: Ensure no empty links are present in the document.

- [v6.1.0]()
+ [v6.1.0](https://github.com/osmosis-labs/osmosis/releases/tag/v6.1.0)

@PaddyMc PaddyMc added the V:state/breaking State machine breaking PR label Apr 15, 2024
@PaddyMc
Copy link
Collaborator

PaddyMc commented Apr 17, 2024

Our CI won't run as expected with this PR as it's base is not the osmosis base 😢

I've cannibalised this PR into this => #8058

Sorry, this is kinda annoying for you, and I don't mean to take your work, but the CI wasn't working, thanks for the PR is a massive help ❤️

@PaddyMc PaddyMc closed this Apr 17, 2024
@github-actions github-actions bot mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:app-wiring Changes to the app folder C:x/epochs T:build V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants