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

Make rosetta construction/metadata return the correct default fee #8109

Conversation

jspada
Copy link
Contributor

@jspada jspada commented Mar 4, 2021

* Use compile-time constant rather than hardcoded

This PR fixes an issue with rosetta construction/metadata where it returns a hardcoded default transaction fee.

Instead of returning the hardcoded fee we now return the default fee from the compile-time config Mina_compile_config.default_transaction_fee

The test agent (test-agent/agent.ml) does not have any test cases using the default fee so required no updates.

Testing:

Prior to these changes construction/metadata returns a hardcoded fee of 1 Mina. After the change it returns the value from the compile-time constant in one of the .mlh files.

Rosetta will now return the default fee depending on the build profile used. For example, for the production build profile, the default_transaction_fee from src/config/amount_defaults/realistic.mlh will be returned.

This can be tested either with the test script src/app/rosetta/test-curl/con_metadata.sh or by using mina_ledger_wallet send-payment and seeing that the correct default fee is obtained.

Checklist:

  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them:

Closes #8100

    * Use compile-time constant rather than hardcoded
; suggested_fee=
[ Amount_of.coda
(MinaCurrency.Fee.to_uint64
Mina_compile_config.default_transaction_fee) ] }
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to add minimum_user_command_fee (as per the PR description)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. As far as I understand, this is to be done in a separate PR as it would not be a hotfix (see #8086).

@bkase
Copy link
Member

bkase commented Mar 4, 2021

!ci-build-me

@bkase
Copy link
Member

bkase commented Mar 4, 2021

!approved-for-mainnet

@mrmr1993
Copy link
Member

mrmr1993 commented Mar 5, 2021

!ci-build-me

@mrmr1993 mrmr1993 merged commit 043a12b into MinaProtocol:master Mar 5, 2021
@jspada jspada linked an issue Mar 6, 2021 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.

Bug in Rosetta construction/metadata response - default fee is hardcoded
4 participants