2nd update of 2022 on BlockTrades work on Hive software

in HiveDevs3 years ago

blocktrades update.png

Below is a list of some of the Hive-related programming issues worked on by the BlockTrades team during the past two weeks.

HAF account history app (aka hafah)

We briefly deployed hafah (the HAF-based account history app) to our production node as a replacement for our hived-based account history node, but we discovered that many apps are still using the legacy “condenser_api” form of the account history calls (which hafah didn’t support). This left us with two options: get apps to move from the legacy condenser_api calls to the account_history_api calls or implement support for the legacy calls inside hafah itself.

After carefully considering both options, it seemed best to add support for the legacy calls inside hafah. This was relatively quick to do, it didn’t require coordination with other dev teams, and HAF may lead to a new programming paradigm that will deprecate the use of both the old and the new account_history_api calls (so no point in forcing Hive apps to upgrade once, then shortly thereafter change again).

We’re still working on an alternate version of hafah that uses postgREST as the api server instead of the python-based one. Benchmarks of hived account history plugin vs python-based hafah led me to believe that the python server was impacting the potential performance of the very fast api calls such as find_transaction (hived was actually performing better than hafah for these very fast calls). The results from the postgresT server seem to confirm this issue we’re seeing about 4x better peformance with postgresT vs the python server on those calls (4.8ms vs 22ms).

So I think it is very likely that we will switch to using postgresT unless we find some compelling reason to stay with the python implementation for hafah. If do make this switch, we'll likely modify the HAF setup scripts to optionally install a postgREST server if this becomes the default recommended server for HAF apps.

Hived (blockchain node software) work

During our testing of Hafah we uncovered a problem with recent changes to hived’s account history plugin, so, after a few bumps along the way, we fixed that issue. We’ve tested the changes with a replay of hived and we’re currently using that replayed hived to re-index a hivemind server as a final test. The test has already progressed to the point that we’re confident in the fix, so the changes have been merged to the develop branch of hived, and we’re using that version of hived now to power our HAF and hafah tests.

We also finished testing and merged code that enables a HF26 feature which allow apps to refer to assets (e.g. hive and hbd) using either legacy-style strings or the new numeric asset identifiers (NAIs). This is to allow apps to gradually update to the new NAI syntax.

We created more unit tests, regression tests, and performance tests for various parts of hived.

Hive Application Framework: framework for building robust and scalable Hive apps

Last week I published an introductory post for HAF to Hive app developers. Those instructions are slightly out-of-date as it is now possible to directly grab and run the setup_haf_instance.sh script without needing to checkout the HAF repo first. The benefit of this new approach is you don’t end up with two copies of the HAF repo on your development system. To directly download the install script from gitlab, type:
wget https://gitlab.syncad.com/hive/haf/-/raw/develop/scripts/setup_haf_instance.sh

We also added new stored procedures in HAF to simplify implementation of Hive
API calls that return “legacy-style” json results (i.e. where results are returned as an array rather than a dictionary). These procedures were used to ease implementation of the condenser_api calls for hafah and they may be useful for supporting other legacy API calls in the future.

Condenser wallet (source code for https://wallet.hive.blog)

We added support for filtering transactions displayed in a user’s wallet. We also added a feature to display the top voters on a DHF proposal (a small bug was found in this latter feature which is being fixed now).

What’s next?

  • Modify one-step script for installing HAF to optionally download a trusted block_log and block_log.index file
  • Create CI scripts to auto-deploy docker-based hived and HAF instances
  • Add support for filtering of operations by sql_serializer to allow for smaller HAF server databases
  • Collect benchmarks for hafah operating in irreversible block mode
  • Test hafah on production servers (api.hive.blog)
  • Finish conversion of hivemind to a HAF-based app
  • Fix locking/task incompatibility issue between blockchain and p2p threads and see if this fixes block time offset increase under heavy transaction loading.
  • Complete work on resource credit rationalization after block time offset issue is resolved.
Sort:  

Do you get many calls from dapp developers to add functionality that would help them? I'm just wonder who drives changes the most. I expect you have a long wish-list.

Cheers

We do get requests for specific functionality every now and then (e.g. the ability to change keys more than once per hour was a request by @engrave IIRC), but such changes are usually easy to make and don't consume much time.

So most of our work is internally-driven and has focused on increasing scalability, increasing use-cases, and making it easier to do Hive-based development.

good to know!

Great work for the boost, you are always awesome👏👏👏👏

Good one coming from blocktrade update

Congratulations @blocktrades! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You distributed more than 115000 upvotes.
Your next target is to reach 120000 upvotes.
You received more than 1550000 HP as payout for your posts, comments and curation.
Your next payout target is 1555000 HP.
The unit is Hive Power equivalent because post and comment rewards can be split into HP and HBD

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

Hive Power Up Month - Feedback from February day 17
Support the HiveBuzz project. Vote for our proposal!

Great job @blocktrades
Thanks for everything you do
Have an awesome weekend
:)

