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

Build lighthouse on RISC-V CPU architecture #6297

Open
haurog opened this issue Aug 22, 2024 · 0 comments
Open

Build lighthouse on RISC-V CPU architecture #6297

haurog opened this issue Aug 22, 2024 · 0 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@haurog
Copy link

haurog commented Aug 22, 2024

Description

To be able to build Lighthouse on a risc-v platform we found the following packages to be a problem. This ticket is meant as a reference to see what needs to be done and also coordinate with the upstream libraries.

cpufeatures
Is used in about a dozen packages in lighthouse and needs to be fixed upstream. It does not have any support for RISC-V and fails building which prevents all these packages to be built.

ring
0.16 versions of the library do not build on riscv, the 0.17 versions do. Unfortunately this library is used a few levels deep in the following packages:

  • jsonwebtoken within lighthouse beacon_node/execution_layer. It can be updated from 8 to 9 which uses the newer ring package without issues and then builds.
  • rcgen used in libp2p-tls depends on the 0.16 version. The newer version of rcgen (0.12.1 or 0.13) support riscv. ,

libp2p-tls
As mentioned above this library needs to have its ring dependency updated through an update of the rcgen package to at least v0.12.1. Unfortunately v0.13 changes some function signatures and would therefore make a larger rework of libp2p necessary. Luckily version 0.12.1 of rcgen supports riscv with maybe only minimal changes in libp2p. So this might be the best option.

We fixed these packages locally in our own setup in a quick and dirty way and know that lighthouse builds and runs on a risc-v board. It can even sync to testnet/mainnet.

We will try to make the necessary PRs to some of these packages in the coming weeks and will see with the upstream projects what the best solution will be.

If anyone sees a different approach to updating these dependencies we can obviously go a different path.

Version

We based our RISC-V builds on the 5.2.1 release of lighthouse.

Present Behaviour

Builds and runs on RISC-V from our own forked repository.

Expected Behaviour

Hopefully we will get the changes into the necessary packages such that lighthouse can be built on RISC-V architecture directly from the official repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants