Felix Lange
d3396ec513
ethash.go, libethash: pass hashes and return values on the stack
Passing Go pointers into C is not safe. See https://golang.org/issue/8310
for more background. This commit removes uses like the ones below and
passes hashes and return values on the stack instead.
var h common.Hash
C.function(&h[0], ...)
var ret C.struct_ethash_return_value
C.function(&ret)
This requires changes in the internal C API.
10 years ago
Lefteris Karapetsas
e9c11a143e
Switching node indices to uint32_t to get the old behaviour back
10 years ago
Lefteris Karapetsas
df2687e517
Addressing MSVC compile error and warnings
10 years ago
Lefteris Karapetsas
0d14f005a5
Fix DAG size in GObridge and callback location in C
10 years ago
Lefteris Karapetsas
f786d231fc
Use internal API in GO bridge
- Also proper place of const in some C function signatures
10 years ago
Lefteris Karapetsas
d82b609449
API changes requested by Gavin.
- Following this spec:
https://github.com/ethereum/wiki/wiki/Ethash-C-API
- This breaks all but the cpp tests. OpenCL miner and go ethereum will
be fixed in subsequent commits.
10 years ago
Lefteris Karapetsas
2f77c792a8
ethash_full should not keep cache_size
- plus block number is a uint64_t not uint32_t
10 years ago
Lefteris Karapetsas
95f0419ec8
Some minor changes to the C API towards finalization
10 years ago
Lefteris Karapetsas
df1d8c024f
Adding ETHASH namespace to some defines
10 years ago
Lefteris Karapetsas
492537b7c4
Miscellaneous style fixes
10 years ago
Lefteris Karapetsas
0c4e19be7d
Adding memory mapped I/O to ethash_full_new
10 years ago
Lefteris Karapetsas
fbf7fc5b66
Memoization is done with the DAG filename
10 years ago
Lefteris Karapetsas
7fd1dd36f5
Coding style "adjustment"
- Adjusting the coding style for consistency after the talk we had
10 years ago
Lefteris Karapetsas
a66a3c7a27
Remove seed parameter from ethash_full_new()
10 years ago
Lefteris Karapetsas
85bf80272f
Implementing the API functions and adding docstrings
10 years ago
Lefteris Karapetsas
afc1b382d7
Start of new C API implementation
- For more details look at:
https://github.com/ethereum/wiki/wiki/Ethash-C-API
- The functions of the API have all been implemented but are not yet
used or tested
10 years ago
Lefteris Karapetsas
3038852084
Renaming ethash_blockhash_t to ethash_h256_t
10 years ago
Lefteris Karapetsas
6d244fe69a
Use ethash_blockhash_t over the codebase
- Using a typedef struct instead of passing an array of hard coded
length of 32 bytes everywhere. It's much better C practise and also
gives us typechecking.
- Also corrected style in places I touched. I think a style PR should
follow after that.
10 years ago
Tim Hughes
d7452447f6
Fixes for OpenCL 1.1
10 years ago
Matthew Wampler-Doty
7e4d86dbb8
Refactoring everything into src/ for a little sanity
10 years ago