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(x/feegrant): Add limits to grant pruning and enable message to aid manually #18047

Merged
merged 33 commits into from
Oct 16, 2023

Conversation

facundomedica
Copy link
Member

@facundomedica facundomedica commented Oct 10, 2023

Description

This PR adds a limit to the amount of expired grants that the EndBlocker remove and adds a tx that allows users of a chain to prune more.
My understanding is that EndBlocker is supposed to do "automatic" work, but we need to limit, and here we do that + give the option to users to help in pruning.


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
  • run make lint and make test
  • 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)

@facundomedica facundomedica marked this pull request as ready for review October 10, 2023 16:01
@facundomedica facundomedica requested a review from a team as a code owner October 10, 2023 16:01
@github-prbot github-prbot requested review from a team, atheeshp and likhita-809 and removed request for a team October 10, 2023 16:01
x/feegrant/keeper/msg_server.go Outdated Show resolved Hide resolved
proto/cosmos/feegrant/v1beta1/tx.proto Show resolved Hide resolved
x/feegrant/keeper/msg_server.go Outdated Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

The build is failing because you need to bump the api module in x/feegrant to a commit from this branch. Otherwise, it does not know the rpc.

x/feegrant/module/autocli.go Outdated Show resolved Hide resolved
Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

If we do params I think we need a migration and bump consensus version

x/feegrant/module/autocli.go Show resolved Hide resolved
@tac0turtle
Copy link
Member

im not sure its worth adding this as params, it feels like its something that will never get touched. I think setting it to something like 200 in endblock and 75 in the message is fine.

This reverts commit 7d4444c.
This reverts commit ac0f712.
This reverts commit 2a52753.
Copy link
Contributor

@likhita-809 likhita-809 left a comment

Choose a reason for hiding this comment

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

one question, otherwise lgtm

x/feegrant/keeper/msg_server.go Outdated Show resolved Hide resolved
Copy link
Contributor

@likhita-809 likhita-809 left a comment

Choose a reason for hiding this comment

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

can you also fix the failing tests?

@facundomedica
Copy link
Member Author

can you also fix the failing tests?

Idk what's going on with the CI on this PR, amd64 build fails and tests are failing with race conditions and other weird errors. Locally it looks fine (it works on my machine™)

@facundomedica facundomedica added this pull request to the merge queue Oct 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2023
@facundomedica facundomedica added this pull request to the merge queue Oct 16, 2023
Merged via the queue into main with commit 4caecf1 Oct 16, 2023
60 of 61 checks passed
@facundomedica facundomedica deleted the facu/feegrant-prunelimit branch October 16, 2023 16:30
mergify bot pushed a commit that referenced this pull request Oct 16, 2023
…id manually (#18047)

(cherry picked from commit 4caecf1)

# Conflicts:
#	client/v2/go.mod
#	client/v2/go.sum
#	go.mod
#	go.sum
#	simapp/go.mod
#	simapp/go.sum
#	simapp/gomod2nix.toml
#	tests/go.mod
#	tests/go.sum
#	tests/starship/tests/go.mod
#	tests/starship/tests/go.sum
#	x/circuit/go.mod
#	x/circuit/go.sum
#	x/evidence/go.mod
#	x/evidence/go.sum
#	x/feegrant/go.mod
#	x/feegrant/go.sum
#	x/feegrant/keeper/keeper.go
#	x/feegrant/keeper/keeper_test.go
#	x/feegrant/keeper/msg_server_test.go
#	x/feegrant/module/abci_test.go
#	x/nft/go.mod
#	x/nft/go.sum
#	x/params/go.mod
#	x/params/go.sum
#	x/protocolpool/go.mod
#	x/protocolpool/go.sum
#	x/upgrade/go.mod
#	x/upgrade/go.sum
@@ -206,6 +206,14 @@ The feegrant module emits the following events:
| message | granter | {granterAddress} |
| message | grantee | {granteeAddress} |

### Prune fee allowances
Copy link
Member

Choose a reason for hiding this comment

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

The message wasn't added here. Can you make sure to add it

julienrbrt added a commit that referenced this pull request Oct 23, 2023
…id manually (backport #18047) (#18128)

Co-authored-by: Facundo Medica <[email protected]>
Co-authored-by: Facundo <[email protected]>
Co-authored-by: marbar3778 <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
MSalopek added a commit to informalsystems/cosmos-sdk that referenced this pull request Feb 1, 2024
This is a partial backport of cosmos#18047.
Txs were not migrated.

EndBlocker behaviour was not changed since v47 x/feegrant::EndBlocker cannot produce an error during operation.
@faddat faddat mentioned this pull request Nov 8, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants