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

3.0.x #9

Merged
merged 53 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1f3eaeb
update cleos to support eosio.msig new actions
maodaishan May 9, 2019
04f7f93
Merge pull request #110 from boscore/release/3.0.x
Thaipanda Jun 29, 2019
c1387e4
Merge pull request #109 from boscore/release/3.0.x
Thaipanda Jun 29, 2019
36006e9
valid new view before emit
Jul 8, 2019
019f595
add necessary validations before trying to relay new view msgs; optim…
VincentOCL Jul 9, 2019
20e08db
optimise transit_to_new_view; optimise handle pbft messages;
Jul 11, 2019
f4c83c2
net_plugin revert.
Jul 12, 2019
8916700
Add: switch fork reserve prepare and fetch branch from function test …
Frank-AFN Jul 15, 2019
0209353
Refactor reserve prepare testcase and Add two times maybe switch fork…
Frank-AFN Jul 16, 2019
fa2072c
Merge pull request #115 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda Jul 16, 2019
f47911c
optimise for return value.
Jul 22, 2019
f975445
add Tips section into Readme
EOSBIXIN Jul 22, 2019
f6aa4e6
Merge branch 'develop' into release/3.0.x
Thaipanda Jul 22, 2019
c94fa01
Merge branch 'master' into release/3.0.x
Thaipanda Jul 22, 2019
e424ec9
Merge pull request #118 from boscore/release/3.0.x
Thaipanda Jul 22, 2019
ca45e59
Merge pull request #119 from boscore/release/3.0.x
Thaipanda Jul 22, 2019
d47f250
reset timer upon state transition; refactor code;
Jul 25, 2019
99d2ed7
add global object to control pbft behavior; optimise checkpoint logic
Jul 30, 2019
239f484
refactor pbft db persistence
Jul 31, 2019
dac6102
fix tests
Aug 1, 2019
82f00a8
reset view change timer when global timeout is changed.
Aug 15, 2019
2840317
reserve prepare only if my_prepare is on forks
Aug 16, 2019
6efb1a9
reserve prepare only if my_prepare is on forks
Aug 16, 2019
6717cf2
Modify reserve prepare test case
Frank-AFN Aug 19, 2019
889161d
Modify reserve prepare test case
Frank-AFN Aug 19, 2019
a4e89a2
dpos pbft optimise (#121)
oldcold Aug 20, 2019
08ec703
update version info
EOSBIXIN Aug 21, 2019
2680d27
fix issues 111
EOSBIXIN Aug 21, 2019
06fa0e9
Merge pull request #93 from maodaishan/feature_msig_oppose_abstain
Thaipanda Aug 21, 2019
fc3ac9b
Merge pull request #122 from boscore/develop
Thaipanda Aug 21, 2019
22bbfa0
adjust the dockerfile
EOSBIXIN Aug 23, 2019
b097d3e
avoid sending last prepare.
Aug 26, 2019
1b15193
Merge branch 'release/3.0.x' into feature/dpos-pbft-bos-optimise
oldcold Aug 28, 2019
79bf108
Merge pull request #123 from eosiosg/feature/dpos-pbft-bos-optimise
Thaipanda Aug 29, 2019
b24a643
Merge pull request #124 from boscore/release/3.0.x
Thaipanda Aug 29, 2019
5e2cecc
fix pbft cert generation and validation
Sep 17, 2019
4304c51
attempt to fix bad prepared cert
Sep 10, 2019
3144c18
fix longest fork threshold
Sep 18, 2019
3971da5
redo cert validation
Sep 18, 2019
2ce70d7
refactor validation, add comments
Sep 18, 2019
b1ea9fd
clean up longest fork validation
Sep 20, 2019
783ceb7
add watermark check
Sep 20, 2019
144b4a9
Fix pbft certifications (#127)
oldcold Sep 22, 2019
9a09576
prepare 3.0.3-rc1
EOSBIXIN Sep 22, 2019
fbee034
further fix on commit certs generation and validation
Sep 23, 2019
f918d83
Merge branch 'release/3.0.x' into fix-cert-gen
oldcold Sep 24, 2019
2e09750
fix finding max committed certs block num
Sep 25, 2019
e73c333
highest committed cert block id should be strictly equal to the one f…
Sep 25, 2019
6c8470d
merge EOSIO ##7979
EOSBIXIN Sep 25, 2019
91ba180
add missing file
Sep 25, 2019
cad626a
Merge pull request #128 from eosiosg/fix-cert-gen
Thaipanda Oct 3, 2019
4dd9005
PBFT validation fixes
EOSBIXIN Oct 3, 2019
f117534
Merge pull request #129 from boscore/release/3.0.x
Thaipanda Oct 4, 2019
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 3)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)
set(VERSION_PATCH 3)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
Expand Down
8 changes: 2 additions & 6 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,22 @@ 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 \
&& 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}" \
-DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DCMAKE_CXX_STANDARD_LIBRARIES="-lpthread" \
&& cmake --build /tmp/build --target install



