Skip to content
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

Merge release branch to master branch for 4.0 release #2093

Merged
merged 673 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
673 commits
Select commit Hold shift + click to select a range
a2fc464
Merge pull request #2134 from bitshares/pr-fix-4.0
abitmore Apr 8, 2020
23008cd
Merge 'hardfork' branch, apply minor fixes
abitmore Apr 9, 2020
7348873
Fix test cases
abitmore Apr 9, 2020
ab3f9b8
Update coding style
abitmore Apr 9, 2020
c32a4e6
Add market fee sharing for instant settlements
abitmore Apr 9, 2020
140f022
Update test cases
abitmore Apr 9, 2020
88727de
Wrap long lines
abitmore Apr 9, 2020
c54302f
Update comments
abitmore Apr 10, 2020
db5bb12
Merge pull request #2132 from bitshares/way-old-hardfork-for-issue-1780
abitmore Apr 10, 2020
350f177
Merge 'hardfork' branch
abitmore Apr 10, 2020
2ddf047
Fix market fee sharing for temp-account referrer
abitmore Apr 10, 2020
0a3a0a6
Add tests for temp-account referrer fee sharing
abitmore Apr 10, 2020
09970f6
Fee max of 30%
jmjatlanta Apr 10, 2020
53f0a00
Merge pull request #2128 from bitshares/pr-bsip86
abitmore Apr 10, 2020
ad51a8d
Add a missing param in get_required_signatures API
abitmore Apr 10, 2020
f55a5c8
Merge pull request #2138 from bitshares/pr-2087-get-required-sigs-cus…
abitmore Apr 11, 2020
a6bed6b
Update jmj_bsip_64 with hardfork changes
jmjatlanta Apr 11, 2020
a59540f
fixes for wallet operation_printer
jmjatlanta Apr 11, 2020
70cc85f
Merge pull request #2133 from bitshares/old-hardfork-for-issue-1800
abitmore Apr 11, 2020
9975948
bsip64 memo fixes and addl testing
jmjatlanta Apr 15, 2020
7eee72c
fix constexpr warnings
jmjatlanta Apr 15, 2020
f161b38
verify hash appears in history
jmjatlanta Apr 15, 2020
f1a2ab0
add per kb fee for htlc memos
jmjatlanta Apr 15, 2020
0a55c64
bump FC for hash160 changes
jmjatlanta Apr 15, 2020
81666aa
Update by_custom_id to by_id
abitmore Apr 16, 2020
9c7860e
Check api_helper_indexes plugin for several APIs
abitmore Apr 16, 2020
5bd1a59
Enable custom_operations plugin by default
abitmore Apr 16, 2020
c921ffd
Fix test cases
abitmore Apr 16, 2020
e836204
Merge pull request #2142 from bitshares/fix-4.0
abitmore Apr 16, 2020
352b854
Merge pull request #2143 from bitshares/pr-2092-enable-custom-operati…
abitmore Apr 16, 2020
c5c763e
Implement BSIP85 Maker order creation fee discount
abitmore Apr 17, 2020
85f651c
Add a comment
abitmore Apr 17, 2020
43ce6fd
Add test cases for bsip 85
abitmore Apr 17, 2020
2f2ec4d
BSIP81: Define taker fee
MichelSantos Mar 30, 2020
b252cf6
BSIP81: Use maker or taker fee when calculating market fee
MichelSantos Mar 30, 2020
3e49240
Add get_limit_orders_by_account API
abitmore Apr 18, 2020
a60feec
BSIP81: Define hardfork time
MichelSantos Mar 30, 2020
58767d9
BSIP81: Hardfork guards on asset operations
MichelSantos Mar 30, 2020
e9c8f59
BSIP81: Assign default taker fees at hardfork activation time
MichelSantos Mar 30, 2020
ebff7f1
BSIP81: Test the setting of taker fees
MichelSantos Apr 1, 2020
501cb1e
BSIP81: Test default values of taker fees after hardfork activation
MichelSantos Apr 1, 2020
fe590d1
BSIP81: Test taker fees when complete filling of UIA orders
MichelSantos Apr 4, 2020
c7ed43b
BSIP81: Hardfork guards on asset operations in proposals
MichelSantos Apr 9, 2020
36fbf2d
BSIP81: Test taker fees when complete filling of UIA orders
MichelSantos Apr 9, 2020
9d73860
BSIP81: Test taker fees when complete filling of a smart asset order
MichelSantos Apr 9, 2020
9b9ed84
BSIP81: Test maker and taker fees for partially filled limit orders
MichelSantos Apr 10, 2020
bab6d23
BSIP81: Comments
MichelSantos Apr 13, 2020
86a7233
BSIP81: Remove unused public function from evaluator
MichelSantos Apr 13, 2020
8e221be
BSIP81: Fix bug of zero taker fees whenever maker fee is set to 0%
MichelSantos Apr 13, 2020
4f339c6
BSIP81: Refactor taker_fee_percent into asset_options.extensions
MichelSantos Apr 14, 2020
2be77d9
BSIP81: Refactor unit tests to obtain the final asset objects from th…
MichelSantos Apr 14, 2020
759c91a
BSIP81: Comments
MichelSantos Apr 15, 2020
6d750c6
BSIP81: Taker orders should be charged the taker fee if defined, othe…
MichelSantos Apr 15, 2020
3408aac
BSIP81: Merge resolution with Issue 1780
MichelSantos Apr 18, 2020
20e43f0
Adjust fee schedule
jmjatlanta Apr 18, 2020
322113d
Move api-limit related test cases to a new file
abitmore Apr 18, 2020
c851b2a
Fix API docs
abitmore Apr 18, 2020
afcd7d5
Add test cases for get_limit_orders_by_account API
abitmore Apr 18, 2020
911ff45
Fix test cases
abitmore Apr 18, 2020
5f68e64
do htlc hf checks in proposals
jmjatlanta Apr 18, 2020
bbab2f9
add preimage serialization
jmjatlanta Apr 18, 2020
b6bb193
adjust transfer_restricted logic
jmjatlanta Apr 18, 2020
1039366
Exclude memo on locked wallets
jmjatlanta Apr 18, 2020
3629d80
put print_memo in proper scope
jmjatlanta Apr 18, 2020
329e5ac
Initial implementation of BSIP87
christophersanborn Apr 19, 2020
5a1dc72
Update database APIs related to workers
abitmore Apr 20, 2020
aaf9693
Add test cases for get_all_workers API
abitmore Apr 20, 2020
4e04c1d
Add test cases for get_workers_by_account API
abitmore Apr 20, 2020
133f7c3
truncate long preimages in wallet output
jmjatlanta Apr 20, 2020
3e3df5a
standardize exact hardfork time
jmjatlanta Apr 20, 2020
ec78f4d
Use current (not default) memo fee
jmjatlanta Apr 20, 2020
fc15857
Detect overflow
jmjatlanta Apr 20, 2020
a264f91
Merge pull request #2149 from bitshares/pr-2121-worker-api
abitmore Apr 20, 2020
4d6c20a
Update default config.ini for docker
abitmore Apr 21, 2020
e0fa2c4
Merge pull request #2145 from bitshares/pr-bsip85-maker-fee-discount
abitmore Apr 21, 2020
cf36230
remove decimal from test
jmjatlanta Apr 21, 2020
96112d4
BOOST_TEST_FAIL no longer part of Boost
jmjatlanta Apr 21, 2020
9931176
Fix routing of fees to correct parties.
christophersanborn Apr 21, 2020
ecadf2b
Add seed nodes provided by the community
abitmore Apr 22, 2020
5d25fb4
Merge pull request #2146 from bitshares/pr-account-orders-api
abitmore Apr 22, 2020
cd2e902
Merge pull request #2152 from bitshares/seeds-community
abitmore Apr 22, 2020
f99d81f
BSIP81: Test improvements
MichelSantos Apr 21, 2020
0f712cc
BSIP81: Test default taker fee usage after hardfork if the asset owne…
MichelSantos Apr 21, 2020
f1e0bae
Report the actual API limits in error messages
abitmore Apr 22, 2020
4bda2d9
Merge pull request #2136 from bitshares/bsip81
abitmore Apr 22, 2020
13c0ff6
Fix wallet and tests
abitmore Apr 22, 2020
850079e
Fix cli_test
abitmore Apr 22, 2020
25b96e7
Fix test case for api-limit-lookup-vote-ids
abitmore Apr 22, 2020
79a7abf
fee_helper refactor
jmjatlanta Apr 23, 2020
511c195
Merge pull request #2154 from bitshares/pr-2141-api-limit-message
abitmore Apr 23, 2020
0412a9c
Update comment
abitmore Apr 23, 2020
dd0bef7
Implement BSIP 77: Initial collateral ratio (ICR)
abitmore Apr 23, 2020
11f0b8c
Prevent exception if fee does not exist
jmjatlanta Apr 23, 2020
f2d76ad
merge changes from hardfork
jmjatlanta Apr 23, 2020
9f4c786
Merge pull request #2155 from bitshares/update-comment
abitmore Apr 23, 2020
b8c6843
Update some old test cases to cover bsip77
abitmore Apr 24, 2020
6e8ecba
Remove an outdated test case about TCR
abitmore Apr 24, 2020
49ea968
Add test case for BSIP77: hard fork time test
abitmore Apr 24, 2020
4f02fcf
Update comment for a test case for bsip77
abitmore Apr 24, 2020
d02fd01
permit restricted transfers in proposals
jmjatlanta Apr 24, 2020
7cfcc52
merge of hf into feature branch
jmjatlanta Apr 24, 2020
9963c8c
Update derived data when ICR changed
abitmore Apr 24, 2020
2131c68
Add tests about how ICR changes affect borrowing
abitmore Apr 24, 2020
16023af
Put collateral-denominated fees into correct container
christophersanborn Apr 25, 2020
09a96da
Use accumulate_fee method
christophersanborn Apr 25, 2020
e4472a9
Remove test spaghetti + minor fixes
jmjatlanta Apr 27, 2020
0b0d7e9
Merge pull request #2140 from bitshares/jmj_bsip86_30pct
abitmore Apr 27, 2020
d04d913
Add collateral-denominated fees container
christophersanborn Apr 25, 2020
43026a8
Add accumulate_fee() method to asset_object
christophersanborn Apr 25, 2020
985733e
Add ability to claim collateral-denominated fees.
christophersanborn Apr 26, 2020
d116fc8
Check collateral fees empty before changing backing asset.
christophersanborn Apr 27, 2020
f608039
Hardfork protection on asset_claim_fees extension.
christophersanborn Apr 27, 2020
0caf73e
Proposal hardfork guards on asset_claim_fees_operation
christophersanborn Apr 27, 2020
bb8493d
Merge pull request #1998 from bitshares/jmj_bsip_64
abitmore Apr 28, 2020
06b0fe3
Fix line length, store preimage in virt op
jmjatlanta Apr 28, 2020
ccef9fd
Replace BOOST_TEST with BOOST_CHECK
jmjatlanta Apr 28, 2020
ca06127
Merge pull request #2161 from bitshares/jmj_bsip_64_pt2
abitmore Apr 28, 2020
864cf3e
Move seed nodes processing code to network module
jmjatlanta Apr 29, 2020
30648f2
Periodically re-check addresses of seed nodes
abitmore May 1, 2020
8bff266
return lowest_ask and highest_bid order volume
crazybits Apr 28, 2020
22ab82c
formatting updated as advised
crazybits Apr 29, 2020
02f9da8
Changes requested in code review
christophersanborn May 2, 2020
b6785e0
Merge pull request #2159 from christophersanborn/cjs-collat-asset-con…
abitmore May 3, 2020
68eebf1
Merge pull request #2166 from crazybits/hardfork
abitmore May 3, 2020
ecc5cbb
Merge pull request #2164 from bitshares/pr-2153-recheck-seeds
abitmore May 3, 2020
453b30a
Merge hardfork into cjs-bsip87
christophersanborn May 4, 2020
cd4753b
BSIP87 hardfork checks in proposal evaluator.
christophersanborn May 5, 2020
f5d4e44
Merge branch 'hardfork' into pr-bsip77-icr
abitmore May 5, 2020
319fc3b
Merge pull request #2157 from bitshares/pr-bsip77-icr
abitmore May 5, 2020
0a789cf
Improve error message in asset_claim_fees_evaluator
MichelSantos May 6, 2020
a8d348d
BSIP74 and BSIP87: Test of collateral-denominated fees container
MichelSantos Apr 29, 2020
a4b4a77
BSIP87: Test of force settlement fee with 3 actors
MichelSantos Apr 24, 2020
27cab11
BSIP87: Test of force settlement fee with 5 actors
MichelSantos Apr 30, 2020
9376ce0
BSIP87: Test of invalid claims of force settlement fees
MichelSantos May 5, 2020
487e86a
BSIP87: Test of 100% force-settlement fee
MichelSantos May 6, 2020
c4c8b6a
Merge hardfork into cjs-bsip87
christophersanborn May 6, 2020
fbd832b
Move force_settle_fee_percent from asset_options to bitasset_options
christophersanborn May 7, 2020
fde2aa4
Merge pull request #2151 from christophersanborn/cjs-bsip87
abitmore May 7, 2020
e3b7c6d
Merge cjs-bsip87 into bsip87-tests
christophersanborn May 8, 2020
45bf978
Revert "Improve error message in asset_claim_fees_evaluator"
christophersanborn May 8, 2020
89d97c1
Adapt tests to relocated force_settle_fee_percent.
christophersanborn May 8, 2020
ce1b13e
Clarify exception text for insufficient accumulated fees in fee claim.
christophersanborn May 8, 2020
e9cb1f2
Rename settle_tests2.cpp -> force_settle_fee_tests.cpp
christophersanborn May 8, 2020
ea3f765
Merge branch 'bsip87-tests' into cjs-bsip87
christophersanborn May 8, 2020
73ddfcc
Improve performance for account_update
abitmore May 9, 2020
784af1b
Merge pull request #2173 from bitshares/pr-optimize-account-update
abitmore May 10, 2020
5cd4fc1
BSIP74 & BSIP87: Avoid dereferencing objects after block generation
MichelSantos May 11, 2020
5363c33
BSIP74 & BSIP87: Avoid non-deterministic floating point functions
MichelSantos May 11, 2020
f9e5c75
BSIP74 & BSIP87: Test of invalid claims
MichelSantos May 11, 2020
666282a
BSIP87: Comments
MichelSantos May 11, 2020
1175ec0
BSIP87: Remove unnecessary code
MichelSantos May 11, 2020
6b64eaa
BSIP87: Avoid non-deterministic floating point functions
MichelSantos May 11, 2020
c0a4896
BSIP87: Test of invalid claims
MichelSantos May 11, 2020
e323178
BSIP87: Test of partial claims
MichelSantos May 11, 2020
f1d90da
Improve get_account_stats_by_owner performance
abitmore May 11, 2020
da81ded
BSIP87: Test prevention of early usage of force-settlement fee and cl…
MichelSantos May 12, 2020
2fa51be
Merge pull request #2172 from christophersanborn/cjs-bsip87
abitmore May 12, 2020
50ce8e7
Merge pull request #2174 from bitshares/optimize-acc-stats-getter
abitmore May 12, 2020
841b442
Add extensions to several asset operations
abitmore May 14, 2020
ec02a5c
Fix test cases
abitmore May 14, 2020
e698796
Add todo
abitmore May 14, 2020
95b2820
Add functions to create proposals in db fixture
abitmore May 13, 2020
7d71ee0
Add test case for bsip 48/75 hardfork protection
abitmore May 14, 2020
7330afe
Fix validation of asset flags
abitmore May 15, 2020
31746d3
Add limitations about updating asset precision
abitmore May 16, 2020
77f9ff6
Fix a bug about updating maximum supply of assets
abitmore May 16, 2020
ca12bbe
Requires global_settle permission enabled for PM
abitmore May 16, 2020
5f87be4
Remove equality function of price_feed struct
abitmore May 16, 2020
dd1f169
Add test case for PM global_settle permission bug
abitmore May 17, 2020
5796380
Update tests about price_feed equality function
abitmore May 17, 2020
7b6936d
Slightly refactor code about ICR and MCR handling
abitmore May 17, 2020
c48295d
Add test case about updating an asset's max_supply
abitmore May 17, 2020
33b1234
Add test case about lock_max_supply flag
abitmore May 17, 2020
f277306
Add function to reserve asset in db fixture
abitmore May 17, 2020
2e77e4c
Add more test cases about lock_max_supply flag
abitmore May 17, 2020
531cc2c
Add test case for disable_new_supply flag
abitmore May 17, 2020
9a5917f
Add proposal tests for the flags about supply
abitmore May 17, 2020
f61fb94
Add test case for skip_core_exchange_rate
abitmore May 17, 2020
17eb11e
Add test case about valid bits in asset flags
abitmore May 18, 2020
2dbb6bc
Add test cases about updating asset precision
abitmore May 18, 2020
910c922
Update database fixture to be able to feed ICR
abitmore May 18, 2020
534f508
Test asset creation with all permission bits
abitmore May 19, 2020
3979b2d
Add tests about asset owner's permissions ...
abitmore May 19, 2020
3fba84c
Add tests for valid range of ICR, MCR and MSSR
abitmore May 20, 2020
235b100
Add test case for feeding ICR
abitmore May 20, 2020
01c3424
Fix tests about CER feeding bug (Graphene HF480)
abitmore May 20, 2020
bfbb407
Add tests about margin calls after ratios updated
abitmore May 21, 2020
6b61025
BSIP74: Hardfork activation time
jmjatlanta May 25, 2020
7f4c08b
Update tally
abitmore May 10, 2020
60b106f
Add functions to create proposals in db fixture
abitmore May 13, 2020
d807a05
Verify supplies after generated a block in tests
abitmore May 24, 2020
e64d592
Merge hardfork
abitmore May 25, 2020
363d003
BSIP74: Objects
christophersanborn May 25, 2020
f7ea982
BSIP74: Operations
christophersanborn May 25, 2020
becea4d
BSIP74: Operation evaluators
christophersanborn May 25, 2020
d1b5624
BSIP74: Database logic
christophersanborn May 25, 2020
11aa1be
BSIP74: Tests
MichelSantos May 25, 2020
405163a
Fix db notify
abitmore May 27, 2020
239fbbc
Add sub-asset creation fee
abitmore May 27, 2020
4d39f13
Add test cases for asset creation fee calculation
abitmore May 27, 2020
76e8818
BSIP74: Tests updated for code review
MichelSantos May 27, 2020
620b1af
BSIP74: Corrections requested in code review.
christophersanborn May 27, 2020
5323174
Merge pull request #2180 from bitshares/pr-bsip74
abitmore May 28, 2020
704cac2
Merge hardfork branch
abitmore May 28, 2020
6e532a8
Merge pull request #2176 from bitshares/pr-bsip75-bitasset-ops
abitmore May 28, 2020
aa64800
add who was selling what to get_trade_history
oxarbitrage May 13, 2020
a62239a
add who was selling what to get_trade_history_by_sequence
oxarbitrage May 13, 2020
fa0f09f
change was_selling variables to string
oxarbitrage May 15, 2020
1feb82d
change output format
oxarbitrage May 16, 2020
81625ec
change logic and remove redundant blocks of code
oxarbitrage May 21, 2020
86c2ba8
Merge pull request #2181 from bitshares/pr-2163-to-hardfork
abitmore May 28, 2020
26c32f5
Merge pull request #2182 from bitshares/hardfork
abitmore May 28, 2020
ea14091
Split custom active auth predicate to more files
abitmore May 5, 2020
3adaaf8
Apply static_cast to enum values, fix macOS build
abitmore May 31, 2020
ab8ead7
Split operations to more lists, fix Windows build
abitmore May 31, 2020
3394e12
Set big-obj property for files, fix MinGW build
abitmore May 31, 2020
86759ce
Refactor constructors of price_feed_with_icr
abitmore May 31, 2020
e123bae
Update default limits about get_full_accounts API
abitmore Jun 3, 2020
8480571
Update default limits for get_full_accounts API
abitmore Jun 3, 2020
eb329cd
Update default Docker limits for get_full_accounts
abitmore Jun 3, 2020
befe3b5
Fix test cases about get_full_accounts API limits
abitmore Jun 4, 2020
54b5821
Test max size of get_full_accounts returned lists
abitmore Jun 4, 2020
31377f8
Remove unused code
abitmore Jun 4, 2020
1666504
Merge pull request #2190 from bitshares/pr-2165-get-full-accounts-def…
abitmore Jun 4, 2020
8e78599
Add mainnet seed nodes provided by xbts.io
abitmore Jun 9, 2020
5c0aed1
Update blckchnd's seed node, remove Sahkan's seed
abitmore Jun 9, 2020
05c97a1
Add bitshares.org seed, update format
abitmore Jun 10, 2020
932bb9e
Fix tick update
abitmore Jun 11, 2020
554e897
Skip tests when building for sonar in Travis
abitmore Jun 11, 2020
f6d5313
Update travis cfg, try to get around timeout issue
abitmore Jun 11, 2020
2c69f94
Update travis cfg to get around OOM issue
abitmore Jun 11, 2020
222e6c4
Merge pull request #2191 from bitshares/update-seeds
abitmore Jun 11, 2020
0d047e7
Explicitly list cpp files for building wallet lib
abitmore Jun 15, 2020
e22436f
Merge pull request #2198 from bitshares/fix-gitian-ubuntu-cli
abitmore Jun 16, 2020
6b7ab1f
Update an error message for call order update
abitmore Jun 22, 2020
a6da784
Update error message for CLI get_asset command
abitmore Jun 22, 2020
2653c32
Use shorter expression in assertion
abitmore Jun 23, 2020
099c842
Merge pull request #2206 from bitshares/update-error-messages
abitmore Jun 23, 2020
0aca182
Update README.md
abitmore Jun 23, 2020
882c9aa
Merge pull request #2207 from bitshares/update-readme
abitmore Jun 25, 2020
84abe7e
Merge branch 'release'
abitmore Jun 25, 2020
1f14146
Sort mail map alphabetically, add crazybits
abitmore Jun 25, 2020
c456f70
Update contributors
abitmore Jun 25, 2020
9ca198f
Update version in Doxyfile to 4.0.0
abitmore Jun 26, 2020
0f1fe70
Update docs to point to latest content in Wiki
abitmore Jun 26, 2020
67558aa
Merge pull request #2209 from bitshares/copyright-update-develop
abitmore Jun 26, 2020
12106a4
Merge pull request #2211 from bitshares/update-docs
abitmore Jun 26, 2020
2133c53
Merge pull request #2210 from bitshares/update-doxyfile
abitmore Jun 26, 2020
c7633bc
Set BitShares Mainnet 4.0 protocol activation time
abitmore Jun 26, 2020
d8981f2
Merge pull request #2212 from bitshares/update-hf-date
abitmore Jun 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: c++

cache: ccache
cache:
ccache: true
directories:
- sonar_cache

git:
depth: 1
Expand All @@ -27,6 +30,12 @@ env:
jobs:
include:
- stage: build for cache
script: ./programs/build_helpers/build_protocol
script: ./programs/build_helpers/build_for_cache
- stage: build and test
script: ./programs/build_helpers/build_and_test
- stage: scan with sonar, step 1
script: ./programs/build_helpers/scan_with_sonar_step_1
- stage: scan with sonar, step 2
script: ./programs/build_helpers/scan_with_sonar_step_2
- stage: scan with sonar, step 3
script: ./programs/build_helpers/scan_with_sonar_step_3
141 changes: 90 additions & 51 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
message(FATAL_ERROR "Clang version must be at least 3.3!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "19.0")
message(FATAL_ERROR "MSVC version must be at least 19.0 (Visual Studio 2015 Update 1)!")
endif()

# allow MSVC VS2015 with Update 1, other 2015 versions are not supported
if ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "19.0")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "19.0.23506.0")
message(FATAL_ERROR "Your version ${CMAKE_CXX_COMPILER_VERSION} of MSVC is not supported, use version 19.0.23506.0 (Visual Studio 2015 Update 1)!")
endif()
endif()
endif()

list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
Expand All @@ -38,53 +49,71 @@ include(Utils)
# function to help with cUrl
macro(FIND_CURL)
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(OpenSSL REQUIRED)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
list(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES} ${BOOST_THREAD_LIBRARY} ${CMAKE_DL_LIBS})
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)

