Skip to content

Commit 70d69f9

Browse files
authored
Merge pull request #2123 from bitshares/jmj_releas_hardfork
Merge release branch to hardfork
2 parents ca565a7 + 5de750d commit 70d69f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5725
-380
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: c++
22

3-
cache: ccache
3+
cache:
4+
ccache: true
5+
directories:
6+
- sonar_cache
47

58
git:
69
depth: 1

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ BitShares Core
1616
* [License](#license)
1717

1818
BitShares Core is the BitShares blockchain implementation and command-line interface.
19-
The web wallet is [BitShares UI](https://github.com/bitshares/bitshares-ui).
19+
The web browser based wallet is [BitShares UI](https://github.com/bitshares/bitshares-ui).
2020

2121
Visit [BitShares.org](https://bitshares.org/) to learn about BitShares and join the community at [BitSharesTalk.org](https://bitsharestalk.org/).
2222

@@ -31,7 +31,7 @@ Build instructions and additional documentation are available in the
3131

3232
We recommend building on Ubuntu 16.04 LTS (64-bit)
3333

34-
**Build Dependencies**:
34+
**Build Dependencies:**
3535

3636
sudo apt-get update
3737
sudo apt-get install autoconf cmake make automake libtool git libboost-all-dev libssl-dev g++ libcurl4-openssl-dev
@@ -45,7 +45,7 @@ We recommend building on Ubuntu 16.04 LTS (64-bit)
4545
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
4646
make
4747

48-
**Upgrade Script** (prepend to the Build Script above if you built a prior release):
48+
**Upgrade Script:** (prepend to the Build Script above if you built a prior release):
4949

5050
git remote set-url origin https://github.com/bitshares/bitshares-core.git
5151
git checkout master
@@ -95,6 +95,13 @@ Set your inital password:
9595
>>> set_password <PASSWORD>
9696
>>> unlock <PASSWORD>
9797

98+
**IMPORTANT:** The cli_wallet or API interfaces to the witness node wouldn't be fully functional unless the witness node is fully synchronized with the blockchain. The cli_wallet command `info` will show result `head_block_age` which will tell you how far you are from the live current block of the blockchain.
99+
100+
101+
To check your current block:
102+
103+
>>> info
104+
98105
To import your initial balance:
99106

100107
>>> import_balance <ACCOUNT NAME> [<WIF_KEY>] true

docker/default_config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ enable-stale-production = false
164164
partial-operations = true
165165

166166
# Maximum number of operations per account will be kept in memory
167-
max-ops-per-account = 1000
167+
max-ops-per-account = 100
168168

169169

170170
# ==============================================================================

libraries/app/api.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ namespace graphene { namespace app {
302302
return *_debug_api;
303303
}
304304

305-
fc::api<custom_operations_api> login_api::custom() const
305+
fc::api<custom_operations_api> login_api::custom_operations() const
306306
{
307307
FC_ASSERT(_custom_operations_api);
308308
return *_custom_operations_api;
@@ -676,7 +676,7 @@ namespace graphene { namespace app {
676676
max_price = std::max( std::min( max_price, *start ), min_price );
677677

678678
auto itr = limit_groups.lower_bound( limit_order_group_key( group, max_price ) );
679-
// use an end itrator to try to avoid expensive price comparison
679+
// use an end iterator to try to avoid expensive price comparison
680680
auto end = limit_groups.upper_bound( limit_order_group_key( group, min_price ) );
681681
while( itr != end && result.size() < limit )
682682
{
@@ -696,12 +696,10 @@ namespace graphene { namespace app {
696696
const auto account_id = database_api.get_account_id_from_string(account_id_or_name);
697697
vector<account_storage_object> results;
698698
const auto& storage_index = _app.chain_database()->get_index_type<account_storage_index>();
699-
const auto& by_account_catalog_idx = storage_index.indices().get<by_account_catalog>();
700-
auto itr = by_account_catalog_idx.lower_bound(make_tuple(account_id, catalog));
701-
while(itr != by_account_catalog_idx.end() && itr->account == account_id && itr->catalog == catalog) {
702-
results.push_back(*itr);
703-
++itr;
704-
}
699+
const auto& by_account_catalog_idx = storage_index.indices().get<by_account_catalog_key>();
700+
auto range = by_account_catalog_idx.equal_range(make_tuple(account_id, catalog));
701+
for( const account_storage_object& aso : boost::make_iterator_range( range.first, range.second ) )
702+
results.push_back(aso);
705703
return results;
706704
}
707705

libraries/app/include/graphene/app/api.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,12 @@ namespace graphene { namespace app {
534534
/**
535535
* @brief Get all stored objects of an account in a particular catalog
536536
*
537-
* @param account Account name to get info from
537+
* @param account The account ID or name to get info from
538538
* @param catalog Category classification. Each account can store multiple catalogs.
539539
*
540540
* @return The vector of objects of the account or empty
541541
*/
542-
vector<account_storage_object> get_storage_info(std::string account, std::string catalog)const;
542+
vector<account_storage_object> get_storage_info(std::string account_id_or_name, std::string catalog)const;
543543

544544
private:
545545
application& _app;
@@ -598,7 +598,7 @@ namespace graphene { namespace app {
598598
/// @brief Retrieve the debug API (if available)
599599
fc::api<graphene::debug_witness::debug_api> debug()const;
600600
/// @brief Retrieve the custom operations API
601-
fc::api<custom_operations_api> custom()const;
601+
fc::api<custom_operations_api> custom_operations()const;
602602

603603
/// @brief Called to enable an API, not reflected.
604604
void enable_api( const string& api_name );
@@ -695,5 +695,5 @@ FC_API(graphene::app::login_api,
695695
(asset)
696696
(orders)
697697
(debug)
698-
(custom)
698+
(custom_operations)
699699
)

libraries/chain/asset_evaluator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ void_result asset_create_evaluator::do_evaluate( const asset_create_operation& o
6363
{
6464
auto prefix = op.symbol.substr( 0, dotpos );
6565
auto asset_symbol_itr = asset_indx.find( prefix );
66-
FC_ASSERT( asset_symbol_itr != asset_indx.end(), "Asset ${s} may only be created by issuer of ${p}, but ${p} has not been registered",
66+
FC_ASSERT( asset_symbol_itr != asset_indx.end(),
67+
"Asset ${s} may only be created by issuer of asset ${p}, but asset ${p} has not been created",
6768
("s",op.symbol)("p",prefix) );
6869
FC_ASSERT( asset_symbol_itr->issuer == op.issuer, "Asset ${s} may only be created by issuer of ${p}, ${i}",
6970
("s",op.symbol)("p",prefix)("i", op.issuer(d).name) );

libraries/chain/db_debug.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <graphene/chain/account_object.hpp>
2828
#include <graphene/chain/asset_object.hpp>
29+
#include <graphene/chain/htlc_object.hpp>
2930
#include <graphene/chain/market_object.hpp>
3031
#include <graphene/chain/vesting_balance_object.hpp>
3132
#include <graphene/chain/witness_object.hpp>
@@ -46,6 +47,7 @@ void database::debug_dump()
4647
const auto& statistics_index = db.get_index_type<account_stats_index>().indices();
4748
const auto& bids = db.get_index_type<collateral_bid_index>().indices();
4849
const auto& settle_index = db.get_index_type<force_settlement_index>().indices();
50+
const auto& htlcs = db.get_index_type<htlc_index>().indices();
4951
map<asset_id_type,share_type> total_balances;
5052
map<asset_id_type,share_type> total_debts;
5153
share_type core_in_orders;
@@ -92,6 +94,8 @@ void database::debug_dump()
9294
total_balances[asset_id_type()] += asset_obj.dynamic_asset_data_id(db).fee_pool;
9395
// edump((total_balances[asset_obj.id])(asset_obj.dynamic_asset_data_id(db).current_supply ) );
9496
}
97+
for( const auto& htlc : htlcs )
98+
total_balances[htlc.transfer.asset_id] += htlc.transfer.amount;
9599

96100
if( total_balances[asset_id_type()].value != core_asset_data.current_supply.value )
97101
{

libraries/net/node.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -854,17 +854,16 @@ namespace graphene { namespace net { namespace detail {
854854
// timeout for any active peers is two block intervals
855855
uint32_t active_disconnect_timeout = 10 * _recent_block_interval_in_seconds;
856856
uint32_t active_send_keepalive_timeout = active_disconnect_timeout / 2;
857-
858-
// set the ignored request time out to 1 second. When we request a block
857+
858+
// set the ignored request time out to 6 second. When we request a block
859859
// or transaction from a peer, this timeout determines how long we wait for them
860860
// to reply before we give up and ask another peer for the item.
861861
// Ideally this should be significantly shorter than the block interval, because
862-
// we'd like to realize the block isn't coming and fetch it from a different
863-
// peer before the next block comes in. At the current target of 3 second blocks,
864-
// 1 second seems reasonable. When we get closer to our eventual target of 1 second
865-
// blocks, this will need to be re-evaluated (i.e., can we set the timeout to 500ms
866-
// and still handle normal network & processing delays without excessive disconnects)
867-
fc::microseconds active_ignored_request_timeout = fc::seconds(1);
862+
// we'd like to realize the block isn't coming and fetch it from a different
863+
// peer before the next block comes in.
864+
// Increased to 6 from 1 in #1660 due to heavy load. May need to adjust further
865+
// Note: #1660 is https://github.com/steemit/steem/issues/1660
866+
fc::microseconds active_ignored_request_timeout = fc::seconds(6);
868867

869868
fc::time_point active_disconnect_threshold = fc::time_point::now() - fc::seconds(active_disconnect_timeout);
870869
fc::time_point active_send_keepalive_threshold = fc::time_point::now() - fc::seconds(active_send_keepalive_timeout);

libraries/net/peer_database.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ namespace graphene { namespace net {
5050
indexed_by<ordered_non_unique<tag<last_seen_time_index>,
5151
member<potential_peer_record,
5252
fc::time_point_sec,
53-
&potential_peer_record::last_seen_time> >,
53+
&potential_peer_record::last_seen_time>,
54+
std::greater<fc::time_point_sec> >,
5455
hashed_unique<tag<endpoint_index>,
5556
member<potential_peer_record,
5657
fc::ip::endpoint,

0 commit comments

Comments
 (0)