Skip to content

Enable lighthouse to build on riscv64#7310

Closed
haurog wants to merge 1 commit into
sigp:unstablefrom
haurog:unstable
Closed

Enable lighthouse to build on riscv64#7310
haurog wants to merge 1 commit into
sigp:unstablefrom
haurog:unstable

Conversation

@haurog

@haurog haurog commented Apr 10, 2025

Copy link
Copy Markdown
Contributor

Issue Addressed

#6297
This will fully solve the issue and it can be closed.

Proposed Changes

Add riscv64 architecture in the bls_hardware_acceleration() function.
It will return false in every case as there is no hardware acceleration available on this platform at the moment. This can be changed later when actual hardware acceleration is used and specific code for this hardware has been implemented

Additional Info

Build tested on my lichee pi 3a board.

@cmd0s

cmd0s commented Apr 10, 2025

Copy link
Copy Markdown
Contributor

Duplicated with #7309

@haurog

haurog commented Apr 10, 2025

Copy link
Copy Markdown
Contributor Author

Awesome, I have not seen your PR. Great work on getting a full node to run on riscv by the way.

@michaelsproul

Copy link
Copy Markdown
Member

Thanks for the PR @haurog. I will close in favour of #7309 seeing as @cmd0s got in slightly earlier!

How come you both ended up submitting PRs at the same time? Did this coincide with the end of an EPF project?

@cmd0s

cmd0s commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

How come you both ended up submitting PRs at the same time? Did this coincide with the end of an EPF project?

Probably because I mentioned it on the EoA Discord channel - that likely prompted both of us to submit around the same time. :)

image

Earlier, I also compiled Lighthouse v6.0.1 on RISC-V, but it required significantly more modifications. I wrote about it on my blog: https://www.web3pi.io/blog/ethereum-node-on-risc-v

@haurog

haurog commented Apr 11, 2025

Copy link
Copy Markdown
Contributor Author

How come you both ended up submitting PRs at the same time? Did this coincide with the end of an EPF project?

@michaelsproul
No Problem, @cmdos deserves all the fame for it. It was exactly how he mentioned. I was working on another client to build on riscv again when I saw his message in the Ethereum on ARM discord. So, the next day, I tried to build the newest lighthouse on the my board and it was so much simpler than it was last year. I checked that there is no PR from him, so I made my own one. It is great that he did one as well and that he was earlier. Don't forget to close the associated issue as well. I am not connected with any EPF project. Not sure about @cmdos.

To shill riscv a bit: Now that lighthouse is the 2nd consensus client to be able to be built out of the box on riscv boards, it would be awesome if you could automate a riscv build in your CI. Geth does this already as well as MEV-Boost. Nimbus at least seems open to the idea. See a discussion yorick, tersec and I had on the R&D discord a few weeks ago: https://discord.com/channels/595666850260713488/595721451651465227/1351180168365998101 another discussion between yorick and potuz from the same time is also interesting: https://discord.com/channels/595666850260713488/692062809701482577/1351186849946669116

At the moment the available riscv hardware is just barely powerful enough to run an RPC node on mainnet. This is already a huge leap compared to what we had last summer. I expect that in a year or so, more powerful boards will be available and people will want to run clients on these boards. Yorick from eth-docker extended his software to be able to run on riscv. The biggest problem at the moment is that there are only riscv docker images available for geth. If lighthouse would provide some as well, that would be amazing and people could start using riscv boards with a much lower barrier to entry than there is now.

@michaelsproul

Copy link
Copy Markdown
Member

Awesome, thank you both!

I think we could set up some RISCV builds using the same cross-compilation toolkit we use for ARM. Would either of you be interested in working on this?

If so, have a look at the makefile and build-aarch64 job. There are also some docs in the LH book.

@haurog

haurog commented Apr 11, 2025

Copy link
Copy Markdown
Contributor Author

I aligned with @cmd0s and he is more than happy to look into it.

@cmd0s

cmd0s commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

I'm really glad to see your willingness to adopt the RISC-V architecture!

Over the past few months, I've spent quite a bit of time on this topic - I have several different development boards with RISC-V processors, so I'll be able to run proper tests on real hardware.

I'm also working on a project called Web3 Pi, which simplifies and automates the process of running nodes on Raspberry Pi (ARM). I'd be happy to help with getting Lighthouse running smoothly on RISC-V as well.

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.

3 participants