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

prepare v3.0.7 version #155

Merged
merged 13 commits into from
Apr 27, 2020
Merged
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@
[submodule "libraries/wabt"]
path = libraries/wabt
url = https://github.com/EOSIO/wabt
[submodule "libraries/eos-vm"]
path = libraries/eos-vm
url = https://github.com/eosio/eos-vm
25 changes: 24 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 6)
set(VERSION_PATCH 7)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand Down Expand Up @@ -90,6 +90,26 @@ endif()
# * definition EOSIO_<RUNTIME>_RUNTIME_ENABLED defined in public libchain interface
# * ctest entries with --runtime
list(APPEND EOSIO_WASM_RUNTIMES wabt) #always enable wabt; it works everywhere and parts of eosio still assume it's always available
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
list(APPEND EOSIO_WASM_RUNTIMES wavm)
# WAVM requires LLVM, but move the check up here to a central location so that the EosioTester.cmakes
# can be created with the exact version found
find_package(LLVM REQUIRED CONFIG)
if(LLVM_VERSION_MAJOR VERSION_LESS 7 OR LLVM_VERSION_MAJOR VERSION_GREATER 9)
message(FATAL_ERROR "EOSIO requires an LLVM version 7.0 to 9.0")
endif()

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
list(APPEND EOSIO_WASM_RUNTIMES eos-vm-oc)
endif()
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32)
list(APPEND EOSIO_WASM_RUNTIMES eos-vm)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
list(APPEND EOSIO_WASM_RUNTIMES eos-vm-jit)
endif()
endif()

if(UNIX)
if(APPLE)
Expand Down Expand Up @@ -266,13 +286,16 @@ 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
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.go COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/libraries/eos-vm/LICENSE
${CMAKE_BINARY_DIR}/licenses/eosio/LICENSE.eos-vm 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 libraries/fc/src/network/LICENSE.go DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ )
install(FILES libraries/eos-vm/LICENSE DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/licenses/eosio/ RENAME LICENSE.eos-vm COMPONENT base)

include(package)
include(doxygen)
4 changes: 2 additions & 2 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM boscore/builder:v2.0.4 as builder
FROM boscore/builder:v2.0.6 as builder
ARG branch=master
ARG symbol=EOS

Expand All @@ -8,7 +8,7 @@ RUN git clone -b $branch https://github.com/boscore/bos.git --recursive \
&& 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" \
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" -DENABLE_TOOLS=OFF \
&& cmake --build /tmp/build --target install

FROM ubuntu:18.04
Expand Down
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.6 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.7 tag, you could do the following:

```bash
docker build -t boscore/bos:v3.0.6 --build-arg branch=v3.0.6 .
docker build -t boscore/bos:v3.0.7 --build-arg branch=v3.0.7 .

```

Expand Down
30 changes: 17 additions & 13 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

FROM ubuntu:18.04

LABEL author="xiaobo <[email protected]>" maintainer="Xiaobo <[email protected]> Huang-Ming Huang <[email protected]> Winlin <[email protected]>" version="0.1.2" \
Expand All @@ -8,16 +9,19 @@ RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y sudo wget curl net-tools ca-certificates unzip gnupg

RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/apt/sources.list.d/llvm.list \
RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main" >> /etc/apt/sources.list.d/llvm.list \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool build-essential pkg-config libtool \
mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev libssl-dev libgmp-dev \
clang-7 lld-4.0 llvm-7-dev libclang-4.0-dev ninja-build libusb-1.0-0-dev curl libcurl4-gnutls-dev \
mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev libssl-dev libgmp-dev doxygen graphviz libgmp3-dev \
ninja-build libusb-1.0-0-dev curl libcurl4-gnutls-dev autotools-dev ruby \
clang-9 lldb-9 lld-9 libllvm-9-ocaml-dev libllvm9 llvm-9 llvm-9-dev llvm-9-doc llvm-9-examples llvm-9-runtime clang-9 clang-tools-9 \
clang-9-doc libclang-common-9-dev libclang-9-dev libclang1-9 clang-format-9 python-clang-9 clangd-9 libfuzzer-9-dev lldb-9 lld-9 \
libc++-9-dev libc++abi-9-dev libomp-9-dev \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-7/bin/clang 700 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-7/bin/clang++ 700
RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-9/bin/clang 900 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-9/bin/clang++ 900

RUN wget https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh \
&& bash cmake-3.9.6-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license \
Expand All @@ -29,7 +33,7 @@ ENV CXX clang++
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 : 7 : clang++-7 ;' >> project-config.jam \
&& echo 'using clang : 9 : clang++-9 ;' >> project-config.jam \
&& ./b2 -d0 -j$(nproc) --with-thread --with-date_time --with-system --with-filesystem --with-program_options \
--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
Expand All @@ -43,12 +47,12 @@ RUN wget https://github.com/mongodb/mongo-c-driver/releases/download/1.10.2/mong
&& make install \
&& cd ../../ && rm -rf mongo-c-driver-1.10.2

