Progress reportThis week the blockchain.info incident took almost 2 full days off my work schedule
And it was scary:
a single missed assignment operator and in just three hours hundreds of thousands of dollars were stolen!So instead of cutting more corners I've decided to start a major refactoring. Cleaned up a lot of junk and temporary scaffolding...
One thing that should have been done a long time ago is separation of client internals from the interface.
Now there will be just one library - simcoin.dll, which can act as both a client and a server, depending solely on the tasks loaded at startup.
So to implement a Simcoin client you just link to this library and call sim_start("client") and that's it, you can now use API calls to interact with it.
This separation will require a bit more work, but it's the right thing to do:
- all the critical functionality should be unified and combined inside one library for the core developers to focus on;
- it will be much easier to create clients;
- it will also be easier to port this library because there is no GUI, and then people can write native clients for each platform. I believe, this is the right way to do it, instead of using some monstrosity, like QT.
--
I also wrote a very simple (literally, under 100 lines of code), yet very fast key-value storage system, with a nice side effect of extremely fast insertion sort, and "sort on insert" is a common scenario in Simcoin internals.
For sequential keys the overhead is just 4 bytes and for random keys – about 21 bytes.
The average insertion time for 1 M items is only 480 ticks (!) and the average lookup time is 420 ticks. And you get a sorted set for free!
So I'm happy