Post
Topic
Board Altcoin Discussion
Re: New Cryptocurrency written using 'Rust', looking for another programmer
by
mczarnek
on 29/09/2015, 12:51:24 UTC
I don't see any reason you can't parallelize transaction processing, which seems to be the majority of the work miners are doing.

I intend to keep basically a running total going for the most frequently used accounts, and as you process a transaction, you check to see if that account had enough money, assets, etc at that moment.  Even if they are out of order, the miner who initially mines them can mine them in either order.

I don't know that I would use it here would have to think through security implications further, but hashing these blocks together to make sure they have the correct hash could be done this way too, you just could keep an accumulator which is basically the 'sum' of all the byte values of transactions so order isn't important, appended to the header info, then at the end you put it through the hashing function.  And when it comes to verifying transactions, similarly it doesn't matter if they are out of order or not, either the block is valid or it isn't.  You can process all transactions in parallel into a buffer that is sorted by changes to individual account ids, then go through and check those all at once, then finally apply them. Each of those steps could be done in parallel.

Granted you would have to verify and manipulate all transactions in the block you are checking before you starting building the new one, but building a new block or verifying a block someone else mined could be done in parallel.

This probably would not be in version one as it is indeed a little trickier, but somewhere does the line, it would be nice to have this easy to add.  You could hope for 3 times speed up of block processing on a 4 core CPU.  Which may someday be significant.