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

Proposal: Enable the migration of Floating-Point Calculations from Math to StrictMath #707

Open
halibobo1205 opened this issue Dec 17, 2024 · 12 comments

Comments

@halibobo1205
Copy link
Contributor

Simple Summary

     This proposal aims to activate the #87 network parameter to migrate the floating-point calculations from java.lang.Math to java.lang.StrictMath for cross-platform computational compatibility, for more details, please refer to TIP-697.

Simple Summary

     Up to GreatVoyage-v4.7.6(Anaximander), Java-Tron has utilized the class Math for floating-point calculations. However, the class Math may yield varying calculation results for identical inputs across different hardware platforms and JDK versions.
Looking ahead to potential cross-platform support and broader JDK version compatibility, Java-Tron needs to transition from java.lang.Math to a mathematical library that ensures consistent calculation results across platforms and newer JDK versions.

How to Initialize the Voting Request

  • Open the pow calculation algorithm migration proposal.
    • createProposal 87 1

Backwards Compatibility

     Since consensus-affecting changes will only be activated post-proposal approval, this migration maintains backward compatibility and preserves consensus from the genesis block onward.

@DongDongSunny
Copy link

@halibobo1205 in this case does the java-tron code changes PR submitted? if so could you share me the PR, if not when there will be PR changes

@halibobo1205
Copy link
Contributor Author

@halibobo1205 in this case does the java-tron code changes PR submitted? if so could you share me the PR, if not when there will be PR changes

@DongDongSunny, implemented in GreatVoyage-v4.7.7 (Epicurus) by PR:

@xxo1shine
Copy link
Contributor

@halibobo1205 After the proposal is passed, which platforms and JDK versions can Java-Tron support?

@CarlChaoCarl
Copy link

@halibobo1205
Math is more performant in most cases because platform math libraries are usually optimized.
What I want to know is whether there is actual performance data for Java-Tron transitioning from java.lang.Math to java.lang.StrictMath.

@CooperDepp
Copy link

@halibobo1205 This is definitely an important step. And I wonder except for the floating-point calculations, are there any other limitations to clear up before we could support arm platforms?

@halibobo1205
Copy link
Contributor Author

@xxo1shine @CooperDepp, This is one of the requirements for extending platforms and JDK versions, such as supporting the arm platform based on JDK17. Other improvements include dependency updates, code adaptation, etc.

@halibobo1205
Copy link
Contributor Author

performance

base: x86_64 ,16C 32G, java version "1.8.0_161"
bancor exchange: Time consumed is almost the same: 310+ ns.
image
DynamicEnergy: exponent is mostly 1, for better performance by StrictMath.
image

@CooperDepp
Copy link

@xxo1shine @CooperDepp, This is one of the requirements for extending platforms and JDK versions, such as supporting the arm platform based on JDK17. Other improvements include dependency updates, code adaptation, etc.

Thank you, and now java-tron only supports x86 platform right? What other platforms will TRON support in the future?

@halibobo1205
Copy link
Contributor Author

@CooperDepp , java-tron still only supports the x86 platform, TRON will support arm64 platforms in the future.

@Tinabates
Copy link

I don’t know how to bring the contract to my wallet smh

@Tinabates
Copy link

Thank you

@halibobo1205
Copy link
Contributor Author

I don’t know how to bring the contract to my wallet smh

@Tinabates , please go here https://github.com/tronprotocol/java-tron/issues for more help!

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

No branches or pull requests

6 participants