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: whitelist addresses param for setting fee tokens #7855

Merged
merged 10 commits into from
Apr 1, 2024

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Mar 26, 2024

Closes: #XXX

What is the purpose of the change

Having the capability to designate a new token as a whitelisted fee token on the same day it becomes active on Osmosis is strategically important. Currently, we must wait a week for a governance process to include this token in the whitelist. To address this, we propose introducing a new parameter. This parameter would function similarly to the existing taker fee whitelist parameter, enabling a selected list of specific addresses the authority to modify the list of whitelisted fee tokens.

Testing and Verifying

Added respective gotests to newly added methods.

Summary by CodeRabbit

  • New Features
    • Introduced a feature to whitelist addresses for setting fee tokens, enhancing security and control over transaction fee parameters.
    • Added a new Params message in the txfees module to hold parameters including whitelisted fee token setters.
    • Implemented a service with a method for setting fee tokens, accessible only to whitelisted addresses.
  • Bug Fixes
    • Addressed issues in the CometBFT project including batch verification, commit signature verification, ABCI response saving, and rollback command functionality.
  • Documentation
    • Updated CHANGELOG.md with details on new features and bug fixes in the Osmosis and CometBFT projects.

@github-actions github-actions bot added C:CLI C:x/txfees C:app-wiring Changes to the app folder labels Mar 26, 2024
@czarcas7ic czarcas7ic added V:state/breaking State machine breaking PR A:backport/v24.x backport patches to v24.x branch labels Mar 26, 2024
Comment on lines +91 to +97
### CometBFT

* [#5](https://github.com/osmosis-labs/cometbft/pull/5) Batch verification
* [#11](https://github.com/osmosis-labs/cometbft/pull/11) Skip verification of commit sigs
* [#13](https://github.com/osmosis-labs/cometbft/pull/13) Avoid double-saving ABCI responses
* [#20](https://github.com/osmosis-labs/cometbft/pull/20) Fix the rollback command

Copy link
Member Author

Choose a reason for hiding this comment

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

Drive by change

Copy link
Contributor

Choose a reason for hiding this comment

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

Added the update in a separate PR.

#7865

@czarcas7ic czarcas7ic changed the title feat: whitelist address for setting fee tokens feat: whitelist addresses param for setting fee tokens Mar 26, 2024
@czarcas7ic czarcas7ic marked this pull request as ready for review March 26, 2024 23:44
Copy link
Contributor

coderabbitai bot commented Mar 26, 2024

Walkthrough

The Osmosis project introduced a feature for whitelisting addresses for setting fee tokens, enhancing control over transaction fees. This update involves modifications across various components, including keeper functions, upgrade handling, and protobuf definitions, to support the new whitelisting functionality and parameter management. Additionally, CometBFT received improvements in verification processes and command handling, contributing to overall system efficiency and reliability.

Changes

Files Summary
app/keepers/keepers.go
app/.../initParamsKeeper
Integrated txfeestypes.ModuleName for keeper initialization and parameter subspace.
app/upgrades/v24/constants.go
app/upgrades/v24/upgrades.go
app/upgrades/v24/upgrades_test.go
Added WhitelistedFeeTokenSetters and related upgrade logic with tests for whitelisting fee token setters.
proto/osmosis/txfees/v1beta1/genesis.proto
proto/osmosis/txfees/v1beta1/params.proto
proto/osmosis/txfees/v1beta1/tx.proto
Introduced new protobuf definitions for tx fees module parameters, including whitelisting functionality.
x/txfees/keeper/feetokens.go Implemented sender validation for setting fee tokens in the Keeper struct.
CHANGELOG.md Documented new features in Osmosis and improvements in CometBFT.

"In the realm of code, where logic threads weave, 🌐
A rabbit hopped, changes to conceive. 🐇
Whitelists and tokens, in harmony blend,
Enhancements and fixes, from start to end. 🛠️
Let's celebrate the update, with joy and cheer,
For progress marches on, year by year. 🎉"

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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@PaddyMc PaddyMc left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@p0mvn p0mvn left a comment

Choose a reason for hiding this comment

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

LGTM

I think that having AddFeeTokens and RemoveFeeTokens would be worthwhile additions but not blocking on this

x/txfees/keeper/feetokens.go Outdated Show resolved Hide resolved
x/txfees/keeper/msg_server.go Show resolved Hide resolved
@czarcas7ic czarcas7ic closed this Apr 1, 2024
@czarcas7ic czarcas7ic reopened this Apr 1, 2024
@czarcas7ic czarcas7ic merged commit f3e311a into main Apr 1, 2024
1 check passed
@czarcas7ic czarcas7ic deleted the adam/fee-token-setter-whitelist-addr branch April 1, 2024 18:41
mergify bot pushed a commit that referenced this pull request Apr 1, 2024
* whitelist address for setting fee tokens

* register subspace and codec

* changelog

* add params to genesis, add test case for SenderValidationSetFeeTokens

* add genesis test and TestMsgSetFeeTokens

* add DAO address to upgrade handler

* use osmoutils helper

(cherry picked from commit f3e311a)
czarcas7ic added a commit that referenced this pull request Apr 1, 2024
* whitelist address for setting fee tokens

* register subspace and codec

* changelog

* add params to genesis, add test case for SenderValidationSetFeeTokens

* add genesis test and TestMsgSetFeeTokens

* add DAO address to upgrade handler

* use osmoutils helper

(cherry picked from commit f3e311a)

Co-authored-by: Adam Tucker <adam@osmosis.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v24.x backport patches to v24.x branch C:app-wiring Changes to the app folder C:CLI C:x/txfees V:state/breaking State machine breaking PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants