-
Notifications
You must be signed in to change notification settings - Fork 334
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
Change PoW to Equihash #15
Conversation
Tested: make (macOS 10.12.5, Xcode 8.3.3)
Tested: make
Protocol version: 70016 (BTG_HARD_FORK_VERSION) Version bits: 0x60000000
- Add two new fields: nHeight, nSolution (for Equihash) - Calculate block hash in new block format after the hard fork. - Serialize block in legacy format when talking to Bitcoin node. Tested: unittest
Compact block is broken by new block format. Seems we have to fix it. |
Tested: ./autogen.sh && make
- Initialize sodium on startup - Add Equihash validation logic - Fix missing htole32 problem in mingw build.
Watching this one closely, interested to add this coin to the pool on launch.. |
(Zcash developer here.) Zcash will also need to add compact blocks. We haven't thought about it much yet but our ticket for that is https://github.com/zcash/zcash/issues/2316 . Let's cooperate on a spec. |
- Serialize in different formats based on the net protocol version. - Remove the version bit 0x40000000. - Support legacy block format for RPCs: getblock, getblockheader, getblocktemplate, submitblock. - Temporarily disable SEND_CMPT. Tested: unit tests
Intended broken testes: - p2p-compactblocks.py - rest.py Tested: reg tests.
src/net.h
Outdated
@@ -833,6 +830,8 @@ class CNode | |||
std::string GetAddrName() const; | |||
//! Sets the addrName only if it was not previously set | |||
void MaybeSetAddrName(const std::string& addrNameIn); | |||
|
|||
bool IsLeacyBlockHeader(int version) { return version < BTG_HARD_FORK_VERSION; }; |
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.
Typo in function name.
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.
Fixed. Thanks
- Add fields to block header for Zcash compatibility - Extend the nonce from `uint32_t` to `uint256` - Add 'nonceUint32' for backward compatibility: - RPC: 'getblockheader', 'getblock' - Rest: '/rest/headers', '/rest/block' Tested: ./src/test/test_bitcoin ./test/functional/test_runner.py (all passed except intended failures: p2p-compactblocks.py, rest.py)
Boa tarde, qual a previsão de Exchange terá o BTG? (BITCOINGOLD)? |
Also add a test to ensure Zcash compability. Tested: ./src/test/test_bitcoin --run_test=btg_tests
Tested: ./src/test/test_bitcoin --run_test=sanity_tests
Tested: ./src/test/test_bitcoin --run_test=equihash_tests
- RPC - generate - generatetoaddress - getblocktemplate - Add regtest `btg-hardfork.py` Tested: ./src/test/test_bitcoin ./test/functional/test_runner.py
It's time to do mining tests. No way to do it in a regular regression test as there's no existing Equihash solver in Python. |
https://github.com/str4d/zcash-pow Isn't this an Equihash python solver? |
@h4x3rotab Is the daemon ready for pool integration now? |
This change should be further tested but for now let's merge it to the staging tree. I will create another issue to track the process of PoW changes & tests. Will submit after it passes TravisCI check. |
64052c76c5 Merge BTCGPU#15: Add filename to corruption errors 135ed0fb4e Add filename to corruption errors git-subtree-dir: src/leveldb git-subtree-split: 64052c76c567cff3dad32d1db0ef969d97b5882f
This ongoing PR changes the PoW to Equihash. The implementation of Equihash is taken from Zcash project.
It will include the following modifications: