From fa73a23ca07e43b5dc6b6613ebf24b995e9c939d Mon Sep 17 00:00:00 2001 From: abitmore Date: Tue, 5 Sep 2023 19:58:24 +0000 Subject: [PATCH 1/5] Bump FC to improve node networking stability --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index 2405393e4..33cd59ca4 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 2405393e40219b8ff3a87ccbcc3de14e32886dda +Subproject commit 33cd59ca4950542ee048b0be9f9f52ce26a863b3 From 7c2842626165082efd21ddc85cdf194b21155774 Mon Sep 17 00:00:00 2001 From: abitmore Date: Tue, 5 Sep 2023 20:12:06 +0000 Subject: [PATCH 2/5] Update dependency versions used in Github Actions - ElasticSearch 7: 7.17.10 -> 7.17.12 - ElasticSearch 8: 8.8.1 -> 8.9.1 - OpenSSL: 1.1.1u -> 1.1.1v - CURL: 8.1.2 -> 8.2.1 - zlib: 1.2.13 -> 1.3 --- .github/workflows/build-and-test.ubuntu-debug.yml | 4 ++-- .github/workflows/build-and-test.ubuntu-release.yml | 4 ++-- .github/workflows/build-and-test.win.yml | 6 +++--- .github/workflows/sonar-scan.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-and-test.ubuntu-debug.yml b/.github/workflows/build-and-test.ubuntu-debug.yml index 5e44e8ee8..da26a8f6c 100644 --- a/.github/workflows/build-and-test.ubuntu-debug.yml +++ b/.github/workflows/build-and-test.ubuntu-debug.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} services: elasticsearch8: - image: elastic/elasticsearch:8.8.1 + image: elastic/elasticsearch:8.9.1 options: >- --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --env discovery.type=single-node @@ -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.12 options: >- --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --env discovery.type=single-node diff --git a/.github/workflows/build-and-test.ubuntu-release.yml b/.github/workflows/build-and-test.ubuntu-release.yml index 5fff3893d..1575f408c 100644 --- a/.github/workflows/build-and-test.ubuntu-release.yml +++ b/.github/workflows/build-and-test.ubuntu-release.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} services: elasticsearch8: - image: elastic/elasticsearch:8.8.1 + image: elastic/elasticsearch:8.9.1 options: >- --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --env discovery.type=single-node @@ -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.12 options: >- --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --env discovery.type=single-node diff --git a/.github/workflows/build-and-test.win.yml b/.github/workflows/build-and-test.win.yml index 4151aa8ec..ad8bea77a 100644 --- a/.github/workflows/build-and-test.win.yml +++ b/.github/workflows/build-and-test.win.yml @@ -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.2.1 + OPENSSL_VERSION: 1.1.1v + ZLIB_VERSION: 1.3 jobs: prepare-mingw64-libs: name: Build required 3rd-party libraries diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index 820de552d..923bf5668 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} services: elasticsearch8: - image: elastic/elasticsearch:8.8.1 + image: elastic/elasticsearch:8.9.1 options: >- --env ES_JAVA_OPTS="-Xms512m -Xmx512m" --env discovery.type=single-node From 0ca0616e1edb99a9a57988091223e5daf886b6a0 Mon Sep 17 00:00:00 2001 From: abitmore Date: Tue, 5 Sep 2023 23:42:52 +0000 Subject: [PATCH 3/5] Fix Github Actions Ubuntu debug build Build tests in /mnt --- .github/workflows/build-and-test.ubuntu-debug.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.ubuntu-debug.yml b/.github/workflows/build-and-test.ubuntu-debug.yml index da26a8f6c..2743ca0c7 100644 --- a/.github/workflows/build-and-test.ubuntu-debug.yml +++ b/.github/workflows/build-and-test.ubuntu-debug.yml @@ -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 From d1ae7e69bcb23cdaffe1d963c5356b029c38e3d7 Mon Sep 17 00:00:00 2001 From: abitmore Date: Wed, 6 Sep 2023 10:30:32 +0000 Subject: [PATCH 4/5] Record filled amount in limit orders --- libraries/chain/db_market.cpp | 3 +++ libraries/chain/include/graphene/chain/config.hpp | 2 +- libraries/chain/include/graphene/chain/market_object.hpp | 9 +++++---- libraries/chain/market_object.cpp | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libraries/chain/db_market.cpp b/libraries/chain/db_market.cpp index 930de41a9..6842ef0e4 100644 --- a/libraries/chain/db_market.cpp +++ b/libraries/chain/db_market.cpp @@ -1232,6 +1232,7 @@ database::match_result_type database::match_limit_settled_debt( const limit_orde 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 @@ -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 }); } @@ -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 diff --git a/libraries/chain/include/graphene/chain/config.hpp b/libraries/chain/include/graphene/chain/config.hpp index 9ac7aa723..24bdbfa55 100644 --- a/libraries/chain/include/graphene/chain/config.hpp +++ b/libraries/chain/include/graphene/chain/config.hpp @@ -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 diff --git a/libraries/chain/include/graphene/chain/market_object.hpp b/libraries/chain/include/graphene/chain/market_object.hpp index 4faa8e5c2..b04430585 100644 --- a/libraries/chain/include/graphene/chain/market_object.hpp +++ b/libraries/chain/include/graphene/chain/market_object.hpp @@ -45,10 +45,11 @@ using namespace graphene::db; class limit_order_object : public abstract_object { 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 diff --git a/libraries/chain/market_object.cpp b/libraries/chain/market_object.cpp index bc78adb1d..9f9fc5357 100644 --- a/libraries/chain/market_object.cpp +++ b/libraries/chain/market_object.cpp @@ -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) ) From 692608b01a7b55b35cb4187b01047c68c9ac63fd Mon Sep 17 00:00:00 2001 From: abitmore Date: Wed, 6 Sep 2023 19:53:34 +0000 Subject: [PATCH 5/5] Fix typo in a comment to fix code coverage report GCOVR_EXEL_STOP -> GCOVR_EXCL_STOP --- libraries/chain/db_market.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/db_market.cpp b/libraries/chain/db_market.cpp index 6842ef0e4..01043fcb8 100644 --- a/libraries/chain/db_market.cpp +++ b/libraries/chain/db_market.cpp @@ -1225,7 +1225,7 @@ 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 {