3rd update of 2021 on our Hive software work
Preface: This post describes the work done in the past week or so by the BlockTrades team on hive-related software. Since it's essentially a progress report for other devs, it presupposes that the reader is familiar with the ongoing work. In other words, it assumes you've read [our sixth month roadmap](https://hive.blog/hive-139531/@blocktrades/roadmap-for-hive-related-work-by-blocktrades-in-the-next-6-months) and [the previous progress reports](https://hive.blog/@blocktrades/posts). Reading these posts has also been likened to watching paint dry, so be warned :-)
# Overview of the week's work
A lot of the coding work done this week was cleanup work, as we want to make it easier for new devs to contribute to the code base.
To that end, we’ve once again ramped up our work on creating tests, removing dead code that might confuse new programmers, and investigating methods of documenting the code and the APIs.
For the latter issue, we’ve decided to use OpenAPI as our preferred means for documenting API methods so that documentation web pages can directly be generated from annotations in the source code itself. By establishing a direct linkage between the API call and the code that implements it, it will be easier to know when a particular API call hasn’t yet been documented. I think this also implies that we will need to create a task to migrate a lot of the existing external documentation into the hivemind codebase.
In addition to the above, we also continued our work on creating the modular hivemind framework for 2nd layer apps.
# Hived work (blockchain node software)
During testing, we found that the initial version of the code for directly filling hivemind’s postgres database from hived had several problems (a problem with thread cleanup and some performance issues with queries that insert data into the database), but these were resolved, and the performance tests are looking good so far, but we haven’t done a full test yet on the latest code.
We’ve also found some additional information that we need to inject into the database (some of the data that hivemind currently pulls from hived using get_dynamic_properties api call). We should be ready to perform another sync test for this code in the next day or so. This work is going on here:
https://gitlab.syncad.com/hive/hive/-/commits/km_live_postgres_dump/
The code for tracking the last governance vote for an account was completed here:
https://gitlab.syncad.com/hive/hive/-/merge_requests/160
This code will be used to compute when governance votes will expire as part of hardfork 25.
Tests were written to test changes in cli_wallet:
https://gitlab.syncad.com/hive/hive/-/merge_requests/163
code cleanup (removing unused/dead code):
https://gitlab.syncad.com/hive/hive/-/merge_requests/77
We also completed our performance tests of the BlockTrades-contributed source code changes to hived that generate additional virtual operations for accounting computations (we wrote this code a long time ago to help us compute our blockchain-related income). As I anticipated, there were no significant impacts on either computation performance or account history storage requirements, so we’ll be merging in these changes in the coming week. I think these results also validate to some extent my plan to continue to use virtual operations as the primary way to pass internal state information from hived to hivemind.
# Hivemind (2nd layer microservice for social media apps)
Below is a list of some of the changes we made to hivemind this week:
Optimized a few more API calls by reducing amount of work required of the SQL query planner:
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/459
Added threads to speed up post-"initial sync" operations needed by hivemind indexer (e.g. creating table indexes):
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/446
Community functionality moved from python to SQL to enhance performance and ease future maintenance:
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/451
Several reported issues with notifications were fixed in this MR:
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/461
tests
https://gitlab.syncad.com/hive/tests_api/-/merge_requests/225
https://gitlab.syncad.com/hive/tests_api/-/merge_requests/228
https://gitlab.syncad.com/hive/tests_api/-/merge_requests/221 (tests for community apis)
https://gitlab.syncad.com/hive/tests_api/-/merge_requests/224 (full sync tests for community apis)
https://gitlab.syncad.com/hive/tests_api/-/merge_requests/227
code cleanup (removing unused/dead code + code reformatting):
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/436
https://gitlab.syncad.com/hive/hivemind/-/merge_requests/465
# Condenser and wallet (https://hive.blog)
Improvements to build process for condenser and wallet:
https://gitlab.syncad.com/hive/condenser/-/merge_requests/189
https://gitlab.syncad.com/hive/wallet/-/merge_requests/92
Fix bugs reported when showing profiles of some older accounts by using post_json_metadata:
https://gitlab.syncad.com/hive/wallet/-/merge_requests/93
Fix a problem with display of hivefest badge:
https://gitlab.syncad.com/hive/condenser/-/merge_requests/191
# Near-term work plans and work in progress
On the hived side, we continue to work on the governance changes discussed in our six-month roadmap post.
We’ll also be reviewing the state of the SMT code in the coming week, to get a feeling for how complete it is in terms of functionality, etc.
On the hivemind side, we’ll continue work on tests and documentation.
We’ll also be continuing our work on modular hivemind, with the current focus on the hived plugin for this and on experiments for modifying hivemind’s indexer code to work from the new tables created by the hived plugin.
See: 3rd update of 2021 on our Hive software work by @blocktrades