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

Apply equation changes and some comments. #7

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

ldgaetano
Copy link
Contributor

@ldgaetano ldgaetano commented Dec 23, 2023

Description

Made changes to the fusion reaction equation and added some comments for better readability.
I noticed error upon revision of the beta+/- reaction, so corrected the calculation, please review this.

Fixes #6

Type of change

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

How Has This Been Tested?

I ran all tests and all passed except for the GluonWFeesSpec, however the error is unrelated to anything I changed, so it might have been there before I changed anything.

To be composed in the future

Applying corresponding changes to the backend code.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ldgaetano ldgaetano changed the base branch from main to develop/gluon-contract-and-backend-fix December 24, 2023 00:35
@@ -758,15 +754,14 @@
// ** Fusion Ratio **
// min(q*, (SNeutrons * Pt / R))
// where q* is a constant, Pt is the price of gold in Ergs.
// The steps of multiplication and division done below are to avoid overflow errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

you say its to avoid overflow, are there tests that can test this in the off-chain code? Just to make sure we cover some edge cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I did not make tests for it. I did a math calculation by hand assuming worst case scenario (i.e. largest possible values given the chosen protocol paramters) to determine how to do the divisions. I guess it would be good to do tests for that though.

Copy link
Contributor

Choose a reason for hiding this comment

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

can you write one quick test for it. Dont need to be extensive. Just something so that we have reference for what the worst case scenario would be. After that its good to merge

@kii-dot kii-dot merged commit 8541bb6 into develop/gluon-contract-and-backend-fix Jan 8, 2024
@kii-dot kii-dot deleted the lgd/gluon-contract branch January 8, 2024 07:37
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.

Gluon contract review and backend modification.
3 participants