Skip to content

Commit

Permalink
Merge pull request #2790 from bitshares/develop_to_hardfork
Browse files Browse the repository at this point in the history
Merge develop branch into hardfork branch
  • Loading branch information
abitmore authored Oct 5, 2023
2 parents 10468b2 + 9e087a7 commit 2c10288
Show file tree
Hide file tree
Showing 26 changed files with 73 additions and 64 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-and-test.ubuntu-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
services:
elasticsearch8:
image: elastic/elasticsearch:8.8.1
image: elastic/elasticsearch:8.10.2
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
Expand All @@ -22,7 +22,7 @@ jobs:
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.10
image: elastic/elasticsearch:7.17.13
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
Expand Down Expand Up @@ -66,14 +66,14 @@ jobs:
df -h .
free
mkdir -p _build
sudo mkdir -p /_build/libraries /_build/programs /_build/tests /mnt/_build
sudo chmod a+rwx /_build/libraries /_build/programs /_build/tests
sudo mkdir -p /_build/libraries /_build/programs /mnt/_build/tests
sudo chmod a+rwx /_build/libraries /_build/programs /mnt/_build/tests
ln -s /_build/libraries _build/libraries
ln -s /_build/programs _build/programs
ln -s /_build/tests _build/tests
ln -s /mnt/_build/tests _build/tests
sudo ln -s /_build/libraries /mnt/_build/libraries
sudo ln -s /_build/programs /mnt/_build/programs
sudo ln -s /_build/tests /mnt/_build/tests
sudo ln -s /mnt/_build/tests /_build/tests
ls -al _build
pushd _build
export -n BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.ubuntu-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
services:
elasticsearch8:
image: elastic/elasticsearch:8.8.1
image: elastic/elasticsearch:8.10.2
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
Expand All @@ -22,7 +22,7 @@ jobs:
--env cluster.routing.allocation.disk.threshold_enabled=false
--publish 9200:9200
elasticsearch7:
image: elastic/elasticsearch:7.17.10
image: elastic/elasticsearch:7.17.13
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ env:
# The following are for windows cross-build only:
BOOST_VERSION: 1_69_0
BOOST_DOTTED_VERSION: 1.69.0
CURL_VERSION: 8.1.2
OPENSSL_VERSION: 1.1.1u
ZLIB_VERSION: 1.2.13
CURL_VERSION: 8.3.0
OPENSSL_VERSION: 1.1.1w
ZLIB_VERSION: 1.3
jobs:
prepare-mingw64-libs:
name: Build required 3rd-party libraries
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
services:
elasticsearch8:
image: elastic/elasticsearch:8.8.1
image: elastic/elasticsearch:8.10.2
options: >-
--env ES_JAVA_OPTS="-Xms512m -Xmx512m"
--env discovery.type=single-node
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Jose Marcial Vieira Bisneto <[email protected]>
Jozef Knaperek <[email protected]>
Ken Code <[email protected]>
Krzysztof Szumny <[email protected]>
Massimo Paladin <[email protected]>
Paul Brossier <[email protected]>
Roelandp <[email protected]>
Semen Martynov <[email protected]>
Expand All @@ -80,5 +81,6 @@ bitcube <[email protected]>
hammadsherwani <[email protected]>
lafona <[email protected]>
liondani <[email protected]>
litepresence <[email protected]>
lososeg <[email protected]>
sinetek <[email protected]>
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ PROJECT_NAME = "BitShares-Core"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "6.1.0"
PROJECT_NUMBER = "7.0.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "BitShares blockchain implementation and command-line interface software"
PROJECT_BRIEF = "BitShares blockchain node software and command-line wallet software"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ Use `gethelp <COMMAND>` to see more info about individual commands. E.G.
>>> gethelp get_order_book

