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

Any chance to run BESU on ARM? #8440

Closed
icemagno opened this issue Mar 19, 2025 · 3 comments
Closed

Any chance to run BESU on ARM? #8440

icemagno opened this issue Mar 19, 2025 · 3 comments
Assignees

Comments

@icemagno
Copy link

I'm trying to run BESU on my Rasp PI (Docker). Any chance?

@jflo
Copy link
Contributor

jflo commented Mar 25, 2025

The current Pi limits of 8GB of RAM mean you can only run besu, not a consensus client. And even then 8GB is really tight.

We do not recommend for mainnet, but for a private network not needing a consensus layer... maybe?

We can get you more specific details.

@garyschulte
Copy link
Contributor

Besu works well on arm64 on both Darwin (macos) and linux, and it has native extensions to improve performance. However, the arm64 SBC's are a bit limited in terms of i/o bandwidth and raw processor speed. Mainnet evm opcodes and precompiles have historically been priced with 30 MGas/sec as a performance target. That is pretty conservative and there is a working group that is reevaluating gas to reflect more "capable" modern machines.

I say this with ❤ because I am an arm64 and riscv64 enthusiast, but the current crop of low power SBCs are not really powerful enough to be relied on for anything with financial implications, like validating/staking. A cheap way to quantify just the processing power is to use besu's evmtool to benchmark the precompile performance:

rock5-white:besu:% build/install/besu/bin/evmtool benchmark                                                                                                                            <feature/required-besu-native>
besu/v25.3-develop-923270e/linux-aarch_64/openjdk-java-21
Benchmarks for altBn128
Native AltBN128
AltBN128 Add    500 gas @    5.1 µs /    98.5 MGps
AltBN128 Mul 40,000 gas @  257.7 µs /   155.2 MGps
AltBN128 2 pairing 180,000 gas @2,566.8 µs /    70.1 MGps
AltBN128 4 pairing 260,000 gas @3,669.6 µs /    70.9 MGps
AltBN128 6 pairing 340,000 gas @4,763.5 µs /    71.4 MGps
Benchmarks for EcRecover
Native secp256k1
ecrecover  3,000 gas @  207.2 µs /    14.5 MGps
Benchmarks for ModExp
Java modExp
ModEXP eip_example1            1,360 gas @   41.6 µs /    32.7 MGps
ModEXP eip_example2            1,360 gas @    0.9 µs / 1,434.8 MGps
ModEXP even-modulus-1          4,880 gas @  264.1 µs /    18.5 MGps
ModEXP even-modulus-2          2,300 gas @   96.2 µs /    23.9 MGps
ModEXP even-modulus-3          3,333 gas @1,510.0 µs /     2.2 MGps
ModEXP nagydani-1-square         200 gas @    4.1 µs /    48.3 MGps
ModEXP nagydani-1-qube           200 gas @    4.3 µs /    46.2 MGps
ModEXP nagydani-1-pow0x10001     341 gas @   11.2 µs /    30.5 MGps
ModEXP nagydani-2-square         200 gas @   12.0 µs /    16.7 MGps
ModEXP nagydani-2-qube           200 gas @   13.2 µs /    15.1 MGps
ModEXP nagydani-2-pow0x10001   1,365 gas @   37.0 µs /    36.9 MGps
ModEXP nagydani-3-square         341 gas @   40.7 µs /     8.4 MGps
ModEXP nagydani-3-qube           341 gas @   46.9 µs /     7.3 MGps
ModEXP nagydani-3-pow0x10001   5,461 gas @  138.7 µs /    39.4 MGps
ModEXP nagydani-4-square       1,365 gas @  131.4 µs /    10.4 MGps
ModEXP nagydani-4-qube         1,365 gas @  156.4 µs /     8.7 MGps
ModEXP nagydani-4-pow0x10001  21,845 gas @  521.0 µs /    41.9 MGps
ModEXP nagydani-5-square       5,461 gas @  610.1 µs /     9.0 MGps
ModEXP nagydani-5-qube         5,461 gas @  539.8 µs /    10.1 MGps
ModEXP nagydani-5-pow0x10001  87,381 gas @1,997.2 µs /    43.8 MGps
Benchmarks for Secp256k1
Native secp256k1
secp256k1 signature recovery for 172.5 µs
Benchmarks for Bls12
Bls12 G1 Add    375 avg gas @   19.7 µs /    19.0 MGps
Bls12 G1 MSM   501,672 total gas @30,145.1 µs /    16.6 MGps
Bls12 MapFpToG1  5,500 avg gas @  334.3 µs /    16.5 MGps
Bls12 G2 Add    600 avg gas @   33.6 µs /    17.9 MGps
Bls12 G2 MSM   991,080 total gas @47,976.6 µs /    20.7 MGps
Bls12 MapFp2G1 23,800 avg gas @1,472.1 µs /    16.2 MGps
Bls12 Pairing 2,209,700 total gas @124,958.6 µs /    17.7 MGps

