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

Support hildr #68

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

thinkAfCod
Copy link

@thinkAfCod thinkAfCod commented Nov 27, 2023

done for #64

@GrapeBaBa GrapeBaBa requested a review from norswap November 27, 2023 02:44
Copy link
Member

@norswap norswap left a comment

Choose a reason for hiding this comment

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

Nice work! Super happy we'll get to have multiple node options :)

I think the biggest thing we need to change is to not introduce a copy of every single option, and also simply reuse the engine code as-is.

An open question: do we want to handle spinning multiple nodes / engines via a single roll-op invocation? If we do, we'll need to find a way to make the port config multi-dimensional at least.

I think this scenario is tricky enough that it makes sense to run multiple roll-op commands with slightly different config files instead.

"""
Address to use to connect to the hildr-node RPC server ("http://127.0.0.1:11545" by default).
"""

Copy link
Member

Choose a reason for hiding this comment

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

We should not introduce separate config option, but reuse the existing one wherever possible (so after #67 is merged, l2_engine_rpc_url for instance).

Address the L2 hildr engine metrics server should bind to ("0.0.0.0" by default).
Ignored if :py:attribute:`node_metrics` is False.
"""

Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above, reuse existing options whenever possible. Totally fine to introduce new config option that Hildr has but the OP Labs version doesn't however (mention that in the comment for those options).

self.l2_hildr_enabled = False
"""
Whether to enable Hildr service (hildr node + hildr engine — False by default).
"""
Copy link
Member

Choose a reason for hiding this comment

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

I think we should probably have one config option per component where there are multiple options, and enums for the options.

So for instance, l2_engine_type and l2_node_type(orl2_engine_implem`? not sure what's better).

Is Hildr node interoperable with op-geth, and op-node with Hildr engine?


# Check if Node is installed and is the correct version.
if shutil.which("java") is not None:
version = lib.run("get jdk version", "java -version").replace("version", "").replace("\"", "")
Copy link
Member

Choose a reason for hiding this comment

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

This will throw an exception if java doesn't exist. You can get around it with the check=False option, or put this is a try statement.

Copy link
Member

Choose a reason for hiding this comment

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

Since this just uses op-geth, do we need this at all? We should just be able to run the normal op-geth code, right?

if config.l2_hildr_enabled:
hildr_engine.start(config)
hildr_node.start(config)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see, you're running everything side-by-side.
We can still reuse the code (e.g. for op-geth/engine) but we'll need to setup multiple ports at least.

I wonder if a better option is not to run roll-op multiple times with different config files.
It can be run once for the OP Labs version, then a second time for the hildr version (with different ports and Hildr turned on).

Can Hildr sequence at the moment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hildr not support sequencer right now, we use it as a validator with self engine.

lib.clone_repo(github_url, "clone the hildr repository")

# lib.run("checkout stable version", f"git checkout --detach {git_tag}",
# cwd="hildr")
Copy link
Member

Choose a reason for hiding this comment

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

remove comment


log_file = "logs/build_hildr.log"
print(
f"Starting to build the optimism repository. Logging to {log_file}\n"
Copy link
Member

Choose a reason for hiding this comment

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

update comment to say "hildr" instead of "optimism"

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