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

nimbus initial commit #3036

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

nimbus initial commit #3036

wants to merge 7 commits into from

Conversation

pedromiguelmiranda
Copy link
Contributor

project structure with:

  • chronicles support
  • config files
  • layers handlers.

Pedro Miranda added 6 commits January 29, 2025 10:08
- chronicle support
- Added config files with support for both nimbus-eth clients configuration.
- thread model suggestion.
- Minimal nimbus config for given thread model.
- layers handlers.
@pedromiguelmiranda pedromiguelmiranda marked this pull request as ready for review January 29, 2025 12:10
@@ -104,6 +104,7 @@ VERIF_PROXY_OUT_PATH ?= build/libverifproxy/
update \
nimbus \
nimbus_execution_client \
nimbus_unified \
Copy link
Member

Choose a reason for hiding this comment

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

why not name it nimbus?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the target nimbus is on rampdown:
https://github.com/status-im/nimbus-eth1/blob/dev/pedro/kikof/Makefile#L217
image

and we need to solve issue #2738 and update some README make commands refs

Given that this is a project in development yet to be released (https://nimbus.guide/execution-client.html), how much time should we wait for the rampdown period?

Agree that it would be nice to get the renaming before starting landing this.

notice "Exited all services"

## Service monitoring
proc monitor*(nimbus: Nimbus) =
Copy link
Member

Choose a reason for hiding this comment

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

what's this for, ie what will it be doing?

Copy link
Contributor Author

@pedromiguelmiranda pedromiguelmiranda Feb 5, 2025

Choose a reason for hiding this comment

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

Monitor if one of the services ended (gracefully) and an to ask remaining services to end gracefully.
(check one the service prototype wrappers for an example).

This is a small naive mechanism using polling, to be replaced by some wake up mechanism (maybe a conditional variable)

setControlCHook(controlCHandler)

var
execution = LayerConfig(kind: Execution, executionConfig: NimbusConf())
Copy link
Member

Choose a reason for hiding this comment

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

both of the configs contain garbage-collected types - these cannot be passed as thread arguments - instead, one needs to allocate a memory areas with createShared (and release it manually as well).
There's a small example here: https://status-im.github.io/nim-style-guide/interop.html#passing-data-between-threads

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a nice hint. thank you
Wasn't aware of the configs..

# Short debugging identifier to be placed in the ENR
enrClientInfoShort* = toBytes("f")

func getNimGitHash*(): string =
Copy link
Member

Choose a reason for hiding this comment

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

we have a "nimbus_binary_common" file for hosting little helpers like this - the idea with that file is no matter what the binary contains, certain things work the same (logging options, version numbers etc) - it would be good to refactor the existing binaries to make use of such utilities, just like the logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great. all projects are implementing similar code for the same purpous.
Let me try to land that before this.

# Helper Functions
# ----------------------------------------------------------------------------

template fileExists(filename: string): bool =
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

as an alternative, if this function does not exist in io2, it's better to add a correctly implemented function there (ie an implementation that uses the right os utilities, similar to the above linked documentation but with different error handling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely nothing wrong with those components. This was my half way implementing unit tests for the createPidFile which is not being used.
Which will be moved to binary common as well

template removeFile(filename: string) =
try:
discard io2.removeFile(filename)
except IOError:
Copy link
Member

Choose a reason for hiding this comment

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

io2 does not raise exceptions, or at least it shouldn't - we use either Result or exceptions but not both in a single function (with a few exceptions that don't apply here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same as preivous comment

Comment on lines +37 to +39
# Short debugging identifier to be placed in the ENR
enrClientInfoShort* = toBytes("f")

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a fluffy specific identifier currently used in the ENR. I don't think you need it here.

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.

4 participants