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

The semantics of specifying multiple fees in configuration should be OR instead of AND #3239

Merged
merged 9 commits into from
Jan 8, 2019

Conversation

zmanian
Copy link
Member

@zmanian zmanian commented Jan 6, 2019

The intended behavior in the mempool is that any denom specified in the configuration parameter --minimum should be sufficient to pay fees. The current behavior requires all denoms to pay fees.


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Zaki Manian added 2 commits January 5, 2019 15:50
… to be paid in all denoms specificed in the minimium_fees to the intended behavior of allowing fees to be paid in any specific denom
@zmanian zmanian changed the title Zaki/mempool any fees The semantics of specifying multiple fees in configuration should be OR instead of AND Jan 6, 2019
@codecov
Copy link

codecov bot commented Jan 6, 2019

Codecov Report

Merging #3239 into develop will decrease coverage by 0.02%.
The diff coverage is 0%.

@@             Coverage Diff             @@
##           develop    #3239      +/-   ##
===========================================
- Coverage    54.88%   54.85%   -0.03%     
===========================================
  Files          133      133              
  Lines         9555     9556       +1     
===========================================
- Hits          5244     5242       -2     
- Misses        3989     3992       +3     
  Partials       322      322

@zmanian
Copy link
Member Author

zmanian commented Jan 6, 2019

@alessio can you review and maybe help me write a test for this?

@zmanian zmanian requested a review from alessio January 6, 2019 00:36
@zmanian
Copy link
Member Author

zmanian commented Jan 6, 2019

I have a branch over here the backports this fix to v0.29.* might be helpful for game of stakes.

https://github.com/zmanian/cosmos-sdk/tree/zaki/any_fees_hotfix

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Assuming this is what was intended (OR instead of AND), then it LGTM. We should have an CLI and ante handler test(s).

Co-Authored-By: zmanian <[email protected]>
@alexanderbez
Copy link
Contributor

alexanderbez commented Jan 7, 2019

You can update TestGaiaCLIMinimumFees. I'd set --minimum_fees to two types stake and something else (e.g. 1stake,1photino). Then have three test cases:

  1. sending a tx with stake as the fee (should succeed)
  2. sending a tx with the other denom as the fee (should succeed)
  3. sending tx with some other denom (e.g. footoken) (should fail)

@jackzampolin
Copy link
Member

I'll take a crack at that @alexanderbez

@jackzampolin
Copy link
Member

So I've added the requested cases to the TestGaiaCLIMinimumFees. I'm running into issues. The test as written now sets --minimum_fees=2stake,2feetoken, however sending transactions with a 2stake fee results in the following error message

ERROR: {"codespace":"sdk","code":14,"message":"insufficient fee, got: \"2stake\" required: \"22feetoken,22stake\""}

Note: I've tried different amounts for the min fees and the amount is getting 20 added to it no matter what amount is passed.

Also, while playing around with this I also was able to get a transaction to go through using 2stake for fees when --min_fees=2feetoken. Weird. Anyone have an idea why I'm running into this?

@1xCL
Copy link

1xCL commented Jan 7, 2019

I've tested zaki's hotfix.
gaiacli tx stake delegate worked with a setting --minimum_fees=1STAKE,1photinos
However, when I use --generate-only flag with the above cmd and manually sign it then broadcast it, I ran in to the same error.

ERROR: {"codespace":"sdk","code":14,"message":"insufficient fee, got: \"1photinos\" required: \"21STAKE,21phtinos\""}

gaiacli tx stake delegate --generate-only > unsigned.tx
gaiacli tx sign unsigned.tx > signed.tx
gaiacli tx broadcast signed.tx

@alexanderbez
Copy link
Contributor

@jackzampolin do you have all the information you need? Perhaps we should hold off on the unit test.

@alexanderbez
Copy link
Contributor

You need to specify the fee even during generate only @winslyn

@jackzampolin
Copy link
Member

@alexanderbez I think we need to get the unit test working as right now it isn't

// greater amount in coinsA.
func (coins Coins) IsAnyGT(coinsB Coins) bool {
diff, _ := coins.SafeMinus(coinsB)
if len(diff) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

The thing is, this does not check whether a denom is in the coinset B

Copy link
Contributor

Choose a reason for hiding this comment

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

...and that is cause SafeMinus does not carry out such check

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Thanks @alessio -- just a minor bit of feedback.

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Pending approval once integration_tests is fixed 👍

@jackzampolin jackzampolin merged commit ed2b6bd into develop Jan 8, 2019
@jackzampolin jackzampolin deleted the zaki/mempool_any_fees branch January 8, 2019 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants