Skip to content

Commit

Permalink
Merge pull request #142 from boscore/release/3.0.x
Browse files Browse the repository at this point in the history
prepare v3.0.5 to master
  • Loading branch information
Thaipanda authored Feb 14, 2020
2 parents c8869e6 + 6ab5c6e commit 09312ec
Show file tree
Hide file tree
Showing 50 changed files with 293 additions and 1,953 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "libraries/chainbase"]
path = libraries/chainbase
url = https://github.com/eosio/chainbase
url = https://github.com/boscore/chainbase
ignore = dirty
[submodule "libraries/appbase"]
path = libraries/appbase
Expand Down
45 changes: 16 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")

if (UNIX)
if (APPLE)
if (LLVM_DIR STREQUAL "" OR NOT LLVM_DIR)
set(LLVM_DIR "/usr/local/opt/llvm@4/lib/cmake/llvm/")
endif()
endif()
if (UNIX AND APPLE)
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/llvm@4" "/usr/local/opt/gettext")
endif()

include( GNUInstallDirs )
Expand All @@ -35,7 +31,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 4)
set(VERSION_PATCH 5)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand All @@ -52,8 +48,8 @@ set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )

# http://stackoverflow.com/a/18369825
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "GCC version must be at least 6.0!")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message(FATAL_ERROR "GCC version must be at least 7.0!")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fdiagnostics-color=always)
Expand Down Expand Up @@ -112,24 +108,18 @@ IF( WIN32 )
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
ENDIF(WIN32)
FIND_PACKAGE(Boost 1.67 REQUIRED COMPONENTS
set( Boost_NO_BOOST_CMAKE ON CACHE STRING "ON or OFF" )
FIND_PACKAGE(Boost 1.71 REQUIRED COMPONENTS
thread
date_time
filesystem
system
program_options
signals
serialization
chrono
unit_test_framework
context
locale
iostreams)

# Some new stdlibc++s will #error on <experimental/string_view>; a problem for boost pre-1.69
if( APPLE AND UNIX )
add_definitions(-DBOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)
endif()
add_definitions(-DBOOST_ASIO_DISABLE_STD_EXPERIMENTAL_STRING_VIEW)

if( WIN32 )

Expand Down Expand Up @@ -169,11 +159,11 @@ else( WIN32 ) # Apple AND Linux
if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring EOSIO on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-deprecated-declarations" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring EOSIO on Linux" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -Wall" )
if ( FULL_STATIC_BUILD )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
endif ( FULL_STATIC_BUILD )
Expand Down Expand Up @@ -262,27 +252,24 @@ install(FILES ${CMAKE_BINARY_DIR}/modules/eosio-config.cmake DESTINATION ${CMAKE
configure_file(${CMAKE_SOURCE_DIR}/CMakeModules/EosioTester.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/modules/EosioTester.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio)

configure_file(${CMAKE_SOURCE_DIR}/LICENSE
configure_file(${CMAKE_SOURCE_DIR}/LICENSE
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/wabt/LICENSE
configure_file(${CMAKE_SOURCE_DIR}/libraries/wabt/LICENSE
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.wabt COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/softfloat/COPYING.txt
configure_file(${CMAKE_SOURCE_DIR}/libraries/softfloat/COPYING.txt
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.softfloat COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/wasm-jit/LICENSE
configure_file(${CMAKE_SOURCE_DIR}/libraries/wasm-jit/LICENSE
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.wavm COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/secp256k1/upstream/COPYING
configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/secp256k1/upstream/COPYING
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.secp256k1 COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/src/network/LICENSE.go
configure_file(${CMAKE_SOURCE_DIR}/libraries/fc/src/network/LICENSE.go
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.go COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/externals/binaryen/LICENSE
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.binaryen COPYONLY)

install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/)
install(FILES libraries/wabt/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.wabt)
install(FILES libraries/softfloat/COPYING.txt DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.softfloat)
install(FILES libraries/wasm-jit/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.wavm)
install(FILES libraries/fc/secp256k1/upstream/COPYING DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.secp256k1)
install(FILES externals/binaryen/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.binaryen)
install(FILES libraries/fc/src/network/LICENSE.go DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ )

include(package)
Expand Down
10 changes: 5 additions & 5 deletions CMakeModules/package.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set(VENDOR "block.one")
set(PROJECT_NAME "eosio")
set(DESC "Software for the EOS.IO network")
set(URL "https://github.com/eosio/eos")
set(EMAIL "support@block.one")
set(VENDOR "BOS Core")
set(PROJECT_NAME "bos")
set(DESC "Software for the BOS network")
set(URL "https://github.com/boscore/bos")
set(EMAIL "support@boscore.io")

configure_file(${CMAKE_SOURCE_DIR}/scripts/generate_package.sh.in ${CMAKE_BINARY_DIR}/packages/generate_package.sh @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/scripts/generate_bottle.sh ${CMAKE_BINARY_DIR}/packages/generate_bottle.sh COPYONLY)
Expand Down
6 changes: 3 additions & 3 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM boscore/builder as builder
FROM boscore/builder:v2.0.4 as builder
ARG branch=master
ARG symbol=SYS

ENV OPENSSL_ROOT_DIR /usr/include/openssl

RUN git clone -b $branch https://github.com/boscore/bos.git --recursive \
&& cd bos && echo "$branch:$(git rev-parse HEAD)" > /etc/eosio-version \
&& cd bos && echo "$branch:$(git rev-parse HEAD)" > /etc/boscore-version \
&& cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/tmp/build -DBUILD_MONGO_DB_PLUGIN=true -DCORE_SYMBOL_NAME=$symbol \
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
Expand All @@ -22,4 +22,4 @@ COPY --from=builder /bos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh
ENV EOSIO_ROOT=/opt/eosio
RUN chmod +x /opt/eosio/bin/nodeosd.sh
ENV LD_LIBRARY_PATH /usr/local/lib
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
4 changes: 2 additions & 2 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd bos/Docker
docker build . -t boscore/bos -s BOS
```

The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v3.0.4 tag, you could do the following:
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v3.0.5 tag, you could do the following:

```bash
docker build -t boscore/bos:v3.0.4 --build-arg branch=v3.0.4 .
docker build -t boscore/bos:v3.0.5 --build-arg branch=v3.0.5 .

```

Expand Down
8 changes: 4 additions & 4 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ RUN wget https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh \
ENV CC clang
ENV CXX clang++

RUN wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.bz2 -O - | tar -xj \
&& cd boost_1_67_0 \
RUN wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2 -O - | tar -xj \
&& cd boost_1_71_0 \
&& ./bootstrap.sh --prefix=/usr/local \
&& echo 'using clang : 4.0 : clang++-4.0 ;' >> project-config.jam \
&& ./b2 -d0 -j$(nproc) --with-thread --with-date_time --with-system --with-filesystem --with-program_options \
--with-signals --with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine --with-iostreams toolset=clang link=static install \
&& cd .. && rm -rf boost_1_67_0
--with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine --with-iostreams toolset=clang link=static install \
&& cd .. && rm -rf boost_1_71_0

RUN wget https://github.com/mongodb/mongo-c-driver/releases/download/1.10.2/mongo-c-driver-1.10.2.tar.gz -O - | tar -xz \
&& cd mongo-c-driver-1.10.2 \
Expand Down
12 changes: 0 additions & 12 deletions Docker/config.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# the endpoint upon which to listen for incoming connections (eosio::bnet_plugin)
bnet-endpoint = 0.0.0.0:4321

# the number of threads to use to process network messages (eosio::bnet_plugin)
# bnet-threads =

# remote endpoint of other node to connect to; Use multiple bnet-connect options as needed to compose a network (eosio::bnet_plugin)
# bnet-connect =

# this peer will request no pending transactions from other nodes (eosio::bnet_plugin)
bnet-no-trx = false

# the location of the blocks directory (absolute path or relative to application data dir) (eosio::chain_plugin)
blocks-dir = "blocks"

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BOSCore - Born for DApps. Born for Usability.
# BOSCore - Using technology to create a trusted business ecosystem

## BOSCore Version: v3.0.4
### Basic EOSIO Version: v1.6.6 (support REX, part 1.8.x)
## BOSCore Version: v3.0.5
### Basic EOSIO Version: v1.6.6 (support REX, part 2.0.x)

# Background
The emergence of EOS has brought new imagination to the blockchain. In just a few months since the main network was launched, the version has undergone dozens of upgrades, not only the stability has been greatly improved, but also the new functions have been gradually realized. The node team is also actively involved in building the EOSIO ecosystem. What is even more exciting is that EOS has attracted more and more development teams. There are already hundreds of DApp running on the EOS main network. The transaction volume and circulation market value far exceed Ethereum, and the space for development is growing broader.
Expand Down
6 changes: 3 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BOSCore - 更可用的链,为DApp而生。
# BOSCore - 用技术打造可信商业生态

## BOSCore Version: v3.0.4
### Basic EOSIO Version: v1.6.6 (support REX, part 1.8.x)
## BOSCore Version: v3.0.5
### Basic EOSIO Version: v1.6.6 (support REX, part 2.0.x)

# 背景
EOS的出现给区块链带来了新的想象力,主网启动短短几个月以来,版本经历了几十次升级,不仅稳定性得到了很大提高,并且新功能也逐步实现,各个节点团队也积极参与建设EOSIO生态。让人更加兴奋的是,EOS已经吸引了越来越多的开发团队,当前已经有数百个DApp在EOS主网上面运行,其交易量和流通市值远超以太坊,可发展的空间愈来愈广阔。
Expand Down
16 changes: 8 additions & 8 deletions eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
;;
"elementary OS")
FILE="${SOURCE_DIR}/scripts/eosio_build_ubuntu.sh"
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
CXX_COMPILER=clang++
C_COMPILER=clang
MONGOD_CONF=${HOME}/opt/mongodb/mongod.conf
export PATH=${HOME}/opt/mongodb/bin:$PATH
;;
Expand All @@ -201,22 +201,22 @@
;;
"Linux Mint")
FILE="${SOURCE_DIR}/scripts/eosio_build_ubuntu.sh"
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
CXX_COMPILER=clang++
C_COMPILER=clang
MONGOD_CONF=${HOME}/opt/mongodb/mongod.conf
export PATH=${HOME}/opt/mongodb/bin:$PATH
;;
"Ubuntu")
FILE="${SOURCE_DIR}/scripts/eosio_build_ubuntu.sh"
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
CXX_COMPILER=clang++
C_COMPILER=clang
MONGOD_CONF=${HOME}/opt/mongodb/mongod.conf
export PATH=${HOME}/opt/mongodb/bin:$PATH
;;
"Debian GNU/Linux")
FILE=${SOURCE_DIR}/scripts/eosio_build_ubuntu.sh
CXX_COMPILER=clang++-4.0
C_COMPILER=clang-4.0
CXX_COMPILER=clang++
C_COMPILER=clang
MONGOD_CONF=${HOME}/opt/mongodb/mongod.conf
export PATH=${HOME}/opt/mongodb/bin:$PATH
;;
Expand Down
24 changes: 19 additions & 5 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ struct controller_impl {
template<typename Signal, typename Arg>
void emit( const Signal& s, Arg&& a ) {
try {
s(std::forward<Arg>(a));
s( std::forward<Arg>( a ));
} catch (std::bad_alloc& e) {
wlog( "std::bad_alloc" );
throw e;
} catch (boost::interprocess::bad_alloc& e) {
wlog( "bad alloc" );
throw e;
Expand Down Expand Up @@ -466,9 +469,6 @@ struct controller_impl {

~controller_impl() {
pending.reset();

db.flush();
reversible_blocks.flush();
}

void add_indices() {
Expand Down Expand Up @@ -671,7 +671,6 @@ struct controller_impl {
return enc.result();
}


/**
* Sets fork database head to the genesis state.
*/
Expand Down Expand Up @@ -1651,7 +1650,22 @@ struct controller_impl {
if (!pbft_enabled) return;

if ( pending_pbft_lib ) {
//this is a temp solution for getting current lib, should not use anywhere else;
auto current_lib = fork_db.get_block_in_current_chain_by_num(head->bft_irreversible_blocknum)->id;
fork_db.set_bft_irreversible(*pending_pbft_lib);
if (!replaying) {
auto libs_to_be_emitted = vector<block_state_ptr>{};
auto b = fork_db.get_block(*pending_pbft_lib);
while (b->id != current_lib) {
libs_to_be_emitted.emplace_back(b);
b = fork_db.get_block(b->prev());
}
while (!libs_to_be_emitted.empty()) {
emit( self.new_irreversible_block, libs_to_be_emitted.back() );
libs_to_be_emitted.pop_back();
}
}

pending_pbft_lib.reset();

if (!pending && read_mode != db_read_mode::IRREVERSIBLE) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/asset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ with amount = 10 and symbol(4,"CUR")
*/

struct asset
struct asset : fc::reflect_init
{
static constexpr int64_t max_amount = (1LL << 62) - 1;

Expand Down
2 changes: 0 additions & 2 deletions libraries/chain/include/eosio/chain/chain_id_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ namespace chain {

friend class eosio::net_plugin_impl;
friend struct eosio::handshake_message;

friend struct ::hello; // TODO: Rushed hack to support bnet_plugin. Need a better solution.
};

} } // namespace eosio::chain
Expand Down
1 change: 1 addition & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ namespace eosio { namespace chain {
signal<void(const block_state_ptr&)> accepted_block_header;
signal<void(const block_state_ptr&)> accepted_block;
signal<void(const block_state_ptr&)> irreversible_block;
signal<void(const block_state_ptr&)> new_irreversible_block;
signal<void(const transaction_metadata_ptr&)> accepted_transaction;
signal<void(const transaction_trace_ptr&)> applied_transaction;
signal<void(const header_confirmation&)> accepted_confirmation;
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/symbol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace eosio {
operator uint64_t()const { return value; }
};

class symbol {
class symbol : fc::reflect_init {
public:

static constexpr uint8_t max_precision = 18;
Expand Down
3 changes: 2 additions & 1 deletion libraries/chain/include/eosio/chain/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace eosio { namespace chain {
bool allow_duplicate_keys = false )const;
};

struct packed_transaction {
struct packed_transaction : fc::reflect_init {
enum compression_type {
none = 0,
zlib = 1,
Expand Down Expand Up @@ -158,6 +158,7 @@ namespace eosio { namespace chain {

friend struct fc::reflector<packed_transaction>;
friend struct fc::reflector_init_visitor<packed_transaction>;
friend struct fc::has_reflector_init<packed_transaction>;
void reflector_init();
private:
vector<signature_type> signatures;
Expand Down
Loading

0 comments on commit 09312ec

Please sign in to comment.