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

feat(reth): add reth execution client #332

Merged
merged 9 commits into from
Jan 2, 2024
Merged

feat(reth): add reth execution client #332

merged 9 commits into from
Jan 2, 2024

Conversation

selfuryon
Copy link
Collaborator

Add reth EL client.

Close #323

@selfuryon selfuryon self-assigned this Jun 27, 2023
@selfuryon selfuryon force-pushed the feat/reth branch 2 times, most recently from 676e662 to bf879a8 Compare July 10, 2023 11:55
@selfuryon
Copy link
Collaborator Author

Related to boa-dev/boa#3074

@selfuryon
Copy link
Collaborator Author

Asked in reth telegram chat about boa dependency

@georgewhewell
Copy link

@selfuryon thanks for this. since paradigmxyz/reth#3820 boa was updated, i changed this pr to use main branch and it builds correctly now. i guess next release should work

@selfuryon
Copy link
Collaborator Author

@georgewhewell Thanks for information! I'll wait that!

@selfuryon selfuryon force-pushed the feat/reth branch 2 times, most recently from 150450b to 3fed9c9 Compare August 10, 2023 10:21
@selfuryon selfuryon force-pushed the feat/reth branch 4 times, most recently from 1571264 to 495cad7 Compare August 28, 2023 21:13
@dzmitry-lahoda
Copy link
Contributor

so can this be merged?

@selfuryon
Copy link
Collaborator Author

so can this be merged?

Previously I had troubles with bindgen, cuz they have two dependencies with the same version of bindgen, but with two different links to it (git and cargo), and cargo vendor couldn't vendor them. But now I see that the error is different. I'll try to fix that

@dzmitry-lahoda
Copy link
Contributor

dzmitry-lahoda commented Sep 26, 2023

(git and cargo)

oh, never solved such issue before. give cargo good with it - may be raise/search issue on nixpkgs?

also consider asking https://github.com/ipetkov/crane/ here. it clever wrapper around nixpkgs. it may fixed or or at least author more agile to fix

also raise issue on reth - why? because they must support reth for determinism with vendor to provide secure solution.

i would tbh not even thing - just race 3 issues to good people :)

@selfuryon
Copy link
Collaborator Author

selfuryon commented Sep 26, 2023

Looks like the same situation, but with c-kzg now...

$ cat Cargo.lock | rg "c-kzg"
name = "c-kzg"
source = "git+https://github.com/ethereum/c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d#f5f6f863d475847876a2bd5ee252058d37c3a15d"
name = "c-kzg"
source = "git+https://github.com/ethereum/c-kzg-4844#fbef59a3f9e8fa998bdb5069d212daf83d586aa5"

Perhaps it goes to weird naming:

cargo-vendor-dir> ln: failed to create symbolic link '/nix/store/v4ddbm6lcz8rc2cgbx1d6yhdnna2f21w-cargo-vendor-dir/c-kzg-0.1.0/i9zsf9iwykynaa9iax9fjahwr2r95cwq-c-kzg-0.1.0': Permission denied
error: build of '/nix/store/260hdhr87jj1ssnbr13fsw1n78mricb6-cargo-vendor-dir.drv' on 'ssh://nix-ssh@garnix3' failed: builder for '/nix/store/260hdhr87jj1ssnbr13fsw1n78mricb6-cargo-vendor-dir.drv' failed with exit code 1;
       last 1 log lines:
       > ln: failed to create symbolic link '/nix/store/v4ddbm6lcz8rc2cgbx1d6yhdnna2f21w-cargo-vendor-dir/c-kzg-0.1.0/i9zsf9iwykynaa9iax9fjahwr2r95cwq-c-kzg-0.1.0': Permission denied
       For full logs, run 'nix log /nix/store/260hdhr87jj1ssnbr13fsw1n78mricb6-cargo-vendor-dir.drv'.
error: builder for '/nix/store/260hdhr87jj1ssnbr13fsw1n78mricb6-cargo-vendor-dir.drv' failed with exit code 1;
       last 1 log lines:
       > ln: failed to create symbolic link '/nix/store/v4ddbm6lcz8rc2cgbx1d6yhdnna2f21w-cargo-vendor-dir/c-kzg-0.1.0/i9zsf9iwykynaa9iax9fjahwr2r95cwq-c-kzg-0.1.0': Permission denied
       For full logs, run 'nix log /nix/store/260hdhr87jj1ssnbr13fsw1n78mricb6-cargo-vendor-dir.drv'.
