Repository navigation
Expand ARM Architecture Compatibility #5954
Copy link
Copy link
Closed
Labels
topic:DBDatabaseDatabasetopic:consensustopic:deploymentconfiguration, startup commandconfiguration, startup commandtype:feature
Description
Background
Java-Tron currently only supports the x86 architecture. Nevertheless, ARM architecture has gained significant traction recently, especially in cloud computing and mobile devices. ARM processors are known for their energy efficiency and cost-effectiveness, making them increasingly popular in data centers, cloud computing, and edge computing scenarios. It would be great to have the option to run Java-Tron on the ARM architecture.
Key developments in ARM architecture:
- Apple's transition from Intel to its ARM-based processors for Macs, dubbed Apple Silicon
- AWS Graviton, Microsoft Azure Ampere Altra, Alibaba Cloud Yitian 710 and Google Axion processors used in cloud computing
- Increasing adoption of ARM in supercomputers and high-performance computing
ARM advantages:
- Better performance per watt, low energy consumption, and low cost
- Lower total cost of ownership for data centers
- Growing ecosystem and software support
Related Issues and PRs
- RocksDB Linux ARM support. #5845
- M3 MacBook Pro / aarch64 unable to run java-tron node. #5815
- Java-tron - Release linux/arm64 builds #4692
- Why my node stopped sync? #4592
- run private chain on mac(m2) with errors #4548
- FullNode.jar doesn't start without any error message #4534
- Building on ARM64 fails #4525
- Update protoc-gen-grpc-java dependency to > v1.26.0 to be able to build in ARM64 #4248
- Run java-tron on ARM - AWS Arm-based Graviton2 instances / Apple M1 #4132
- Tron compile with Apple Silicon MacBook Pro m1 #3834
- Build failed Raspbian #363
Scope of Impact
- Build and deployment processes
- Core application code
- Third-party dependencies
- Development and testing environments
Current Progress Summary
-
JDK version
- x86 is limited to JDK 1.8
- arm is limited to JDK 17
-
Native code
- RocksDBJNI: org.rocksdb:rocksdbjni:9.7.4
- zksnark-java-sdk: io.github.tronprotocol:zksnark-java-sdk:1.0.0
-
Third-party dependencies
- protoc-gen-grpc-java: GreatVoyage-v4.7.3 released Oct 25, 2023, upgraded io.grpc:protoc-gen-grpc-java from 1.9.0 to 1.52.1 for ARM64 architecture by feat(net):update com.google.protobuf and io.grpc version #5254
- lombok: 1.18.12->1.18.34(Lombok Changelog)
- aspectjrt: 1.8.13->1.9.8 AspectJ Java version compatibility
- add
javax.annotation:1.3.2andjavax.jws:1.1, JEP 320: Remove the Java EE and CORBA Modules
-
Floating-point arithmetic
- Migrate pow operation from java.lang.Math to java.lang.StrictMath in GreatVoyage-v4.7.7(Epicurus)
- Replace
java.mathwith the cross-platform consistentjava.strictMathin GreatVoyage-v4.8.0(Kant) - For historical data(the Bancor trading pair), Hardcoded Special Cases(48 POW calculation instances)
-
Build and deployment process
- Update build scripts to support ARM architecture.
- Ensure CI/CD pipelines can be built and tested in ARM environments.
- Docker support
-
only supports RocksDB
- FullNode.jar and Toolkit.jar only support RocksDB on ARM
- Tookit.jar
db archive,db convertcommands are not supported on arm - ArchiveManifest.jar is not supported on arm
-
x86 vs ARM Performance Comparison
| Test Category | Test Type | Winner | Performance Difference | Notes |
|---|---|---|---|---|
| Database Read | Random Read | X86 | X86 outperforms ARM by ~60% | Significant advantage in random I/O |
| Database Read | Sequential Read | ARM | ARM outperforms X86 by ~6% | Better sequential access efficiency |
| Serialization | Serialization | ARM | ARM outperforms X86 by ~170% | Substantial advantage in data serialization |
| Serialization | Deserialization | ARM | ARM outperforms X86 by ~3% | Minimal but consistent advantage |
| Transaction | TRX Transfer | X86 | X86 outperforms ARM by ~23.8% | Better TRX transaction processing |
| Transaction | USDT Transfer | Comparable | No significant difference | Similar performance on both platforms |
| Signature Verification | Serial Processing | X86 | X86 outperforms ARM by ~14% | Single-threaded verification advantage |
| Signature Verification | Parallel Processing | ARM | ARM outperforms X86 by ~18% | Multi-threaded verification advantage |
- Related PRs
- feat(architecture): support arm64 based on JDK17 #6327
- refactor(db): unify database engine initialization #6421
- feat(db): update to rocksdb 9 for arm #6440
- feat(exit): throw TronError if JDK does not support #6455
- feat(jvm): optimize JVM GC logging for arm64 #6457
- feat(runtime): enforce Java 17 for ARM64 #6459
- feat(db/rocksdb): improve resource management with try-with-resources #6472
- feat(protocol/protoc): support macOS ARM64 natively compile #6502
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
topic:DBDatabaseDatabasetopic:consensustopic:deploymentconfiguration, startup commandconfiguration, startup commandtype:feature
Type
Projects
- StatusShow more project fieldsDone
Activity
angrynurd commentedon Aug 15, 2024
I am totally in favor of extending ARM architecture compatibility. This will allow Java-Tron to run on more platforms and take advantage of the benefits of the ARM architecture, such as higher energy efficiency and lower cost.
In my opinion, we can start with the following:
tomatoishealthy commentedon Aug 15, 2024
It sounds great, but I am a novice in ARM architecture. I am curious about the challenges of supporting ARM architecture.
Can you list something like a task list in the future? It is convenient to clearly understand the current status and future challenges.
halibobo1205 commentedon Aug 15, 2024
Here are some common considerations:
Important
Ensure the JDK version supports ARM Architecture. Consider using ARM-optimized JDK distributions.
Important
2. Native code
JNI (Java Native Interface) or other native code.
These native code components need to be recompiled or upgraded for ARM architecture.
Tip
3. Endianness
x86 is little-endian, while some ARM processors may be big-endian.
Check if any operations in the code(such as TVM) depend on a specific endianness, especially when handling binary data.
Tip
4. Memory alignment:
ARM architecture may have different memory alignment requirements than x86.
Check for code(such as TVM) that assumes specific memory alignments.
Tip
5. Atomic operations and concurrency
Some atomic operations(TVM) may be implemented differently on different architectures.
Review concurrent code to ensure it works correctly on ARM as well.
Caution
6. Floating-point arithmetic
ARM and x86 may have subtle differences in floating-point precision and behavior.
For applications that rely on precise floating-point calculations, comprehensive testing is necessary.
Tip
7. Performance optimization
x86-specific performance optimizations(TVM) may no longer be applicable on ARM.
Consider using ARM-specific optimization techniques.
Important
8. Third-party dependencies
Ensure all third-party libraries and dependencies support ARM architecture.
Some incompatible dependencies may need to be updated or replaced.
Important
9. Build and deployment process:
Tip
10. Hardware feature dependencies:
Check if the code(TVM) relies on x86-specific hardware features.
Alternatives may need to be found for ARM.
Tip
11. System calls and OS interactions
If the code makes direct system calls, adjustments may be needed for ARM.
Important
12. Cross-platform testing
317787106 commentedon Aug 15, 2024
@halibobo1205 Do you want to support ARM Architecture and latest JVM version at the same time ? Or just support ARM Architecture using JDK8 ?
halibobo1205 commentedon Aug 15, 2024
@317787106 JVM officially supports ARM:
According to Oracle Java SE Support Roadmap, JDK9 and JDK16 are non-LTS, and JDK 17 is LTS. Based on the above information, I propose that ARM support JDK17 as a minimum.
Warning
This is the last planned update of JDK 17 under the NFTC. Updates after September 2024 will be licensed under the Java SE OTN License (OTN) and production use beyond the limited free grants of the OTN license will require a fee.
angrynurd commentedon Aug 15, 2024
Regarding JDK version compatibility.
You recommend using an ARM-optimized JDK distribution. What specific ARM-optimized JDK distributions do you recommend? What are their performance and stability advantages?
abn2357 commentedon Aug 15, 2024
When is the expected completion time for this work? It sounds like a big project.
halibobo1205 commentedon Aug 15, 2024
@endiaoekoe I propose that ARM support JDK17 as a minimum.
halibobo1205 commentedon Aug 15, 2024
@abn2357 Tron currently only supports JDK 8, based on the above information, JDK17 supports ARM fully, perhaps Tron needs to upgrade JDK17 first, which is another big project.
zeusoo001 commentedon Aug 20, 2024
@halibobo1205 It sounds great, and I look forward to your implementation. I see that there may be subtle differences in floating point precision and behavior between ARM and x86. When supporting it, be sure to ensure data consistency. Also investigate whether there are other places that may cause data inconsistency.
Murphytron commentedon Aug 20, 2024
This issue has been added to the core devs community call #22, welcome to share the latest progress @halibobo1205, and discuss together with @endiaoekoe @tomatoishealthy @317787106 @zeusoo001 @abn2357.
halibobo1205 commentedon Aug 20, 2024
1. JDK version compatibility
After some brief research, I found ARM 64-bit versions of JDK 8 available. cc @endiaoekoe @317787106 @abn2357
• Requires payment for commercial use
• Regularly updated and supported by the Adoptium community
• Full enterprise version requires payment
• Relatively less well-known
• long-term support by Amazon
• Amazon runs Corretto internally on thousands of production services
halibobo1205 commentedon Aug 20, 2024
6. Floating-point arithmetic known issues:
Unfortunately, Tron does use
Math.pow()for floating-point calculations for the Bancor trading pair in ExchangeProcessor:Test case
Tron Should Use StrictMath to Avoid Cross-Platform Consistency Issues. To help ensure the portability on ARM for Java-Tron, I suggest a new proposal to convert Math to StrictMath. cc @zeusoo001
317787106 commentedon Aug 20, 2024
@halibobo1205 First support JDK8 on mac ARM and then extend to support JDK17 on linux and mac ARM may be smooth.
98 remaining items
Benson0224 commentedon Jul 24, 2025
Status Update: This issue has been scheduled for implementation in the next release, tentatively V4.8.1. The resolution plan is as follows
However, all discussions related to this issue remain welcome. Please continue the conversation here if you have relevant topics to contribute. Thanks!
At last, please follow V4.8.1 status at Issue #6342 and watch this issue (via Subscribe button) to track progress if needed. We value your involvement in TRON's development!
waynercheung commentedon Aug 1, 2025
Hi @halibobo1205 , after supporting ARM architecture, is there any impacts on x86 architecture?
halibobo1205 commentedon Aug 4, 2025
Previously, the following scenario was supported on X86 but will no longer be supported:
Developers could download a LevelDB database without an
engine.propertiesfile while having RocksDB configured in the config file. In this case, the node could start normally (initializingengine.propertiesas RocksDB) because RocksDB 5.15.10 was compatible with the LevelDB data format.However, after ARM deployment, RocksDB will be upgraded to version 7.7.3 (upgrade applies to ARM only), which is no longer compatible with the LevelDB data format. To minimize the occurrence of this issue, we will uniformly prohibit RocksDB from opening LevelDB databases in the future. Note that existing users who have already opened LevelDB databases will not be affected, as their LevelDB data has already been converted to RocksDB format by the compatible RocksDB version.
waynercheung commentedon Aug 13, 2025
@halibobo1205 , are there specific Java JDK version requirements for x86 and ARM architectures?
halibobo1205 commentedon Aug 13, 2025
@waynercheung X86 platforms strictly restrict JDK 1.8 usage, while ARM platforms support JDK 17 as the minimum requirement. JDK 17 has been tested and confirmed compatible on ARM platforms, with other versions not yet fully validated. JDK 17 is recommended for ARM deployments.