As you all know, there have been some delayed SuperBlock issues which could be due to the network having to rely on Windows nodes for producing SuperBlocks. It goes without saying that we need Linux nodes to contribute in creating them and so I have been working on porting the Neural Network to C# and .NET Core so that it can run on Linux.
In this post, I would like to highlight some of the future improvements and the current progress made so far.
Removed High Magnitudes for Bad SuperBlocks
In the current implementation when the VB.NET Code fails to download stats for a project, it will not be included in the SuperBlock.
There is a bug which causes everyone's magnitudes that are contributing in the other projects to go up. This is because the calculation uses the total amount of projects that downloaded stats to divide by rather than the total whitelisted projects in the beacon data. This will be fixed in the new version so that if there is a bad SB other users will not be rewarded unfairly.
We still need to come up with a way to prevent users losing their mag for projects that are periodically missing.
No Team Requirement
We have already programmed removing the team requirement into the port so if the vote passes it will be a quick change. As you can see from the image below there are two columns in the Researcher's table with before and after magnitudes when removing the team requirement.
The current implementation stores everything using lots of different flat files inside the NeuralNetwork directory. This is a problem because it makes the development more complex and can lead to file locking issues. The new version solves this by storing everything in a SQLite database.
On top of this, it is also faster and easier to extend because the code is easier to read and third-party tools can be used to query the database.
startail ran some tests and found that some BOINC project servers update their stats more frequently than previously thought. It turns out some are updating up to every hour or so and in order for consensus to be formed we need to update local stats more often.
To solve this problem without putting too much load on the BOINC server we are reading the HTTP headers for the Last-Modified date and only downloading the stats file if it has been updated. This means we can update stats on each quorum interval.
Last but not least it works on Linux, OSX, BSD and any other UNIX compatible platform where .NET Core runs.
The data gathering and processing is written in C# using the open-source cross-platform .NET Core runtime. I know there have been some people concerned about using .NET and would like to see the full implementation in C++ but it has taken a long time to port to C# and it would take much, much longer to do it all in C++.
The reason, is because this kind of work is much better suited to a higher level language. The UI will still be written in C++ and it will still be fast. Only the data processing and querying the local database will be done in C#.
Most of the VB.NET code has been ported to .NET Core and Ravon has built a bridge in C++ so that the existing wallet can integrate with the new implementation on Linux.
With the bridge he has built we now have a few Linux nodes trying to stake a SuperBlock on Linux. Ravon, TheCharlatan and myself are currently testing the Neural Network port on Linux in the hopes for staking the first Linux SuperBlock. Once we know it works and the port is stable we can start developing the new UI in Qt and C++
Note: we can release the Linux port without a UI in the beginning and then once the UI is built we can start phasing out the old NN code.
It shouldn’t be long now :-)