RUN git clone --depth 1 --single-branch --branch release_70 https://github.com/llvm-mirror/llvm.git \
&& git clone --depth 1 --single-branch --branch release_70 https://github.com/llvm-mirror/clang.git llvm/tools/clang \
&& cd llvm \
&& cmake -H. -Bbuild -GNinja -DCMAKE_INSTALL_PREFIX=/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --target install \
&& cd .. && rm -rf llvm
# RUN git clone --depth 1 --single-branch --branch release_90 https://github.com/llvm-mirror/llvm.git \
# && git clone --depth 1 --single-branch --branch release_90 https://github.com/llvm-mirror/clang.git llvm/tools/clang \
# && cd llvm \
# && cmake -H. -Bbuild -GNinja -DCMAKE_INSTALL_PREFIX=/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release \
# && cmake --build build --target install \
# && cd .. && rm -rf llvm

RUN git clone --depth 1 -b releases/v3.3 https://github.com/mongodb/mongo-cxx-driver \
&& cd mongo-cxx-driver/build \
Expand All @@ -70,4 +74,4 @@ RUN git clone --depth 1 -b 0.2 https://github.com/boscore/cppkafka.git \
&& mkdir build && cd build \
&& cmake -DCPPKAFKA_RDKAFKA_STATIC_LIB=1 -DCPPKAFKA_BUILD_SHARED=0 .. \
&& make install \
&& cd ../../ && rm -rf cppkafka
&& cd ../../ && rm -rf cppkafka
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BOSCore - Blockchain financial center building a trusted business ecosystem.

## BOSCore Version: v3.0.6
### Basic EOSIO Version: v1.6.6 (support REX, part 2.0.x)
## BOSCore Version: v3.0.7
### Basic EOSIO Version: v1.6.6 (support REX & EOSVM, 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
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BOSCore - 区块链自由港,构建可信商业生态。

## BOSCore Version: v3.0.6
### Basic EOSIO Version: v1.6.6 (support REX, part 2.0.x)
## BOSCore Version: v3.0.7
### Basic EOSIO Version: v1.6.6 (support REX & EOSVM, part 2.0.x)

# 背景
EOS的出现给区块链带来了新的想象力,主网启动短短几个月以来,版本经历了几十次升级,不仅稳定性得到了很大提高,并且新功能也逐步实现,各个节点团队也积极参与建设EOSIO生态。让人更加兴奋的是,EOS已经吸引了越来越多的开发团队,当前已经有数百个DApp在EOS主网上面运行,其交易量和流通市值远超以太坊,可发展的空间愈来愈广阔。
Expand Down
3 changes: 2 additions & 1 deletion eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DBUILD_MONGO_DB_PLUGIN=true \
-DENABLE_COVERAGE_TESTING="${ENABLE_COVERAGE_TESTING}" -DBUILD_DOXYGEN="${DOXYGEN}" \
-DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
-DCMAKE_INSTALL_PREFIX="/usr/local/eosio" ${LOCAL_CMAKE_FLAGS} "${SOURCE_DIR}"
-DCMAKE_INSTALL_PREFIX="/usr/local/eosio" ${LOCAL_CMAKE_FLAGS} "${SOURCE_DIR}" \
-DENABLE_TOOLS=OFF
then
printf "\\n\\t>>>>>>>>>>>>>>>>>>>> CMAKE building BOSCore has exited with the above error.\\n\\n"
exit -1
Expand Down
3 changes: 3 additions & 0 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ set(BUILD_TOOLS OFF CACHE BOOL "Build wabt tools")
set(RUN_RE2C OFF CACHE BOOL "Run re2c")
set(WITH_EXCEPTIONS ON CACHE BOOL "Build with exceptions enabled" FORCE)
add_subdirectory( wabt )
if(eos-vm IN_LIST EOSIO_WASM_RUNTIMES OR eos-vm-jit IN_LIST EOSIO_WASM_RUNTIMES)
add_subdirectory( eos-vm )
endif()
4 changes: 4 additions & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ foreach(RUNTIME ${EOSIO_WASM_RUNTIMES})
target_compile_definitions(eosio_chain PUBLIC "EOSIO_${RUNTIMEUC}_RUNTIME_ENABLED")
endforeach()

if(EOSVMOC_ENABLE_DEVELOPER_OPTIONS)
message(WARNING "EOS VM OC Developer Options are enabled; these are NOT supported")
target_compile_definitions(eosio_chain PUBLIC EOSIO_EOS_VM_OC_DEVELOPER)
endif()