FROM ubuntu:18.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/lib/* /usr/local/lib/
COPY --from=builder /tmp/build/bin /opt/eosio/bin
COPY --from=builder /tmp/build/contracts /contracts
COPY --from=builder /bos/Docker/config.ini /
COPY --from=builder /etc/eosio-version /etc
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.1 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.3 tag, you could do the following:

```bash
docker build -t boscore/bos:v3.0.1 --build-arg branch=v3.0.1 .
docker build -t boscore/bos:v3.0.3 --build-arg branch=v3.0.3 .

```

Expand Down
6 changes: 0 additions & 6 deletions Docker/nodeosd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ if [ -f '/opt/eosio/bin/data-dir/config.ini' ]; then
cp /config.ini /opt/eosio/bin/data-dir
fi

if [ -d '/opt/eosio/bin/data-dir/contracts' ]; then
echo
else
cp -r /contracts /opt/eosio/bin/data-dir
fi

while :; do
case $1 in
--config-dir=?*)
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BOSCore - Born for DApps. Born for Usability.

## BOSCore Version: v3.0.1
## BOSCore Version: v3.0.3
### Basic EOSIO Version: v1.6.6 (support REX)

# Background
Expand Down Expand Up @@ -29,6 +29,12 @@ As BOS continues to develop, developer rewards will be appropriately adjusted to
1. Build from code : `bash ./eosio_build.sh -s BOS`
2. Docker Style,check [Docker](./Docker/README.md)

## Tips:
- HTTP&P2P endpoints can be get from the [validator](https://validate.eosnation.io/bos/reports/endpoints.html) by EOS Nation
- BOS Mainnet [genesis.json](https://github.com/boscore/bosres/blob/master/genesis.json)
- BOS Mainnet [Genesis](https://github.com/boscore/bosres/blob/master/BOS_Genesis.md)
- EOS Mainnet [snapshot](https://github.com/boscore/bos-airdrop-snapshots/blob/master/README.md)

## BOSCore Workflow
BOSCore encourage community developer actively participate in contributing the code, members should follow the workflow below.
![BOSCore Workflow](./images/bos-workflow.png)
Expand Down
8 changes: 7 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BOSCore - 更可用的链,为DApp而生。

## BOSCore Version: v3.0.1
## BOSCore Version: v3.0.3
### Basic EOSIO Version: v1.6.6 (support REX)

# 背景
Expand Down Expand Up @@ -29,6 +29,12 @@ BOS链的代码完全由社区贡献并维护,每个生态参与者都可以
1. 源码直接编译: `bash ./eosio_build.sh -s BOS`
2. Docker方式部署,参看 [Docker](./Docker/README.md)

## Tips:
- HTTP&P2P 列表可以从 EOS Nation 提供的[验证页面](https://validate.eosnation.io/bos/reports/endpoints.html)获取
- BOS Mainnet [genesis.json](https://github.com/boscore/bosres/blob/master/genesis.json)
- BOS Mainnet [创世纪](https://github.com/boscore/bosres/blob/master/BOS_Genesis.md)
- EOS Mainnet [账户空投信息](https://github.com/boscore/bos-airdrop-snapshots/blob/master/README.md)

## BOSCore 开发流程
BOSCore 鼓励社区开发者参与代码贡献,社区成员应当遵循以下工作流:
![BOSCore Workflow](./images/bos-workflow.png)
Expand Down
1 change: 1 addition & 0 deletions eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
-DCMAKE_C_COMPILER="${C_COMPILER}" -DWASM_ROOT="${WASM_ROOT}" -DCORE_SYMBOL_NAME="${CORE_SYMBOL_NAME}" \
-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}"
then
printf "\\n\\t>>>>>>>>>>>>>>>>>>>> CMAKE building BOSCore has exited with the above error.\\n\\n"
Expand Down
5 changes: 5 additions & 0 deletions libraries/chain/chain_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ void chain_config2::validate() const{
EOS_ASSERT(std::numeric_limits<decltype(resource_greylist.size())>::max() > resource_greylist.size(), action_validate_exception, "Overflow in greylistwhen adding resource greylist!");
}

void chain_config3::validate() const{
EOS_ASSERT( view_change_timeout >= 1, action_validate_exception, "view change timeout must be at least 1");
EOS_ASSERT( pbft_checkpoint_granularity >= 100 && pbft_checkpoint_granularity % 100 == 0, action_validate_exception, "pbft checkpoint granularity must be multiple of 100 blocks");
}

} } // namespace eosio::chain
23 changes: 19 additions & 4 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ using controller_index_set = index_set<
global_property2_multi_index,
dynamic_global_property_multi_index,
upgrade_property_multi_index,
global_property3_multi_index,
block_summary_multi_index,
transaction_multi_index,
generated_transaction_multi_index,
Expand Down Expand Up @@ -455,6 +456,13 @@ struct controller_impl {
wlog("no upo found, generating...");
db.create<upgrade_property_object>([](auto&){});
}

try {
db.get<global_property3_object>();
} catch( const boost::exception& e) {
wlog("no gpo3 found, generating...");
db.create<global_property3_object>([](auto&){});
}
}

~controller_impl() {
Expand Down Expand Up @@ -746,6 +754,7 @@ struct controller_impl {

// *bos end*

db.create<global_property3_object>([](auto&) {});

authorization.initialize_database();
resource_limits.initialize_database();
Expand Down Expand Up @@ -2526,13 +2535,15 @@ void controller::set_pbft_my_prepare(const block_id_type& id) {
}

block_id_type controller::get_pbft_prepared() const {
if (my->pbft_prepared) return my->pbft_prepared->id;
return block_id_type{};
block_id_type pp;
if (my->pbft_prepared) pp = my->pbft_prepared->id;
return pp;
}

block_id_type controller::get_pbft_my_prepare() const {
if (my->my_prepare) return my->my_prepare->id;
return block_id_type{};
block_id_type mp;
if (my->my_prepare) mp = my->my_prepare->id;
return mp;
}

void controller::reset_pbft_my_prepare() {
Expand Down Expand Up @@ -2701,6 +2712,10 @@ const upgrade_property_object& controller::get_upgrade_properties()const {
return my->db.get<upgrade_property_object>();
}

const global_property3_object& controller::get_pbft_properties()const {
return my->db.get<global_property3_object>();
}

bool controller::is_pbft_enabled() const {
return my->pbft_enabled;
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ namespace eosio { namespace chain {
*
* This will require a search over all forks
*/
void fork_database::set_bft_irreversible( block_id_type id ) {
void fork_database::set_bft_irreversible( const block_id_type& id ) {
auto b = get_block( id );
EOS_ASSERT( b, fork_db_block_not_found, "unable to find block id ${id}", ("id",id));

Expand Down Expand Up @@ -569,7 +569,7 @@ namespace eosio { namespace chain {
my->head = *my->index.get<by_lib_block_num>().begin();
}

void fork_database::set_latest_checkpoint( block_id_type id) {
void fork_database::set_latest_checkpoint( const block_id_type& id) {
auto b = get_block( id );
EOS_ASSERT( b, fork_db_block_not_found, "unable to find block id ${id}", ("id",id));

Expand Down
10 changes: 10 additions & 0 deletions libraries/chain/include/eosio/chain/chain_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ struct chain_config2 {
void validate()const;
};

struct chain_config3 {

uint16_t view_change_timeout = 6; /// the actual wait time will be `num * 5`
uint16_t pbft_checkpoint_granularity = 100; /// the interval of normal checkpoints must be a multiple of 100 * n;

void validate()const;
};

// *bos*
struct guaranteed_minimum_resources {
uint64_t ram_byte;
Expand All @@ -140,3 +148,5 @@ FC_REFLECT(eosio::chain::chain_config,
// *bos*
FC_REFLECT( eosio::chain::chain_config2, (actor_blacklist)(contract_blacklist)(resource_greylist) )
FC_REFLECT( eosio::chain::guaranteed_minimum_resources, (ram_byte)(cpu_us)(net_byte) )

FC_REFLECT( eosio::chain::chain_config3, (view_change_timeout) )
4 changes: 3 additions & 1 deletion libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace eosio { namespace chain {
class global_property_object;
class global_property2_object; // *bos*
class upgrade_property_object;
class global_property3_object; // *bos*
class permission_object;
class account_object;
using resource_limits::resource_limits_manager;
Expand Down Expand Up @@ -305,7 +306,8 @@ namespace eosio { namespace chain {
signal<void(const header_confirmation&)> accepted_confirmation;
signal<void(const int&)> bad_alloc;

const upgrade_property_object& get_upgrade_properties()const;
const upgrade_property_object& get_upgrade_properties()const;
const global_property3_object& get_pbft_properties()const;
bool is_pbft_enabled()const;
bool under_maintenance()const;
void set_upo(uint32_t target_block_num);
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/include/eosio/chain/fork_database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ namespace eosio { namespace chain {
*/
signal<void(block_state_ptr)> irreversible;

void set_bft_irreversible( block_id_type id );
void set_bft_irreversible( const block_id_type& id );

void set_latest_checkpoint( block_id_type id);
void set_latest_checkpoint( const block_id_type& id);

void mark_pbft_prepared_fork(const block_state_ptr& h);

Expand Down
23 changes: 22 additions & 1 deletion libraries/chain/include/eosio/chain/global_property_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ namespace eosio { namespace chain {
block_num_type upgrade_complete_block_num = 0;
};

class global_property3_object : public chainbase::object<global_property3_object_type, global_property3_object>
{
OBJECT_CTOR(global_property3_object)

id_type id;
chain_config3 configuration;
};


/**
* @class dynamic_global_property_object
Expand Down Expand Up @@ -108,6 +116,15 @@ namespace eosio { namespace chain {
>
>
>;

using global_property3_multi_index = chainbase::shared_multi_index_container<
global_property3_object,
indexed_by<
ordered_unique<tag<by_id>,
BOOST_MULTI_INDEX_MEMBER(global_property3_object, global_property3_object::id_type, id)
>
>
>;
}}

CHAINBASE_SET_INDEX_TYPE(eosio::chain::global_property_object, eosio::chain::global_property_multi_index)
Expand All @@ -116,6 +133,7 @@ CHAINBASE_SET_INDEX_TYPE(eosio::chain::dynamic_global_property_object,
// *bos*
CHAINBASE_SET_INDEX_TYPE(eosio::chain::global_property2_object, eosio::chain::global_property2_multi_index)
CHAINBASE_SET_INDEX_TYPE(eosio::chain::upgrade_property_object, eosio::chain::upgrade_property_multi_index)
CHAINBASE_SET_INDEX_TYPE(eosio::chain::global_property3_object, eosio::chain::global_property3_multi_index)

FC_REFLECT(eosio::chain::dynamic_global_property_object,
(global_action_sequence)
Expand All @@ -130,4 +148,7 @@ FC_REFLECT(eosio::chain::global_property2_object,
)
FC_REFLECT(eosio::chain::upgrade_property_object,
(upgrade_target_block_num)(upgrade_complete_block_num)
)
)
FC_REFLECT(eosio::chain::global_property3_object,
(configuration)
)
Loading