-
Notifications
You must be signed in to change notification settings - Fork 289
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: add payment module params #893
feat: add payment module params #893
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start 👍
Did a first pass and left some blocking comments.
Also, doesn't it make sense also to make the corresponding genesis changes?
I once set some parameters for the QGB, and I updated the following when init
and export
:
https://github.com/celestiaorg/celestia-app/blob/main/x/qgb/genesis.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing feedback so quickly!
I'm observing the following panic when attempting to test the CLI query command.
$ celestia-appd query payment params
Error: rpc error: code = Unknown desc = parameter MinSquareSize not registered: panic
To reproduce this error, I checked out this branch locally and installed the binary (i.e make install
)
proto/payment/params.proto
Outdated
message Params { | ||
option (gogoproto.goproto_stringer) = false; | ||
|
||
uint32 min_square_size = 1 [(gogoproto.moretags) = "yaml:\"min_square_size\""]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] for my learning, why is the "yaml:\"min_square_size\""
necessary? In the future, do we plan on reading this value from a YAML file? It looks like removing it has the following effect on params.pb.go
:
type Params struct {
- MinSquareSize uint32 `protobuf:"varint,1,opt,name=min_square_size,json=minSquareSize,proto3" json:"min_square_size,omitempty" yaml:"min_square_size"`
- MaxSquareSize uint32 `protobuf:"varint,2,opt,name=max_square_size,json=maxSquareSize,proto3" json:"max_square_size,omitempty" yaml:"max_square_size"`
+ MinSquareSize uint32 `protobuf:"varint,1,opt,name=min_square_size,json=minSquareSize,proto3" json:"min_square_size,omitempty"`
+ MaxSquareSize uint32 `protobuf:"varint,2,opt,name=max_square_size,json=maxSquareSize,proto3" json:"max_square_size,omitempty"`
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's standard practice from what I've seen. Also, it makes it very easy to define genesis parameters through a config.yml
file
For eg. https://github.com/osmosis-labs/osmosis/blob/main/proto/osmosis/lockup/params.proto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find a config.yml
in https://github.com/osmosis-labs/osmosis so I'm not sure what you mean. Can you please elaborate or include a link to the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand the benefit to using yaml
tags but this isn't blocking so feel free to resolve the conversation @rahulghangas if there aren't updates here
Whoops, fixing this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! these will be really useful in the future.
The constants that currently define min/max square size have not been deprecated, will do so in another PR
IMO, we should actually keep these, but just change them to be the defaults. This way other projects import really similar defaults without booting up an application.
Codecov Report
@@ Coverage Diff @@
## main #893 +/- ##
==========================================
- Coverage 29.74% 27.49% -2.25%
==========================================
Files 72 81 +9
Lines 8199 9091 +892
==========================================
+ Hits 2439 2500 +61
- Misses 5531 6355 +824
- Partials 229 236 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In one terminal, I ran
make install
celestia-appd start
and in a separate terminal, I'm observing a new error now:
$ celestia-appd query payment params
Error: rpc error: code = Unknown desc = UnmarshalJSON cannot decode empty bytes: panic
@rahulghangas are you able to reproduce this?
did you initialize the chain from scratch? the only way to set genesis values after upgrading binaries is to include it in an upgrade handler or perhaps vote on it. In a normal situation, it will be included in the genesis. |
Nope. Thanks for identifying my mistake. I just did and this command now works as expected
|
[optional][can be a follow-up PR] we likely want to update https://github.com/celestiaorg/celestia-app/blob/main/x/payment/spec/docs.md#parameters |
fb7c394
to
8f00dc9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some final comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets mergeeeeeeee
## TODO - [x] Split out changes that are only relevant post ADR 008 implementation and target feature branch - [x] Document gas cost for a message - [x] [Potentially] remove outdated code blocks from README.md ## Future PRs - [ ] Params section needs to be updated after params are added to payment module celestiaorg#893 - [ ] [Potentially] add client section (motivated by https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#client)
Adds `minSquareSize` and `maxSquareSize` as params to the payment module. Defines relevant stores and queries Relevant changes in `proto/payment/*` `x/payment/keeper*` `x/payment/types/*` - [x] closes celestiaorg#183 Note: The constants that currently define min/max square size have not been deprecated, will do so in another PR
Adds `gasPerMsgByte` as params to the payment module. Defines relevant stores and queries Relevant changes in `proto/payment/*` `x/payment/keeper*` `x/payment/types/*` - [x] finished 1st part of celestiaorg#949 Note: To be merged after celestiaorg#893 and constants for default values can be defined in a cumulative PR
## TODO - [x] Split out changes that are only relevant post ADR 008 implementation and target feature branch - [x] Document gas cost for a message - [x] [Potentially] remove outdated code blocks from README.md ## Future PRs - [ ] Params section needs to be updated after params are added to payment module celestiaorg#893 - [ ] [Potentially] add client section (motivated by https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#client)
Adds `minSquareSize` and `maxSquareSize` as params to the payment module. Defines relevant stores and queries Relevant changes in `proto/payment/*` `x/payment/keeper*` `x/payment/types/*` - [x] closes celestiaorg#183 Note: The constants that currently define min/max square size have not been deprecated, will do so in another PR
Adds `gasPerMsgByte` as params to the payment module. Defines relevant stores and queries Relevant changes in `proto/payment/*` `x/payment/keeper*` `x/payment/types/*` - [x] finished 1st part of celestiaorg#949 Note: To be merged after celestiaorg#893 and constants for default values can be defined in a cumulative PR
Resolves [this feedback](#893 (comment)). Inspired by https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#parameters
## TODO - [x] Split out changes that are only relevant post ADR 008 implementation and target feature branch - [x] Document gas cost for a message - [x] [Potentially] remove outdated code blocks from README.md ## Future PRs - [ ] Params section needs to be updated after params are added to payment module celestiaorg/celestia-app#893 - [ ] [Potentially] add client section (motivated by https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#client)
Resolves [this feedback](celestiaorg/celestia-app#893 (comment)). Inspired by https://github.com/cosmos/cosmos-sdk/tree/main/x/auth#parameters
Adds
minSquareSize
andmaxSquareSize
as params to the payment module.Defines relevant stores and queries
Relevant changes in
proto/payment/*
x/payment/keeper*
x/payment/types/*
Max
andMinSquareSize
as a parameter to the payment module #183Note: The constants that currently define min/max square size have not been deprecated, will do so in another PR