Join GitHub today
Headfirst mining #138
Implement head-first mining: have getblocktemplate build an empty block on the most-work block header while the full block is being fetched/validated.
It will do this for at most 30 seconds, to prevent a 'create a valid proof-of-work block then withhold its data to stop the network processing transactions' attack. If it takes longer than 30 seconds to download/validate the block data, then the previous fully-validated block is mined.
Adds a new command-line option: -blockheadernotify Just like -blocknotify, only notify as soon as a new best-work header is received and validated.
This should be easier to review commit-by-commit.
Tested by running the existing sendheaders.py and getblocktemplate_longpoll.py regression tests, and also running with
... where /tmp/notify.sh is this simple little script:
After running on the main network for a while, /tmp/NOTIFY_MSGS should show getblocktemplate giving an empty-transaction template after a header, then a few seconds later a normal template when the new block is fully validated.
Are you combining this with the thin blocks approach?
In which case, you could set a more simple determinant limit that is not dependent on CPU, for example:
"if >= x% of the transactions within the block are not already in my mempool, then fetching would take too long and I should just start building on the previously validated block"
The best way to follow the work of the classic team is in slack, as you have noticed.
Github makes for a really bad experience as a social platform, it is meant only for code reviews and this merge request was closed because it wasn't good enough yet. A new one will come when its better.
Please use social platforms like reddit, various forums or slack to discuss non-coding subjects.
"Github makes for a really bad experience as a social platform"
Bitcoin Classic operates completely in the open, this means that code gets developed in the open and features that are very rough and unfinished get seen by lots of people long long before they are made ready for release.
Please respect the process to show the beautiful end results only after the hard work that goes into it, which indeed includes mistakes, bugs and naturally corrections.
This process has over many years shown to be superior and we will continue to do this.