if( WIN32 )
if ( MSVC )
list( APPEND CURL_LIBRARIES Wldap32 )
endif( MSVC )

if( MINGW )
# MinGW requires a specific order of included libraries ( CURL before ZLib )
find_package( ZLIB REQUIRED )
list( APPEND CURL_LIBRARIES ${ZLIB_LIBRARY} pthread )
endif( MINGW )

list( APPEND CURL_LIBRARIES ${PLATFORM_SPECIFIC_LIBS} )
endif( WIN32 )
endmacro()

# Save the old value of CMAKE_REQUIRED_FLAGS
set( TEMP_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} )

# Fortify source
if (CMAKE_COMPILER_IS_GNUCXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message ("-- Setting optimizations for clang++")
message (STATUS "Setting optimizations for clang++")
set(CMAKE_CXX_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1 -g")

# check and add data execution prevention
message ("-- Enabling data execution prevention")
message (STATUS "Enabling data execution prevention")
add_linker_flag("-fsanitize=safe-stack")

# check and add Stack-based buffer overrun detection
set(CMAKE_REQUIRED_FLAGS "-fstack-protector")
check_c_compiler_flag("" HAVE_STACKPROTECTOR)
if(HAVE_STACKPROTECTOR)
message ("-- Enabling stack-based buffer overrun detection")
message (STATUS "Enabling stack-based buffer overrun detection")
add_flag_append(CMAKE_C_FLAGS "-fstack-protector")
add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector")
endif()
else ()
message ("-- Setting optimizations for g++")
message (STATUS "Setting optimizations for g++")
set(CMAKE_CXX_FLAGS_RELEASE "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-D_FORTIFY_SOURCE=2 -O3 -DNDEBUG=1 -g")

# check and add data execution prevention
set(CMAKE_REQUIRED_FLAGS "-Wl,-znoexecstack")
check_c_compiler_flag("" HAVE_NOEXECSTACK)
if(HAVE_NOEXECSTACK)
message ("-- Enabling data execution prevention")
message (STATUS "Enabling data execution prevention")
add_linker_flag("-znoexecstack")
endif()

# check and add Stack-based buffer overrun detection
set(CMAKE_REQUIRED_FLAGS "-fstack-protector-strong")
check_c_compiler_flag("" HAVE_STACKPROTECTOR)
if(HAVE_STACKPROTECTOR)
message ("-- Enabling stack-based buffer overrun detection")
message (STATUS "Enabling stack-based buffer overrun detection")
add_flag_append(CMAKE_C_FLAGS "-fstack-protector-strong")
add_flag_append(CMAKE_CXX_FLAGS "-fstack-protector-strong")
endif()
Expand All @@ -96,22 +125,26 @@ endif ()
set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro,-znow")
check_c_compiler_flag("" HAVE_RELROFULL)
if(HAVE_RELROFULL)
message ("-- Enabling full data relocation and protection")
message (STATUS "Enabling full data relocation and protection")
add_linker_flag("-zrelro")
add_linker_flag("-znow")
else()
#if full relro is not available, try partial relro
set(CMAKE_REQUIRED_FLAGS "-Wl,-zrelro")
check_c_compiler_flag("" HAVE_RELROPARTIAL)
if(HAVE_RELROPARTIAL)
message ("-- Enabling partial data relocation and protection")
message (STATUS "Enabling partial data relocation and protection")
add_linker_flag("-zrelro")
endif()
endif()

set(CMAKE_REQUIRED_FLAGS ${TEMP_REQUIRED_FLAGS} )

# position independent executetable (PIE)
# position independent code (PIC)
add_definitions (-fPIC)
if (NOT MSVC)
add_definitions (-fPIC)
endif(NOT MSVC)

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set( GRAPHENE_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/libraries/egenesis/genesis.json"
Expand All @@ -123,9 +156,9 @@ endif(USE_PCH)

option(USE_PROFILER "Build with GPROF support(Linux)." OFF)

IF( NOT WIN32 )
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" )
ENDIF( NOT WIN32 )
# Use Boost config file from fc
set(Boost_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules/Boost")

list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/GitVersionGen" )
include( GetGitRevisionDescription )
get_git_head_revision( GIT_REFSPEC GIT_SHA2 )
Expand All @@ -139,14 +172,20 @@ LIST(APPEND BOOST_COMPONENTS thread
program_options
chrono
unit_test_framework
context)
context
coroutine
regex)
# boost::endian is also required, but FindBoost can't handle header-only libs
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT})
IF(WIN32)
if($ENV{BOOST_ROOT})
SET(BOOST_ROOT $ENV{BOOST_ROOT})
endif($ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
add_definitions("-DCURL_STATICLIB")
list(APPEND PLATFORM_SPECIFIC_LIBS ws2_32 crypt32 mswsock userenv )
ELSE( WIN32 )
IF( APPLE )
set( CMAKE_THREAD_LIBS_INIT "-lpthread" )
Expand All @@ -157,28 +196,36 @@ ELSE( WIN32 )
ENDIF( APPLE )
ENDIF(WIN32)

FIND_PACKAGE(Boost 1.57 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()
FIND_PACKAGE(Boost CONFIG REQUIRED COMPONENTS ${BOOST_COMPONENTS})

# enforce more strict compiler warnings and errors
add_compiler_flag_if_available("-Wall")
add_compiler_flag_if_available("-Wclobbered")
add_compiler_flag_if_available("-Wempty-body")
add_compiler_flag_if_available("-Wformat-security")
add_compiler_flag_if_available("-Wignored-qualifiers")
add_compiler_flag_if_available("-Wimplicit-fallthrough=5")
add_compiler_flag_if_available("-Wmissing-field-initializers")
add_compiler_flag_if_available("-Wpointer-arith")
add_compiler_flag_if_available("-Wshift-negative-value")
add_compiler_flag_if_available("-Wtype-limits")
add_compiler_flag_if_available("-Wunused-but-set-parameter")

if( WIN32 )

message( STATUS "Configuring BitShares on WIN32")
set( DB_VERSION 60 )
set( BDB_STATIC_LIBS 1 )

set( ZLIB_LIBRARIES "" )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
if ( MINGW )
message( STATUS "Windows build using MinGW" )
set( FULL_STATIC_BUILD TRUE )
else( MINGW )
set( ZLIB_LIBRARIES "" )
endif( MINGW )

set(CRYPTO_LIB)
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )

if( MSVC )
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DWIN32_LEAN_AND_MEAN)
#looks like this flag can have different default on some machines.
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
Expand All @@ -187,44 +234,32 @@ if( WIN32 )
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG")
endif ( MSVC )

# On windows tcl should be installed to the directory pointed by setenv.bat script
SET(TCL_INCLUDE_PATH $ENV{TCL_ROOT}/include)
MESSAGE(STATUS "tcl INCLUDE PATH: ${TCL_INCLUDE_PATH}")

FIND_PACKAGE(TCL)
MESSAGE(STATUS "tcl_library: ${TCL_LIBRARY}")

SET(TCL_LIBS "optimized;${TCL_LIBRARY};debug;")
get_filename_component(TCL_LIB_PATH "${TCL_LIBRARY}" PATH)
get_filename_component(TCL_LIB_NAME "${TCL_LIBRARY}" NAME_WE)
get_filename_component(TCL_LIB_EXT "${TCL_LIBRARY}" EXT)

SET(TCL_LIBS "${TCL_LIBS}${TCL_LIB_PATH}/${TCL_LIB_NAME}g${TCL_LIB_EXT}")
SET(TCL_LIBRARY ${TCL_LIBS})

else( WIN32 ) # Apple AND Linux

if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring BitShares on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -stdlib=libc++ -Wall" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" )
# OpenBSD Specific Options
message( STATUS "Configuring BitShares on OpenBSD" )
else()
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
set( rt_library rt )
endif()
# Common Linux & OpenBSD Options
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall" )
if(USE_PROFILER)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
endif( USE_PROFILER )
set( rt_library rt )
set( pthread_library pthread)
if ( NOT DEFINED crypto_library )
# I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()?
# if you have a normal install, you can define crypto_library to the empty string to avoid a build error
set( crypto_library crypto)
endif ()
if ( FULL_STATIC_BUILD )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
endif ( FULL_STATIC_BUILD )
endif( APPLE )