error: 1 dependencies of derivation '/nix/store/26jky1314h7ivcyspi6r58jih1izi96k-reth-0.1.0-alpha.10.drv' failed to build

@dzmitry-lahoda
Copy link
Contributor

just direct call to cargo vendor without nix works? vendor has bugs too btw (so can race 4th issue onto rust)

read error, do not see root cause/workaround yet - only nix patch as solution, which is ugly

@dzmitry-lahoda
Copy link
Contributor

so error, like it vendored and nix stored lib. than tried to repeat under different subfolder as naming different. sure previous store read only.

feels like pure nix bug of nixpkgs. i guess bug exists on nixpkgs already of good to find/create.

if that is the case, big sed patch is way to go + bug on nixpkgs for tracking.

@selfuryon
Copy link
Collaborator Author

Sad, but cargo vendor doesn't work for duplicated dependencies with the same version but different sources:

error: failed to sync

Caused by:
  found duplicate version of package `c-kzg v0.1.0` vendored from two sources:

  	source 1: https://github.com/ethereum/c-kzg-4844?rev=f5f6f863d475847876a2bd5ee252058d37c3a15d#f5f6f863
  	source 2: https://github.com/ethereum/c-kzg-4844#fbef59a3

So anyway, need to do a patch to reth... Previously different sources for bindgen were in sub dependency packages, but now it in reth component itself, so it'll be easier to fix that

@selfuryon
Copy link
Collaborator Author

Asked about that case in reth chat

@dzmitry-lahoda
Copy link
Contributor

Actually it may be bug in cargo too.

@selfuryon
Copy link
Collaborator Author

selfuryon commented Sep 27, 2023

Opened an issue in reth: paradigmxyz/reth#4826

Cargo also has opened issue about that situation: rust-lang/cargo#10310 without any resolution for now... So it's inconsistent behavior between cargo build and cargo vendor

@selfuryon selfuryon force-pushed the feat/reth branch 2 times, most recently from 24cbfc5 to f1acf8b Compare November 23, 2023 23:34
@selfuryon selfuryon marked this pull request as ready for review November 24, 2023 00:20
@selfuryon
Copy link
Collaborator Author

Finally, I can build reth with nix. But I confused by buildbot cuz it has only 13 checks and I can't find reth there. Is it ok?

@selfuryon selfuryon added the Type: Enhancement Improvements or additions label Nov 24, 2023
@aldoborrero
Copy link
Collaborator

@selfuryon it should build all apps as we're using devour-flake

Also, would you mind adding reth to the list of docs/apps.md :)

@selfuryon
Copy link
Collaborator Author

@selfuryon it should build all apps as we're using devour-flake

Also, would you mind adding reth to the list of docs/apps.md :)

Thanks, I added reth to apps.md. I also tested the CI: I commented the problem test in build manifest, locally I can't build this package due to failed test, but I see that CI shows everything is fine.

@aldoborrero Can you pls check that you also can't build that package locally. If so, something works not like we want.

@aldoborrero
Copy link
Collaborator

aldoborrero commented Nov 26, 2023

@selfuryon when running locally I'm obtaining:

framework :: Dev/nix-community/ethereum.nix ‹feat/reth› % g pull                                                                                                                                                                                                                                                                                                          
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 6 (delta 3), reused 6 (delta 3), pack-reused 0
Unpacking objects: 100% (6/6), 506 bytes | 29.00 KiB/s, done.
From github.com:nix-community/ethereum.nix
   5e297e5..8a43a3d  gh-pages   -> origin/gh-pages
Updating cb62d19..14b6745
Fast-forward
 docs/apps.md                                |  1 +
 packages/clients/execution/reth/default.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 packages/default.nix                        |  2 ++
 3 files changed, 49 insertions(+)
 create mode 100644 packages/clients/execution/reth/default.nix
framework :: Dev/nix-community/ethereum.nix ‹feat/reth› % nix build .#reth                                                                                                                                                                                                                                                                                                
error: builder for '/nix/store/qbqjshqhbfsswbadd95a7bryazprlmcy-reth-0.1.0-alpha.11.drv' failed with exit code 101;
       last 30 log lines:
       > test node::tests::parse_metrics_port ... ok
       > test node::tests::parse_config_path ... ok
       > test node::tests::parse_db_path ... ok
       > test node::tests::parse_dev ... ok
       > test version::tests::assert_extradata_less_32bytes ... ok
       > test node::tests::parse_common_node_command_chain_args ... ok
       > test node::tests::parse_instance ... ok
       > test node::tests::parse_port ... ok
       > test cli::tests::parse_color_mode ... ok
       > test cli::tests::override_trusted_setup_file ... FAILED
       > test cli::tests::parse_logs_path ... ok
       > test init::tests::success_init_genesis_sepolia ... ok
       > test init::tests::fail_init_inconsistent_db ... ok
       > test init::tests::success_init_genesis_goerli ... ok
       > test init::tests::init_genesis_history ... ok
       > test init::tests::success_init_genesis_mainnet ... ok
       >
       > failures:
       >
       > ---- cli::tests::override_trusted_setup_file stdout ----
       > thread 'cli::tests::override_trusted_setup_file' panicked at 'Could not create log directory: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', /build/source/crates/tracing/src/lib.rs:86:42
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       >
       >
       > failures:
       >     cli::tests::override_trusted_setup_file
       >
       > test result: FAILED. 56 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
       >
       > error: test failed, to rerun pass `--lib`
       For full logs, run 'nix log /nix/store/qbqjshqhbfsswbadd95a7bryazprlmcy-reth-0.1.0-alpha.11.drv'.
framework :: Dev/nix-community/ethereum.nix ‹feat/reth› %

I'll double-check why is not building all inputs on CI with Mic92 tomorrow (maybe I need to re-add nix flake check that uses devour-flake under the hood)

@selfuryon
Copy link
Collaborator Author

@selfuryon when running locally I'm obtaining:

framework :: Dev/nix-community/ethereum.nix ‹feat/reth› % g pull                                                                                                                                                                                                                                                                                                          
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 6 (delta 3), reused 6 (delta 3), pack-reused 0
Unpacking objects: 100% (6/6), 506 bytes | 29.00 KiB/s, done.
From github.com:nix-community/ethereum.nix
   5e297e5..8a43a3d  gh-pages   -> origin/gh-pages
Updating cb62d19..14b6745
Fast-forward
 docs/apps.md                                |  1 +
 packages/clients/execution/reth/default.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 packages/default.nix                        |  2 ++
 3 files changed, 49 insertions(+)
 create mode 100644 packages/clients/execution/reth/default.nix
framework :: Dev/nix-community/ethereum.nix ‹feat/reth› % nix build .#reth                                                                                                                                                                                                                                                                                                
error: builder for '/nix/store/qbqjshqhbfsswbadd95a7bryazprlmcy-reth-0.1.0-alpha.11.drv' failed with exit code 101;
       last 30 log lines:
       > test node::tests::parse_metrics_port ... ok
       > test node::tests::parse_config_path ... ok
       > test node::tests::parse_db_path ... ok
       > test node::tests::parse_dev ... ok
       > test version::tests::assert_extradata_less_32bytes ... ok
       > test node::tests::parse_common_node_command_chain_args ... ok
       > test node::tests::parse_instance ... ok
       > test node::tests::parse_port ... ok
       > test cli::tests::parse_color_mode ... ok
       > test cli::tests::override_trusted_setup_file ... FAILED
       > test cli::tests::parse_logs_path ... ok
       > test init::tests::success_init_genesis_sepolia ... ok
       > test init::tests::fail_init_inconsistent_db ... ok
       > test init::tests::success_init_genesis_goerli ... ok
       > test init::tests::init_genesis_history ... ok
       > test init::tests::success_init_genesis_mainnet ... ok
       >
       > failures:
       >
       > ---- cli::tests::override_trusted_setup_file stdout ----
       > thread 'cli::tests::override_trusted_setup_file' panicked at 'Could not create log directory: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', /build/source/crates/tracing/src/lib.rs:86:42
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       >
       >
       > failures:
       >     cli::tests::override_trusted_setup_file
       >
       > test result: FAILED. 56 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
       >
       > error: test failed, to rerun pass `--lib`
       For full logs, run 'nix log /nix/store/qbqjshqhbfsswbadd95a7bryazprlmcy-reth-0.1.0-alpha.11.drv'.
framework :: Dev/nix-community/ethereum.nix ‹feat/reth› %

I'll double-check why is not building all inputs on CI with Mic92 tomorrow (maybe I need to re-add nix flake check that uses devour-flake under the hood)

Now it works fine, I checked with failed tests, and CI can't build it, so it works :)

@selfuryon
Copy link
Collaborator Author

@aldoborrero @brianmcgee Can you check this PR pls?

Copy link
Collaborator

@brianmcgee brianmcgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@selfuryon selfuryon merged commit 698cf4a into main Jan 2, 2024
61 checks passed
@selfuryon selfuryon deleted the feat/reth branch January 2, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improvements or additions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for reth
5 participants