Altbn128 is really the only precompile that meets the current conservative 'bare minimum' performance of 30 mgas/s. And as I mentioned, this is going to be revised upwards in the future.

Besu works GREAT on arm64, and there are experimental builds of riscv64. But it has subpar financial performance.

If you have an exotic or cool SBC or arm64 machine you want to evaluate the performance of, evmtool is distributed in the besu distribution, and the precompile benchmark subcommand is a good back-of-the-napkin way to gauge performance.

FWIW, this is what the current crop of commodity NUC computers gets for that same benchmark:

➜  besu git:(feature/precompile-caching-part1) ./build/install/besu/bin/evmtool benchmark
besu/v25.3-develop-93bb963/linux-x86_64/oracle-java-22
Benchmarks for altBn128
Native AltBN128
AltBN128 Add    500 gas @    2.4 µs /   207.4 MGps
AltBN128 Mul 40,000 gas @   34.1 µs / 1,173.9 MGps
AltBN128 2 pairing 180,000 gas @  307.6 µs /   585.2 MGps
AltBN128 4 pairing 260,000 gas @  433.0 µs /   600.5 MGps
AltBN128 6 pairing 340,000 gas @  558.7 µs /   608.6 MGps
Benchmarks for EcRecover
Native secp256k1
ecrecover  3,000 gas @   32.9 µs /    91.1 MGps
Benchmarks for ModExp
Java modExp
ModEXP eip_example1            1,360 gas @   10.5 µs /   129.1 MGps
ModEXP eip_example2            1,360 gas @    5.9 µs /   231.5 MGps
ModEXP even-modulus-1          4,880 gas @   43.2 µs /   112.9 MGps
ModEXP even-modulus-2          2,300 gas @   34.0 µs /    67.6 MGps
ModEXP even-modulus-3          3,333 gas @  540.2 µs /     6.2 MGps
ModEXP nagydani-1-square         200 gas @    1.5 µs /   131.3 MGps
ModEXP nagydani-1-qube           200 gas @    1.2 µs /   172.8 MGps
ModEXP nagydani-1-pow0x10001     341 gas @    2.4 µs /   139.2 MGps
ModEXP nagydani-2-square         200 gas @    3.2 µs /    62.3 MGps
ModEXP nagydani-2-qube           200 gas @    3.2 µs /    63.1 MGps
ModEXP nagydani-2-pow0x10001   1,365 gas @    6.8 µs /   200.5 MGps
ModEXP nagydani-3-square         341 gas @   10.1 µs /    33.8 MGps
ModEXP nagydani-3-qube           341 gas @   10.9 µs /    31.3 MGps
ModEXP nagydani-3-pow0x10001   5,461 gas @   23.7 µs /   230.3 MGps
ModEXP nagydani-4-square       1,365 gas @   29.4 µs /    46.4 MGps
ModEXP nagydani-4-qube         1,365 gas @   32.2 µs /    42.4 MGps
ModEXP nagydani-4-pow0x10001  21,845 gas @   79.9 µs /   273.4 MGps
ModEXP nagydani-5-square       5,461 gas @   86.1 µs /    63.4 MGps
ModEXP nagydani-5-qube         5,461 gas @   99.3 µs /    55.0 MGps
ModEXP nagydani-5-pow0x10001  87,381 gas @  297.1 µs /   294.1 MGps
Benchmarks for Secp256k1
Native secp256k1
secp256k1 signature recovery for 26.3 µs
Benchmarks for Bls12
Bls12 G1 Add    375 avg gas @    4.0 µs /    94.7 MGps
Bls12 G1 MSM   501,672 total gas @4,830.4 µs /   103.9 MGps
Bls12 MapFpToG1  5,500 avg gas @   44.9 µs /   122.5 MGps
Bls12 G2 Add    600 avg gas @    5.7 µs /   104.6 MGps
Bls12 G2 MSM   991,080 total gas @6,855.3 µs /   144.6 MGps
Bls12 MapFp2G1 23,800 avg gas @  168.8 µs /   141.0 MGps
Bls12 Pairing 2,209,700 total gas @15,239.3 µs /   145.0 MGps

@garyschulte
Copy link
Contributor

of course it should be obvious that any apple silicon arm machine is VERY capable of running besu. My response was tailored to SBCs

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

3 participants