Skip to content

Comments

feat: implement clientVersionV1 in engine API#7708

Closed
guha-rahul wants to merge 9 commits intoparadigmxyz:mainfrom
guha-rahul:main
Closed

feat: implement clientVersionV1 in engine API#7708
guha-rahul wants to merge 9 commits intoparadigmxyz:mainfrom
guha-rahul:main

Conversation

@guha-rahul
Copy link
Contributor

for #7668 ,
The implementation for the get_client_version_v1 logic in impl<Provider, EngineT> EngineApi<Provider, EngineT> is needed to be done.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

great start

we want to give the client info as argument to the new function:

and we create a default instance using the constants that are defined here:

@mattsse mattsse added the A-rpc Related to the RPC implementation label Apr 17, 2024
@onbjerg onbjerg changed the title added clientVersionV1 api function feat: implement clientVersionV1 in engine API Apr 18, 2024
@onbjerg onbjerg added the C-enhancement New feature or request label Apr 18, 2024
@guha-rahul guha-rahul closed this Apr 19, 2024
@mattsse mattsse reopened this Apr 19, 2024
@guha-rahul
Copy link
Contributor Author

sorry i accidentally closed this issue because I synced the commits.

@guha-rahul guha-rahul requested a review from mattsse April 21, 2024 08:20
@guha-rahul
Copy link
Contributor Author

hey should i reopen the pr with a different branch than main?

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

Some nits

If you open your PRs from a branch that isn't main next time, then we can take most of the smaller nits ourselves. We are not allowed to do that on your main branch unfortunately :(

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

also this should be a struct

/// version: 0.1.0
/// commit: defa64b2
/// ```
pub const CLIENTVERSIONV1: &str = const_str::concat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be a struct, the spec expects us to send a json object over the wire that looks like

{
  code: "RH",
  name: "Reth",
  version: "v0.2.0-beta.5",
  commit: "defa64b2"
}

Copy link
Contributor Author

@guha-rahul guha-rahul Apr 25, 2024

Choose a reason for hiding this comment

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

hey , when i am trying to compile I am getting two errors environment variable NAME_CLIENT not defined at compile time and environment variable CLIENT_CODE not defined at compile time . I have also added a struct and using that as CLIENTVERSIONV1 type. Do you think you can help me out a bit?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hey! that's because those two are not environment variables, they are constants. feel free to push your most recent changes with the struct and i'll take a look:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have pushed the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @onbjerg , i tried debugging though those errors and after hardcoding some values the errors were solved except for a EngineApi instance in crates/node-builder/src/launch/mod.rs. Can you give me some pointers on so that i can use NAME_CLIENT and CLIENT_CODE as env in compile time.

Copy link
Collaborator

Choose a reason for hiding this comment

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

i'm not keen on having those as environment variables as it complicates building and testing

Copy link
Contributor Author

@guha-rahul guha-rahul Apr 30, 2024

Choose a reason for hiding this comment

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

i'm not keen on having those as environment variables as it complicates building and testing

Hey, so I already changed those and in the engine_api.rs I imported the values from the reth_node_core crate but when I try to add to cargo.toml it's showing me a cyclic dependency error (it works without error if I don't add it to cargo.toml). Also when I try the same thing in crates/node-builder/src/launch/mod.rs , its showing me no CLIENTVERSIONV1 in the root. @onbjerg
And should I close this draft and create a new one from a different branch cuz its hindering me from contributing to other issues.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sure, open a new pr from a diff branch, this will also allow me to push to it

let's pick up the discussion in the new pr

@guha-rahul guha-rahul requested a review from onbjerg April 27, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants