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

docs(adr): ADR-21: Subspace specific custom fee tokens #1119

Merged
merged 16 commits into from
May 10, 2023

Conversation

dadamu
Copy link
Contributor

@dadamu dadamu commented Apr 24, 2023

Description

Closes: #XXXX
This PR introduces the subspace specific custom fee tokens by the ADR.


Author Checklist

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.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@dadamu dadamu requested a review from a team as a code owner April 24, 2023 13:25
@github-actions github-actions bot added the kind/adr An issue or PR relating to an architectural decision record label Apr 24, 2023
@dadamu dadamu force-pushed the paul/DCD-304/subspace-custom-fee-tokens-adr branch from 63342a7 to a76f613 Compare April 24, 2023 13:30
Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

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

I have some doubts on the proposed implementation. I think there's no need for multiple messages and steps. Everything could be simplified to use on-chain proposals instead.

Comment on lines 32 to 40
We will define a new `Params` type to show the `x/subspaces` parameters.

```proto
// Params contains the module parameters
message Params {
// List of the minimum gas prices to be accepted by validators
repeated Coin min_gas_prices = 2;
}
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this needed? Each subspace will have its own allowed_fee_tokens list anyway. There's no need to have a module-wide list

dadamu and others added 8 commits May 2, 2023 14:41
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
@dadamu dadamu requested a review from RiccardoM May 2, 2023 08:02
Params params = 1;
}
```
### Update `x/fees`
Copy link
Contributor Author

@dadamu dadamu May 8, 2023

Choose a reason for hiding this comment

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

Since x/fees may conflict with subspace fee token checks, I think we can update the logic of CheckFees only check dsm. What do you think? @RiccardoM @manu0466

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should completely drop the x/fees module instead. It's never been used anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RiccardoM Updated docs.

Comment on lines 95 to 96
The solution outlined above is **not** backwards compatible and will require a migration script to update all existing subspaces to the new version. This script will handle the following tasks:
- migrate all subspaces to have a default allowed fee tokens list.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The solution outlined above is **not** backwards compatible and will require a migration script to update all existing subspaces to the new version. This script will handle the following tasks:
- migrate all subspaces to have a default allowed fee tokens list.
The solution outlined above is **not** backward compatible, and it requires a migration script to update all existing subspaces to the new version. The script should take care of migrating all subspaces to have a default allowed fee tokens list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually true though? If we mark the Proto field as optional, do we need to migrate everything?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now proto3 fields are all optional now. You are right, adding new field does not cause the backward compatibility issues. I just learned from the official documentation. Thanks!

https://protobuf.dev/programming-guides/proto3/#updating
If you add new fields, any messages serialized by code using your “old” message format can still be parsed by your new generated code. You should keep in mind the default values for these elements so that new code can properly interact with messages generated by old code. Similarly, messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing. See the Unknown Fields section for details.

dadamu and others added 3 commits May 10, 2023 13:58
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
Co-authored-by: Riccardo <riccardo.montagnin@gmail.com>
@dadamu dadamu requested a review from RiccardoM May 10, 2023 06:05
@dadamu dadamu force-pushed the paul/DCD-304/subspace-custom-fee-tokens-adr branch from 78842e9 to c433739 Compare May 10, 2023 08:54
@dadamu dadamu force-pushed the paul/DCD-304/subspace-custom-fee-tokens-adr branch from c433739 to 8073448 Compare May 10, 2023 08:55
@dadamu dadamu mentioned this pull request May 10, 2023
19 tasks
@RiccardoM RiccardoM merged commit 19a9d54 into master May 10, 2023
@RiccardoM RiccardoM deleted the paul/DCD-304/subspace-custom-fee-tokens-adr branch May 10, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/adr An issue or PR relating to an architectural decision record
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants