-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Boost 1.65 #36
Conversation
Perhaps add a version check somewhere if not done already, so if someone doesn't have boost 1.65 with By the way, bitshares/bitshares-core#597 is related. I don't know whether this PR will introduce other issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see all the old code go!
Seems to work with latest develop. (Edit: only tested with old boost at that time.)
include/fc/crypto/sha256.hpp
Outdated
@@ -3,6 +3,7 @@ | |||
#include <fc/string.hpp> | |||
#include <fc/platform_independence.hpp> | |||
#include <fc/io/raw_fwd.hpp> | |||
#include <boost/functional/hash.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICS boost::hash<fc::sha256> isn't used anywhere, so you should be able to remove the include and the template specialization below.
I'm not particularly happy with it (and std::hash<...>) because the return value is architecture-dependent. I don't think this is used in a consensus-related context though, so not that bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps off-topic here, perhaps std::hash
is used in hashed_unique
indexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first, I actually commented out the sha256 specialization that needed this header, and it compiled and ran fine. With the other changes being fairly easy, this was the change that I questioned most. So instead of commenting it out, I put it back in and added the header. I will do more research to see if I can find anywhere that it is being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps off-topic here, perhaps std::hash is used in hashed_unique indexes?
Yes, std::hash is but boost::hash isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed boost::hashfc::sha256 from the file. Everything compiles and runs fine without it. Please take a look at the latest commit.
I have built bitshares-core with this version of fc plus the stacktrace PR in the following combinations:
In the build with boost-1.66, chain_test produces 6 failures that are not present in the other builds. There is something broken there. The fc testsuite itself is fine with both boost-1.66 and boost-1.60. |
Strange. witness_node built with 1.66 was able to replay and connect to the live network, cli_wallet also seems to work. |
Yes, I can reproduce the 6 errors in chain_test. It looks like an exception throws another exception, leading to a terminate. I am researching. |
I'm picking on the failure of operation_tests/call_order_update_test. As part of the database undo due to line 144 ("attempting to claim all collateral without paying off debt"), the first task of the undo is to get the object id 1.8.1 (which I believe is the call order) from the database. The Boost 1.63 version does that just fine. The boost 1.66 version does not. It can retrieve the index, but asking the index for the object throws the fc::exception (see undo_database.h line 68). Update1: Commenting out line 144 allows the rest of the test to finish, including another Update2: Commenting out line 144 allows ALL the other tests to finish without a problem. So that line is affecting other tests. |
I have narrowed it down to some commits in the multi_index library of boost. Between Boost 1.65 and Boost 1.66, there were some changes that appear innocuous, but are causing problems. It is curious that much of our code is working fine, but adding a call_order_object to the index is not. I am now trying to determine if it is a boost bug, or simply the manner in which we are using it. The problem still exists with the 1.67 tag of boost::multi_index, so if it is their bug, they haven't seen it yet. Update1: I think I found the issue: https://www.boost.org/doc/libs/1_67_0/libs/multi_index/doc/release_notes.html#boost_1_66 We throw due to the call order not being legitimate, and boost rolls back the change. Then we attempt to "undo" the database, which we think contains the call_order_object (among others). But that object was never added, and our lookup fails. I am now looking for solutions. Possibilities are:
|
Boost 1.66 introduces a breaking change (see boost link above) that rolls back index modifications on exceptions. This duplicates our undo process, and causes problems. A separate issue was created at bitshares/bitshares-core#852 for tracking. |
Tested with 1.65.1, no more errors |
Someone please help check whether this PR will compile on Ubuntu 16.04 LTS with shipped boost 1.58 libs? Thanks. //Update: |
Testing with bitshares-core (develop branch), Ubuntu 16.04 LTS and Boost 1.58... bitshares-fc tests: bitshares-core tests: I will investigate to compare these results with Boost 1.65. |
I have to admit I ignored these. app_test and chain_bench are unmaintained, blinding_tests tests an unused feature. AFAIK all of these have been broken for quite some time. |
Update: The versions of Boost on my system were bleeding into each other, so I'm invalidating all previous tests. I have now isolated the boost versions, and am starting again with Boost 1.57.
All other tests passed. |
@jmjatlanta I'd recommend not only update old comments in issues/PRs, since no new email notification would be sent out when updating a comment, participants would miss important updates. If it's better to update a comment for better context, and if the update is important, please add a new comment so others will know there is a update. |
For this PR, I think it's OK to merge it. |
This PR will allow bitshares-fc to be compiled with Boost
1.661.65.