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

Better fee calculation #370

Merged
merged 28 commits into from Apr 26, 2022
Merged

Better fee calculation #370

merged 28 commits into from Apr 26, 2022

Conversation

LimpidCrypto
Copy link
Contributor

High Level Overview of Change

Use of better fee calculation formula but keep supporting the current. The current way is marked as deprecated.
Add info to the docstring that get_fee is returning drops.

Context of Change

As proposed in #330 and #352

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation Updates

Test Plan

None

@LimpidCrypto
Copy link
Contributor Author

If this PR should be merged should I add the changes as 'Added' or 'Fixed' in the CHANGELOG.md?

@JST5000 JST5000 requested review from khancode and JST5000 April 5, 2022 21:30
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
xrpl/asyncio/ledger/main.py Outdated Show resolved Hide resolved
@LimpidCrypto
Copy link
Contributor Author

I am a little confused how the integration tests work. Every rippled api request you make is basically made via localhost, right? Why does the result of the fee method not include "max_queue_size"?
@JST5000 why does the fee_type has to be "open" as default to be backwards compatible? In my opinion the default fee_type should be dynamically calculated fee.

Thank you :) You guys already taught me so much 🙏

@JST5000
Copy link
Collaborator

JST5000 commented Apr 6, 2022

@JST5000 why does the fee_type has to be "open" as default to be backwards compatible? In my opinion the default fee_type should be dynamically calculated fee.

My main worry with that is if updating xrpl.js version changes how much money people spend on fees without any warning. While I do think the dynamic calculation is better, I don't want to increase how much people are paying without their explicit opt-in. So my thought was that it'd be backwards compatible to keep the calculations the same unless folks opt-in to the better calculations.

That being said, I haven't done the math to see if the new calculations are higher than the previous calculations. If they're always lower when the queue is empty, then I think it makes sense to just use the better fee calculation as the default.

@LimpidCrypto
Copy link
Contributor Author

@JST5000 why does the fee_type has to be "open" as default to be backwards compatible? In my opinion the default fee_type should be dynamically calculated fee.

My main worry with that is if updating xrpl.js version changes how much money people spend on fees without any warning. While I do think the dynamic calculation is better, I don't want to increase how much people are paying without their explicit opt-in. So my thought was that it'd be backwards compatible to keep the calculations the same unless folks opt-in to the better calculations.

That being said, I haven't done the math to see if the new calculations are higher than the previous calculations. If they're always lower when the queue is empty, then I think it makes sense to just use the better fee calculation as the default.

Ah I did not think about that. I agree to you, the "dynamic" option should not be the default to prevent unwanted higher fees :)

Copy link
Collaborator

@JST5000 JST5000 left a comment

Choose a reason for hiding this comment

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

LGTM :)

CHANGELOG.md Outdated Show resolved Hide resolved
xrpl/ledger/main.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@mvadari mvadari left a comment

Choose a reason for hiding this comment

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

Left a couple notes on where to leave some additional comments for better code readability, looks good otherwise

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@mvadari mvadari merged commit b82b004 into XRPLF:master Apr 26, 2022
@mvadari mvadari linked an issue Oct 27, 2022 that may be closed by this pull request
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.

Use better fee-calculation formula
3 participants