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

validate host architecture for production mining #1864

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

Conversation

larskuhtz
Copy link
Contributor

No description provided.

]
when (_nodeMiningEnabled nmc && not (_coordinationEnabled cc))
$ throwError "In-node mining is enabled but mining coordination is disabled"
when (_nodeMiningEnabled nmc && view minerId (_nodeMiner nmc) == "")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this check also relevant when just mining coordination is enabled (but no node-mining)?

-- This is a heuristic and we are rather a little too restrictiv. In the
-- future we may also consider uname -m and/or cpuinfo (including flags) here.
--
supportedArchs = [ "x86_64" ]
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 value needs to be double checked for the release binaries, i.e. the binaries and docker images produced by the CI cabal builds once CI builds for this branch are available.

Copy link
Contributor

@edmundnoble edmundnoble Mar 20, 2024

Choose a reason for hiding this comment

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

Can we do a blacklist instead for ARM architectures? I think we want to be conservative here, seeing as this prevents a node from even starting

#else
hostArch = "unknown"
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An alternative would be to make use of the uname systems call at runtime. However, the resulting utsname structure is underspecified in POSIX (the length of the fields varies between different implementations). This would require either the implementation of c-wrappers for accessing the fields, or the use of a preprocessor (e.g. hsc) or configure script, or encoding a heuristic in C-macros similar to above code.

Overall, above macro that statically gets the value from GHC seems the simplest approach. If needed, it can be easily adjusted in the future by adding more cases.

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.

None yet

2 participants