Congratulations @blocktrades! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

Post with the highest payout of the day.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

Hive Power Up Month - Feedback from February day 17
Support the HiveBuzz project. Vote for our proposal!

I am awaiting to see next HF for RC delegations! Thanks for the update!
$WINE

Cheers~


Congratulations, @theguruasia You Successfully Shared 0.200 WINEX With @blocktrades.
You Earned 0.200 WINEX As Curation Reward.
You Utilized 2/3 Successful Calls.

wine_logo


Contact Us : WINEX Token Discord Channel
WINEX Current Market Price : 0.334


Swap Your Hive <=> Swap.Hive With Industry Lowest Fee (0.1%) : Click This Link
Read Latest Updates Or Contact Us

Okay. I think I better understand HAF now. However, still having a hard time understanding how a transaction gets published on to the main net. Like o the DApps push signed transactions to HAF which in turn would record it on the blockchain? What happens when there is some kind of network issue on the server where HAF is hosted? For example, sometime last year, Heltzner had network issues for several hours. So, if a signed transaction makes it onto HAF and is expired before it reaches the blockchain, wouldn't that be an issue? Or did I understand it wrong and HAF is an insane hivemind upgrade that we needed for so long? And all transactions still go to the main net and not HAF?

All transactions go to the mainnet, not HAF. HAF will see them and react to them once the transactions get included into blocks and hived pushes the block data to the HAF nodes.

Cool Thanks. So, HAF is a supercharged and easy-to-use hivemind and also the possible foundation to future smart contract implementations I guess?

HAF is a general-purpose programming framework, whereas hivemind is focused on social media data.

Problems we encountered with hivemind inspired the creation of HAF. Originally, we were planning to break up hivemind into modular components (aka "modular hivemind"), allowing a hivemind operator to select which APIs they wanted to support. But performance limitations of hivemind led us to rethinking the way data is injected and processed in HAF.

So functionally, HAF has two major differences from hivemind: 1) it has a fork manager which enables apps to roll back actions performed when a block is processed, allowing apps to safely process head blocks as soon as they are generated and 2) it gets data from hived via a push model vs a pull model which lowers the CPU loading on hived, increases data throughput, and lowers latency time to process transaction data.

One of our next steps will be to port hivemind to turn it into a HAF app. This will allow hivemind to sync faster and it will also allow it to safely process head blocks and more quickly react to new blockchain transactions.

Cool cool. Just one more clarification. We all know the head block is by far the most unreliable block out there right? With HAF, we DApp developers don't need to wait for say 30-40 secs before deciding if a particular action is part of the block_log? Or would you still suggest that we add a delay of 5-10 blocks if it's a crucial transaction that involves a financial transfer to a DApp account?

You would still want to wait till a block becomes irreversible before performing an action based on it that can't easily be canceled (e.g. a blockchain transfer of funds).

So in such cases, your app might signal that it is planning to make the transfer, but wait for the block to be irreversible before making the transfer.

Thank you for clarifying all my doubts. Looking forward to the release of HAF.

Great work keep it up

Thanks for the updates and great work @blocktrades 👍.

Blocktrade boost, awesome!

Seriously @dtube downvoted the post.

image.png
Better you guys refund our $$$ that collected via ITO you hold before downvoting development updates :P

Congratulations @blocktrades! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

Post with the highest payout of the week.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

Hive Power Up Month - Feedback from February day 17
Support the HiveBuzz project. Vote for our proposal!

Yesterday I transferred hie dollars to doge account. I waited three days. After that until now it has not been logged into my doge account.

If this is about blocktrades.us, please submit a support request from our web site and one of our support people will assist you.

I have contacted him.

@blocktrades Keep up the great work!! !PIZZA

PIZZA!

PIZZA Holders sent $PIZZA tips in this post's comments:
@darkflame(1/10) tipped @blocktrades (x1)

You can now send $PIZZA tips in Discord via tip.cc!

Congratulations @blocktrades! You received a personal badge!

Thank you for participating in the CryptoManiacs podcast hosted by @jongolson and @taskmaster4450

You can view your badges on your board and compare yourself to others in the Ranking

Check out the last post from @hivebuzz:

Feedback from the March 1st Hive Power Up Day
Our Hive Power Delegations to the February PUM Winners
Support the HiveBuzz project. Vote for our proposal!