if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
Expand All @@ -247,6 +282,10 @@ else( WIN32 ) # Apple AND Linux

endif( WIN32 )

if ( NOT MSVC AND FULL_STATIC_BUILD )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libstdc++ -static-libgcc" )
endif ( NOT MSVC AND FULL_STATIC_BUILD )

set(ENABLE_COVERAGE_TESTING FALSE CACHE BOOL "Build BitShares for code coverage analysis")

if(ENABLE_COVERAGE_TESTING)
Expand Down
12 changes: 12 additions & 0 deletions CMakeModules/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ macro(add_linker_flag _FLAG)
add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
endmacro(add_linker_flag _FLAG)

include(CheckCXXCompilerFlag)

macro(add_compiler_flag_if_available _FLAG)
string(TOUPPER "${_FLAG}" _TEMPVAR1)
string(REPLACE "-" "_" _TEMPVAR2 "${_TEMPVAR1}")
string(CONCAT _TEMPVAR3 "HAVE" "${_TEMPVAR2}")
set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
check_cxx_compiler_flag("${_FLAG}" ${_TEMPVAR3})
if(${_TEMPVAR3})
add_flag_append(CMAKE_CXX_FLAGS ${_FLAG})
endif()
endmacro(add_compiler_flag_if_available _VAR_NAME _FLAG)
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ EXPOSE 1776

# default exec/config files
ADD docker/default_config.ini /etc/bitshares/config.ini
ADD docker/default_logging.ini /etc/bitshares/logging.ini
ADD docker/bitsharesentry.sh /usr/local/bin/bitsharesentry.sh
RUN chmod a+x /usr/local/bin/bitsharesentry.sh

Expand Down
Loading