celestia-app icon indicating copy to clipboard operation
celestia-app copied to clipboard

feat: add payment module params

Open rahulghangas opened this issue 1 year ago • 5 comments

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 #183

Note: The constants that currently define min/max square size have not been deprecated, will do so in another PR

rahulghangas avatar Oct 20 '22 12:10 rahulghangas

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)

Whoops, fixing this

rahulghangas avatar Oct 20 '22 18:10 rahulghangas

Codecov Report

Merging #893 (cab4172) into main (22d366f) will decrease coverage by 2.24%. The diff coverage is 8.36%.

@@            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     
Impacted Files Coverage Δ
app/app.go 6.44% <0.00%> (-0.06%) :arrow_down:
app/malleate_txs.go 71.87% <ø> (ø)
app/parse_txs.go 64.00% <ø> (ø)
app/process_proposal.go 0.00% <ø> (ø)
app/test_util.go 73.77% <ø> (ø)
x/blob/handler.go 0.00% <ø> (ø)
x/blob/keeper/msg_server.go 0.00% <ø> (ø)
x/blob/module.go 3.70% <ø> (ø)
x/blob/payfordata.go 0.00% <ø> (ø)
x/blob/types/builder_options.go 41.26% <ø> (ø)
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Oct 20 '22 18:10 codecov-commenter

@rootulp

In one terminal, I ran make install celestia-appd start and in a separate terminal, I'm observing a new error now:

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.

evan-forbes avatar Oct 25 '22 14:10 evan-forbes

did you initialize the chain from scratch?

Nope. Thanks for identifying my mistake. I just did and this command now works as expected

$ celestia-appd query payment params
params:
  max_square_size: 128
  min_square_size: 1

rootulp avatar Oct 25 '22 15:10 rootulp

[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

rootulp avatar Oct 26 '22 03:10 rootulp

@rahulghangas The failing test if probably because of this: https://github.com/rahulghangas/celestia-app/blob/6fb4e2fff5c3598e572401d92d62b80946c910b6/x/payment/types/genesis_test.go#L23 The minimum square size needs to be set

rach-id avatar Nov 03 '22 09:11 rach-id

@rootulp is there any remaining things here or can we merge?

evan-forbes avatar Nov 09 '22 13:11 evan-forbes

probably just the merge conflict, regeneration of the proto files, then would be ready to ship

rach-id avatar Nov 09 '22 14:11 rach-id

Proto files have already been regenerated, I'll double check. I'll also resolve the merge conflict

rahulghangas avatar Nov 09 '22 14:11 rahulghangas