The definition of all commands is available in the
[wallet.hpp](https://github.com/bitshares/bitshares-core/blob/master/libraries/wallet/include/graphene/wallet/wallet.hpp) souce code file.
Corresponding documentation can be found in the [Doxygen documentation](https://doxygen.bitshares.org/classgraphene_1_1wallet_1_1wallet__api.html).
[wallet.hpp](https://github.com/bitshares/bitshares-core/blob/master/libraries/wallet/include/graphene/wallet/wallet.hpp) source code file.
Corresponding documentation can be found in the [Doxygen documentation](https://bitshares.github.io/doxygen/classgraphene_1_1wallet_1_1wallet__api.html).

You can run the program with `--help` parameter to see more info:

Expand All @@ -211,7 +211,7 @@ Questions can be posted in [Github Discussions](https://github.com/bitshares/bit

BitShares UI bugs should be reported to the [UI issue tracker](https://github.com/bitshares/bitshares-ui/issues).

Up to date online Doxygen documentation can be found at [Doxygen.BitShares.org](https://doxygen.bitshares.org/hierarchy.html).
Up to date online Doxygen documentation can be found at [https://bitshares.github.io/doxygen](https://bitshares.github.io/doxygen/hierarchy.html).


Using Built-In APIs
Expand Down Expand Up @@ -246,8 +246,8 @@ The definition of all node APIs is available in the source code files including
[database_api.hpp](https://github.com/bitshares/bitshares-core/blob/master/libraries/app/include/graphene/app/database_api.hpp)
and [api.hpp](https://github.com/bitshares/bitshares-core/blob/master/libraries/app/include/graphene/app/api.hpp).
Corresponding documentation can be found in Doxygen:
* [database API](https://doxygen.bitshares.org/classgraphene_1_1app_1_1database__api.html)
* [other APIs](https://doxygen.bitshares.org/namespacegraphene_1_1app.html)
* [database API](https://bitshares.github.io/doxygen/classgraphene_1_1app_1_1database__api.html)
* [other APIs](https://bitshares.github.io/doxygen/namespacegraphene_1_1app.html)


### Wallet API
Expand Down Expand Up @@ -304,7 +304,7 @@ Note: the `login` API set is always accessible.

Passwords are stored in `base64` as salted `sha256` hashes. A simple Python script,
[`saltpass.py`](https://github.com/bitshares/bitshares-core/blob/master/programs/witness_node/saltpass.py)
is avaliable to obtain hash and salt values from a password.
is available to obtain hash and salt values from a password.
A single asterisk `"*"` may be specified as username or password hash to accept any value.

With the above configuration, here is an example of how to call the `add_node` API from the `network_node` API set:
Expand All @@ -320,8 +320,8 @@ The restricted API sets are accessible via HTTP too using *basic access authenti
$ curl --data '{"jsonrpc": "2.0", "method": "call", "params": ["network_node", "add_node", ["127.0.0.1:9090"]], "id": 1}' http://bytemaster:[email protected]:8090/

Our `doxygen` documentation contains the most up-to-date information
about APIs for the [node](https://doxygen.bitshares.org/namespacegraphene_1_1app.html) and the
[wallet](https://doxygen.bitshares.org/classgraphene_1_1wallet_1_1wallet__api.html).
about APIs for the [node](https://bitshares.github.io/doxygen/namespacegraphene_1_1app.html) and the
[wallet](https://bitshares.github.io/doxygen/classgraphene_1_1wallet_1_1wallet__api.html).


FAQ
Expand Down
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 6f6ea4 to 8ba173
4 changes: 2 additions & 2 deletions libraries/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# BitShares Libraries

The libraries are the core of the project and defines everything where applications can build on top.
The libraries are the core of the project and define everything where applications can build on top.

A **graphene** blockchain software will use the `app` library to define what the application will do, what services it will offer. The blockchain is defined by the `chain` library and include all the objects, types, operations, protocols that builds current consensus blockchain. The lowest level in memory database of Bitshares is developed at the `db` library. The `fc` is a helper module broadly used in the libraries code, `egenesis` will help with the genesis file, `plugins` will be loaded optionally to the application. Wallet software like the cli_wallet will benefit from the `wallet` library.
A **graphene** blockchain software will use the `app` library to define what the application will do, what services it will offer. The blockchain is defined by the `chain` library and includes all the objects, types, operations, protocols that build current consensus blockchain. The lowest level in memory database of Bitshares is developed at the `db` library. The `fc` is a helper module broadly used in the libraries code, `egenesis` will help with the genesis file, `plugins` will be loaded optionally to the application. Wallet software like the cli_wallet will benefit from the `wallet` library.

Code in libraries is the most important part of **bitshares-core** project and it is maintained by the Bitshares Core Team and contributors.
# Available Libraries
Expand Down
16 changes: 8 additions & 8 deletions libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ bool application_impl::is_plugin_enabled(const string& name) const
return !(_active_plugins.find(name) == _active_plugins.end());
}

/**
/*
* If delegate has the item, the network has no need to fetch it.
*/
bool application_impl::has_item(const net::item_id& id)
Expand All @@ -649,7 +649,7 @@ bool application_impl::has_item(const net::item_id& id)
FC_CAPTURE_AND_RETHROW( (id) ) // GCOVR_EXCL_LINE
}

/**
/*
* @brief allows the application to validate an item prior to broadcasting to peers.
*
* @param sync_mode true if the message was fetched through the sync process, false during normal operation
Expand Down Expand Up @@ -759,7 +759,7 @@ bool application_impl::is_included_block(const block_id_type& block_id)
return block_id == block_id_in_preferred_chain;
}

/**
/*
* Assuming all data elements are ordered in some way, this method should
* return up to limit ids that occur *after* the last ID in synopsis that
* we recognize.
Expand Down Expand Up @@ -816,7 +816,7 @@ std::vector<item_hash_t> application_impl::get_block_ids(const std::vector<item_
return result;
} FC_CAPTURE_AND_RETHROW( (blockchain_synopsis)(remaining_item_count)(limit) ) } // GCOVR_EXCL_LINE

/**
/*
* Given the hash of the requested data, fetch the body.
*/
message application_impl::get_item(const item_id& id)
Expand All @@ -840,7 +840,7 @@ chain_id_type application_impl::get_chain_id() const
return _chain_db->get_chain_id();
}

/**
/*
* Returns a synopsis of the blockchain used for syncing. This consists of a list of
* block hashes at intervals exponentially increasing towards the genesis block.
* When syncing to a peer, the peer uses this data to determine if we're on the same
Expand Down Expand Up @@ -1018,7 +1018,7 @@ std::vector<item_hash_t> application_impl::get_blockchain_synopsis(const item_ha
return synopsis;
} FC_CAPTURE_AND_RETHROW() } // GCOVR_EXCL_LINE

/**
/*
* Call this after the call to handle_message succeeds.
*
* @param item_type the type of the item we're synchronizing, will be the same as item passed to the sync_from() call
Expand All @@ -1030,7 +1030,7 @@ void application_impl::sync_status(uint32_t item_type, uint32_t item_count)
// any status reports to GUI go here
}

/**
/*
* Call any time the number of connected peers changes.
*/
void application_impl::connection_count_changed(uint32_t c)
Expand All @@ -1043,7 +1043,7 @@ uint32_t application_impl::get_block_number(const item_hash_t& block_id)
return block_header::num_from_id(block_id);
} FC_CAPTURE_AND_RETHROW( (block_id) ) } // GCOVR_EXCL_LINE

/**
/*
* Returns the time a block was produced (if block_id = 0, returns genesis time).
* If we don't know about the block, returns time_point_sec::min()
*/
Expand Down
5 changes: 4 additions & 1 deletion libraries/chain/db_market.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,14 @@ database::match_result_type database::match_limit_settled_debt( const limit_orde
wlog( "Unexpected scene: obj.for_sale > bitasset.individual_settlement_fund" );
obj.for_sale = bitasset.individual_settlement_fund;
obj.sell_price = ~bitasset.get_individual_settlement_price();
} // GCOVR_EXEL_STOP
} // GCOVR_EXCL_STOP
}
else
{
obj.for_sale = bitasset.individual_settlement_fund;
obj.sell_price = ~bitasset.get_individual_settlement_price();
}
// Note: filled_amount is not updated, but it should be fine
});
// Note:
// After the price is updated, it is possible that the order can be matched with another order on the order
Expand Down Expand Up @@ -1325,6 +1326,7 @@ database::match_result_type database::match_settled_debt_limit( const limit_orde
obj.for_sale = bitasset.individual_settlement_fund;
obj.sell_price = ~bitasset.get_individual_settlement_price();
} // GCOVR_EXCL_STOP
// Note: filled_amount is not updated, but it should be fine
});
}

Expand Down Expand Up @@ -1889,6 +1891,7 @@ bool database::fill_limit_order( const limit_order_object& order, const asset& p
}
modify( order, [&pays,&new_take_profit_order_id]( limit_order_object& b ) {
b.for_sale -= pays.amount;
b.filled_amount += pays.amount.value;
b.deferred_fee = 0;
b.deferred_paid_fee.amount = 0;
if( new_take_profit_order_id.valid() ) // A new take profit order is created, link it to this order
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/hardfork.d/CORE_1604.hf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// bitshares-core issue #1604 Operation to modify existing limit order
#ifndef HARDFORK_CORE_1604_TIME
#define HARDFORK_CORE_1604_TIME (fc::time_point_sec(1893456000)) // Jan 1 00:00:00 2030 (Not yet scheduled)
#define HARDFORK_CORE_1604_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_1604_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_1604_TIME)
#endif
3 changes: 1 addition & 2 deletions libraries/chain/hardfork.d/CORE_2535.hf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// bitshares-core issue #2535 Simple Order-Sends-Order (OSO)
#ifndef HARDFORK_CORE_2535_TIME
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
#define HARDFORK_CORE_2535_TIME (fc::time_point_sec( 1893456000 ))
#define HARDFORK_CORE_2535_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_2535_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_2535_TIME)
#endif
3 changes: 1 addition & 2 deletions libraries/chain/hardfork.d/CORE_2587.hf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// bitshares-core issue #2587 settle more than total debt in individual settlement fund when no sufficient price feeds
#ifndef HARDFORK_CORE_2587_TIME
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
#define HARDFORK_CORE_2587_TIME (fc::time_point_sec( 1893456000 ))
#define HARDFORK_CORE_2587_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_2587_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_2587_TIME)
#endif
3 changes: 1 addition & 2 deletions libraries/chain/hardfork.d/CORE_2591.hf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// bitshares-core issue #2591 Tighter peg when collateral price rises and settlement fund or settlement order exists
#ifndef HARDFORK_CORE_2591_TIME
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
#define HARDFORK_CORE_2591_TIME (fc::time_point_sec( 1893456000 ))
#define HARDFORK_CORE_2591_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_2591_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_2591_TIME)
#endif
3 changes: 1 addition & 2 deletions libraries/chain/hardfork.d/CORE_2595.hf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// bitshares-core issue #2595 Credit deal auto-repayment
#ifndef HARDFORK_CORE_2595_TIME
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
#define HARDFORK_CORE_2595_TIME (fc::time_point_sec( 1893456000 ))
#define HARDFORK_CORE_2595_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_2595_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_2595_TIME)
#endif
3 changes: 1 addition & 2 deletions libraries/chain/hardfork.d/CORE_2604.hf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// bitshares-core issue #2604 Allow updating liquidity pool fee rates with certain restrictions
#ifndef HARDFORK_CORE_2604_TIME
// Jan 1 2030, midnight; this is a dummy date until a hardfork date is scheduled
#define HARDFORK_CORE_2604_TIME (fc::time_point_sec( 1893456000 ))
#define HARDFORK_CORE_2604_TIME (fc::time_point_sec( 1700143200 )) // Thursday, November 16, 2023 14:00:00 UTC
#define HARDFORK_CORE_2604_PASSED(head_block_time) (head_block_time >= HARDFORK_CORE_2604_TIME)
#endif
3 changes: 2 additions & 1 deletion libraries/chain/include/graphene/chain/asset_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ namespace graphene { namespace chain {
///@}

/// @return true if the individual settlement pool is not empty and the bitasset's black swan response method
/// (BSRM) is @ref bitasset_options::black_swan_response_type::individual_settlement_to_fund,
/// (BSRM) is @ref
/// graphene::protocol::bitasset_options::black_swan_response_type::individual_settlement_to_fund,
/// false otherwise
bool is_individually_settled_to_fund()const
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/graphene/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#define GRAPHENE_MAX_NESTED_OBJECTS (200)

const std::string GRAPHENE_CURRENT_DB_VERSION = "20230529";
const std::string GRAPHENE_CURRENT_DB_VERSION = "20230906";

#define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4
#define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3
Expand Down
9 changes: 5 additions & 4 deletions libraries/chain/include/graphene/chain/market_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ using namespace graphene::db;
class limit_order_object : public abstract_object<limit_order_object, protocol_ids, limit_order_object_type>
{
public:
time_point_sec expiration;
account_id_type seller;
share_type for_sale; ///< asset id is sell_price.base.asset_id
price sell_price;
time_point_sec expiration; ///< When this limit order will expire
account_id_type seller; ///< Who is selling
share_type for_sale; ///< The amount for sale, asset id is sell_price.base.asset_id
price sell_price; ///< The seller's asking price
fc::uint128_t filled_amount = 0; ///< The amount that has been sold, asset id is sell_price.base.asset_id
share_type deferred_fee; ///< fee converted to CORE
asset deferred_paid_fee; ///< originally paid fee
bool is_settled_debt = false; ///< Whether this order is an individual settlement fund
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/market_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ share_type call_order_object::get_max_debt_to_cover( price match_price,

FC_REFLECT_DERIVED_NO_TYPENAME( graphene::chain::limit_order_object,
(graphene::db::object),
(expiration)(seller)(for_sale)(sell_price)(deferred_fee)(deferred_paid_fee)
(expiration)(seller)(for_sale)(sell_price)(filled_amount)(deferred_fee)(deferred_paid_fee)
(is_settled_debt)(on_fill)(take_profit_order_id)
)

Expand Down
2 changes: 1 addition & 1 deletion libraries/fc
Submodule fc updated 1 files
+12 −4 src/asio.cpp
2 changes: 0 additions & 2 deletions libraries/protocol/include/graphene/protocol/operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ namespace graphene { namespace protocol {
/* 77 */ limit_order_update_operation
>;

/// @} // operations group

/**
* Appends required authorites to the result vector. The authorities appended are not the
* same as those returned by get_required_auth
Expand Down
Loading

0 comments on commit 2c10288

Please sign in to comment.