Closed joticajulian closed 3 years ago
Now I understand it.
The i
is not until 9 but until 2^16, so the miner is calculating all possible hashes and taking them in memory. And during the while loop, it is just picking up 10 of them on each iteration. Clever.
I'm wondering why the miner hashes the seed as
H(seed, i)
wherei
is an integer between 0 and 9, while the smart contract hashes the seed asH(seed, y)
wherey
is part of the work calculation.Miner: https://github.com/koinos/koinos-miner/blob/5795a608933d3588d1b18bbbd69308227fef369d/miner/main.c#L424-L434 👆 this Hash is outside the while loop that rotates the nonce (seems like it doesn't depend on the nonce).
Smart Contract: https://github.com/koinos/koinos-erc20/blob/09199ada7201ff559d40cd24fd050e02230fe3a5/contracts/KnsTokenWork.sol#L42-L55 👆 this Hash is inside the work calculation, and the result depends on the nonce.
am I missing something?