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

Change default RC limit to 10%, show more helpful error messages #184

Merged
merged 3 commits into from
Mar 6, 2023

Conversation

youkaicountry
Copy link
Contributor

@youkaicountry youkaicountry commented Feb 22, 2023

Resolves #182

Brief description

Changes the default rc limit to 10%, and gives more instructive error messages

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

(online) (unlocked) > rclimit .001
Set rc limit to 0.001

(online) (unlocked) > koin.transfer
missing parameter: to
Usage: koin.transfer <to:address> <amount:amount>

(online) (unlocked) > koin.transfer aaaa 1
cannot transfer, insufficient rc
Current RC limit: 0.001, RC available: 100
Try using a higher RC limit. Example: rclimit .002

(online) (unlocked) > rclimit .001%
Set rc limit to 0.001%

(online) (unlocked) > koin.transfer aaaa 1
cannot transfer, insufficient rc
Current rc limit: 0.001%
Try using a higher RC limit. Example: rclimit 0.002%

return err
}
result.AddErrorMessage(fmt.Sprintf("Current RC limit: %v, RC available: %v", decValue, decRc))
result.AddErrorMessage(fmt.Sprintf("Try using a higher RC limit. Example: rclimit %v", decRc))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should immediately recommend going max rclimit. That somewhat defeats the purpose of this issue.

I would do the min of the current rclimit * 2 and the account's max rc.

return err
}
result.AddErrorMessage(fmt.Sprintf("Current rc limit: %v%%", resultVal))
result.AddErrorMessage("Try using a higher RC limit. Example: rclimit 100%")
Copy link
Member

Choose a reason for hiding this comment

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

Again, do we want to recommend 100% immediately again?

@mvandeberg mvandeberg merged commit 6f3c853 into master Mar 6, 2023
@mvandeberg mvandeberg deleted the 182-rc branch March 6, 2023 17:10
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.

[FEATURE]: Do not use 100% rc_limit when submitting transactions
2 participants