All checks were successful
continuous-integration/drone/push Build is passing
|
||
---|---|---|
internal | ||
.drone.yml | ||
cache.go | ||
cache_test.go | ||
commitment.go | ||
commitment_test.go | ||
config.go | ||
dataset.go | ||
exec.go | ||
flags.go | ||
go.mod | ||
go.sum | ||
jit_amd64.go | ||
jit_generic.go | ||
LICENSE | ||
math.go | ||
math_test.go | ||
randomx.go | ||
randomx_test.go | ||
README.md | ||
register.go | ||
superscalar.go | ||
superscalar_instruction.go | ||
superscalar_jit_amd64.go | ||
superscalar_jit_amd64.s | ||
superscalar_noasm.go | ||
vm.go | ||
vm_bytecode.go | ||
vm_bytecode_jit_amd64.go | ||
vm_bytecode_jit_amd64.s | ||
vm_bytecode_jit_generic.go | ||
vm_bytecode_native.go | ||
vm_bytecode_purego.go | ||
vm_instruction.go | ||
vm_instruction_native.go | ||
vm_instruction_purego.go |
RandomX (Golang Implementation)
RandomX is a proof-of-work (PoW) algorithm that is optimized for general-purpose CPUs. RandomX uses random code execution (hence the name) together with several memory-hard techniques to minimize the efficiency advantage of specialized hardware.
Fork from git.dero.io/DERO_Foundation/RandomX. Also related, their Analysis of RandomX writeup.
Original code failed RandomX testcases and was implemented using big.Float.
This package implements RandomX without CGO, using only Golang code, native float64 ops, some assembly, but with optional soft float purego implementation.
All test cases pass properly.
Supports Full mode and Light mode.
For the C++ implementation and design of RandomX, see github.com/tevador/RandomX
Feature | 386 | amd64 | arm | arm64 | mips | mips64 | riscv64 | wasm |
---|---|---|---|---|---|---|---|---|
purego | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Full Mode | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ |
Float Operations | hw | hw | hw | hw | soft | soft | soft | soft |
AES Operations | soft | hw | soft | soft | soft | soft | soft | soft |
Superscalar Execution | interpreter | compiler | interpreter | interpreter | interpreter | interpreter | interpreter | interpreter |
VM Execution | interpreter | compiler | interpreter | interpreter | soft | soft | soft | soft |
A pure Golang implementation can be used on platforms without hard float support or via the purego
build tag manually.
TinyGo is supported under the purego
build tag.
Any platform with no hard float support or when enabled manually will use soft float, using softfloat64. This will be very slow.
Full mode is NOT recommended in 32-bit systems and is unsupported, although depending on system it might be able to run. You might want to manually run runtime.GC()
if cleaning up dataset to free memory.
Native hard float can be added with supporting rounding mode under asm.
JIT only supported under Unix systems (Linux, *BSD, macOS), and can be hard-disabled via the disable_jit
build flag, or at runtime.