Add RamHash as new -ac_algo option for HSC's #318

Open
opened 10 months ago by duke · 5 comments
duke commented 10 months ago
Owner

We will be adding a new PoW algo RamHash (also known as LXRHash) from https://gitlab.com/accumulatenetwork/ecosystem/LXRMining/-/tree/main/c and documenting the process of adding a new PoW algo in #317 . It will be able to be used in HSC's by using the -ac_algo=ramhash option . This issue will keep track of any issues we run into in doing this.

  • Add ramhash option to -ac_algo
  • Create new RamHashMiner class
  • Import RamHash code into our codebase at src/Ramhash
  • Add the buiding of RamHash to our build system via it's Makefile
  • Use the RamHashMiner class if -ac_algo=ramhash is used
  • Decide if RamHash constants will depend on -ac_name
  • Decide if RamHash will have an optional CLI arguments
  • Call LXRHash::init() from miner.cpp
  • Call LXRHash::LxrPOW() from miner.cpp
  • Create an HSC that uses RamHash and verify mining works on
    • Linux
    • Mac
    • Windows
We will be adding a new PoW algo RamHash (also known as LXRHash) from https://gitlab.com/accumulatenetwork/ecosystem/LXRMining/-/tree/main/c and documenting the process of adding a new PoW algo in #317 . It will be able to be used in HSC's by using the `-ac_algo=ramhash` option . This issue will keep track of any issues we run into in doing this. * [x] Add `ramhash` option to `-ac_algo` * [x] Create new `RamHashMiner` class * [x] Import RamHash code into our codebase at src/Ramhash * [x] Add the buiding of RamHash to our build system via it's Makefile * [x] Use the `RamHashMiner` class if `-ac_algo=ramhash` is used * [x] Decide if RamHash constants will depend on `-ac_name` * [ ] Decide if RamHash will have an optional CLI arguments * [x] Call LXRHash::init() from miner.cpp * [x] Call LXRHash::LxrPOW() from miner.cpp * [ ] Create an HSC that uses RamHash and verify mining works on * [ ] Linux * [ ] Mac * [ ] Windows
duke self-assigned this 10 months ago
Poster
Owner

RamHash uses a psuedorandom number generator called Xorshift https://en.wikipedia.org/wiki/Xorshift

RamHash uses a psuedorandom number generator called Xorshift https://en.wikipedia.org/wiki/Xorshift
Poster
Owner

This is being worked on in the ramhash branch

This is being worked on in the `ramhash` branch
Poster
Owner

One thing we need to look into is if the ramhash library code we are going to use can support multiple threads. If not, we can just support mining with a single thread at first and figure that out later.

One thing we need to look into is if the ramhash library code we are going to use can support multiple threads. If not, we can just support mining with a single thread at first and figure that out later.
duke added the
feature
label 9 months ago
Poster
Owner

Ramhash C++ implementation is now added on the ramhash branch at src/Ramhash

Ramhash C++ implementation is now added on the `ramhash` branch at `src/Ramhash`
Poster
Owner

ramhash branch now compiles ramhash in build.sh and links it when compiling hushd .
Currently the code coredumps when the RamhashMiner function is called.

(gdb) bt
#0  0x000055fab002d1c0 in RamhashMiner (pwallet=0x55fab218ce70) at miner.cpp:1504
#1  0x000055fab04c702b in thread_proxy ()
#2  0x00007efc9cffa609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#3  0x00007efc9cf1f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

It's not clear yet exactly what is causing this coredump, but some of the code does still need to change. None of the other mining algorithms does anything relating to the disk but Ramhash has a 1GB bytemap file that it needs to work with.

`ramhash` branch now compiles ramhash in build.sh and links it when compiling hushd . Currently the code coredumps when the `RamhashMiner` function is called. ``` (gdb) bt #0 0x000055fab002d1c0 in RamhashMiner (pwallet=0x55fab218ce70) at miner.cpp:1504 #1 0x000055fab04c702b in thread_proxy () #2 0x00007efc9cffa609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #3 0x00007efc9cf1f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ``` It's not clear yet exactly what is causing this coredump, but some of the code does still need to change. None of the other mining algorithms does anything relating to the disk but Ramhash has a 1GB bytemap file that it needs to work with.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.