-
Notifications
You must be signed in to change notification settings - Fork 92
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
base: master
Are you sure you want to change the base?
Conversation
] | ||
when (_nodeMiningEnabled nmc && not (_coordinationEnabled cc)) | ||
$ throwError "In-node mining is enabled but mining coordination is disabled" | ||
when (_nodeMiningEnabled nmc && view minerId (_nodeMiner nmc) == "") |
There was a problem hiding this comment.
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" ] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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.
1268e4d
to
6af6cc1
Compare
No description provided.