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: FeeDecorator #331

Merged
merged 9 commits into from
Aug 28, 2023
Merged

feat: FeeDecorator #331

merged 9 commits into from
Aug 28, 2023

Conversation

inon-man
Copy link
Collaborator

Description

This PR adds a new Ante handler FeeDecorator that merges TaxFeeDecorator, BurnTaxFeeDecorator, and DeductFeeDecorator of CosmosSDK. This is required for allowing validators to submit oracle vote transactions without fee.

Closes: #330

@inon-man inon-man added this to the v2.2.0 milestone Aug 25, 2023
@inon-man inon-man added the bug Something isn't working label Aug 25, 2023
@inon-man inon-man self-assigned this Aug 25, 2023
@inon-man inon-man marked this pull request as ready for review August 25, 2023 08:12
@nghuyenthevinh2000
Copy link
Contributor

@inon-man I think it needs one more oracle submit tx test to make sure. Let's me add that one in

@fragwuerdig
Copy link
Collaborator

One question. Does this FeeDecorator deduct the taxes from the account balance rather than deducting it from the fee field of the tx. Did I read that correctly?

@nghuyenthevinh2000
Copy link
Contributor

nghuyenthevinh2000 commented Aug 26, 2023

One question. Does this FeeDecorator deduct the taxes from the account balance rather than deducting it from the fee field of the tx. Did I read that correctly?

fee is collected first from account to FeeCollector, then tax is get from FeeCollector

@StrathCole
Copy link
Collaborator

Does this fully solve the calculation issues e.g. in terms of simulate endpoint requests? What effect does it have for contracts?

@nghuyenthevinh2000
Copy link
Contributor

@inon-man please check again before merge. I am all good.

@inon-man
Copy link
Collaborator Author

Does this fully solve the calculation issues e.g. in terms of simulate endpoint requests? What effect does it have for contracts?

You can think this as a refactoring task. It does not change the behavior of the chain of Ante handlers. I migrated all the tests as well.

@inon-man
Copy link
Collaborator Author

One question. Does this FeeDecorator deduct the taxes from the account balance rather than deducting it from the fee field of the tx. Did I read that correctly?

In addition, DeductFee function sends fees from account to fee collector.

@inon-man inon-man merged commit b7e4452 into main Aug 28, 2023
15 checks passed
@inon-man inon-man deleted the fee-decorator-simple branch August 28, 2023 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] v2.2.0 does not allow empty fee for oracle txs
4 participants