install( TARGETS eosio_chain
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
Expand Down
18 changes: 13 additions & 5 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ struct controller_impl {
map< account_name, map<handler_key, apply_handler> > apply_handlers;
platform_timer timer;

#if defined(EOSIO_EOS_VM_RUNTIME_ENABLED) || defined(EOSIO_EOS_VM_JIT_RUNTIME_ENABLED)
vm::wasm_allocator wasm_alloc;
#endif

/**
* Transactions that were undone by pop_block or abort_block, transactions
* are removed from this list if they are re-applied in other blocks. Producers
Expand Down Expand Up @@ -199,7 +203,7 @@ struct controller_impl {
cfg.reversible_cache_size ),
blog( cfg.blocks_dir ),
fork_db( cfg.state_dir ),
wasmif( cfg.wasm_runtime, db ),
wasmif( cfg.wasm_runtime, cfg.eosvmoc_tierup, db, cfg.state_dir, cfg.eosvmoc_config ),
resource_limits( db ),
authorization( s, db ),
conf( cfg ),
Expand Down Expand Up @@ -244,10 +248,7 @@ struct controller_impl {
template<typename Signal, typename Arg>
void emit( const Signal& s, Arg&& a ) {
try {
s( std::forward<Arg>( a ));
} catch (std::bad_alloc& e) {
wlog( "std::bad_alloc" );
throw e;
s(std::forward<Arg>(a));
} catch (boost::interprocess::bad_alloc& e) {
wlog( "bad alloc" );
throw e;
Expand Down Expand Up @@ -767,6 +768,7 @@ struct controller_impl {
return enc.result();
}


/**
* Sets fork database head to the genesis state.
*/
Expand Down Expand Up @@ -2857,4 +2859,10 @@ void controller::set_upo(uint32_t target_block_num) {
}
}

#if defined(EOSIO_EOS_VM_RUNTIME_ENABLED) || defined(EOSIO_EOS_VM_JIT_RUNTIME_ENABLED)
vm::wasm_allocator& controller::get_wasm_allocator() {
return my->wasm_alloc;
}
#endif

} } /// eosio::chain
7 changes: 7 additions & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <eosio/chain/abi_serializer.hpp>
#include <eosio/chain/account_object.hpp>
#include <eosio/chain/snapshot.hpp>
#include <eosio/chain/webassembly/eos-vm-oc/config.hpp>

namespace chainbase {
class database;
Expand Down Expand Up @@ -98,6 +99,9 @@ namespace eosio { namespace chain {

genesis_state genesis;
wasm_interface::vm_type wasm_runtime = chain::config::default_wasm_runtime;
eosvmoc::config eosvmoc_config;
bool eosvmoc_tierup = false;


db_read_mode read_mode = db_read_mode::SPECULATIVE;
validation_mode block_validation_mode = validation_mode::FULL;
Expand Down Expand Up @@ -296,6 +300,9 @@ namespace eosio { namespace chain {
void reset_pbft_my_prepare();
void reset_pbft_prepared();
void maybe_switch_forks();
#if defined(EOSIO_EOS_VM_RUNTIME_ENABLED) || defined(EOSIO_EOS_VM_JIT_RUNTIME_ENABLED)
vm::wasm_allocator& get_wasm_allocator();
#endif

signal<void(const signed_block_ptr&)> pre_accepted_block;
signal<void(const block_state_ptr&)> accepted_block_header;
Expand Down
14 changes: 11 additions & 3 deletions libraries/chain/include/eosio/chain/wasm_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#include <eosio/chain/types.hpp>
#include <eosio/chain/whitelisted_intrinsics.hpp>
#include <eosio/chain/exceptions.hpp>
#if defined(EOSIO_EOS_VM_RUNTIME_ENABLED) || defined(EOSIO_EOS_VM_JIT_RUNTIME_ENABLED)
#include <eosio/vm/allocator.hpp>
#endif
#include "Runtime/Linker.h"
#include "Runtime/Runtime.h"

Expand All @@ -10,6 +13,8 @@ namespace eosio { namespace chain {
class apply_context;
class wasm_runtime_interface;
class controller;
namespace eosvmoc { struct config; }

struct wasm_exit {
int32_t code = 0;
};
Expand Down Expand Up @@ -71,10 +76,13 @@ namespace eosio { namespace chain {
public:
enum class vm_type {
wavm,
wabt
wabt,
eos_vm,
eos_vm_jit,
eos_vm_oc
};

wasm_interface(vm_type vm, const chainbase::database& d);
wasm_interface(vm_type vm, bool eosvmoc_tierup, const chainbase::database& d, const boost::filesystem::path data_dir, const eosvmoc::config& eosvmoc_config);
~wasm_interface();

//call before dtor to skip what can be minutes of dtor overhead with some runtimes; can cause leaks
Expand Down Expand Up @@ -106,4 +114,4 @@ namespace eosio{ namespace chain {
std::istream& operator>>(std::istream& in, wasm_interface::vm_type& runtime);
}}

FC_REFLECT_ENUM( eosio::chain::wasm_interface::vm_type, (wavm)(wabt) )
FC_REFLECT_ENUM( eosio::chain::wasm_interface::vm_type, (wavm)(wabt)(eos_vm)(eos_vm_jit)(eos_vm_oc) )
Loading