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 for v3.0.3 #129

Merged
merged 17 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 2)
set(VERSION_PATCH 3)

if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
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.2 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.2 --build-arg branch=v3.0.2 .
docker build -t boscore/bos:v3.0.3 --build-arg branch=v3.0.3 .

```

Expand Down
2 changes: 1 addition & 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.2
## BOSCore Version: v3.0.3
### Basic EOSIO Version: v1.6.6 (support REX)

# Background
Expand Down
2 changes: 1 addition & 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.2
## BOSCore Version: v3.0.3
### Basic EOSIO Version: v1.6.6 (support REX)

# 背景
Expand Down
42 changes: 36 additions & 6 deletions libraries/chain/include/eosio/chain/pbft_database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,19 @@ namespace eosio {
bool is_stable = false;
};

using producer_and_block_info = std::pair<public_key_type, block_info_type>;

struct validation_state {
block_id_type block_id;
block_num_type block_num = 0;
vector<public_key_type> producers;
bool enough = false;
};

using pbft_state_ptr = std::shared_ptr<pbft_state>;
using pbft_view_change_state_ptr = std::shared_ptr<pbft_view_change_state>;
using pbft_checkpoint_state_ptr = std::shared_ptr<pbft_checkpoint_state>;
using validation_state_ptr = std::shared_ptr<validation_state>;

struct by_block_id;
struct by_num;
Expand Down Expand Up @@ -414,6 +424,28 @@ namespace eosio {
>
> pbft_checkpoint_state_multi_index_type;

struct by_block_id;
struct by_status_and_num;
typedef multi_index_container<
validation_state_ptr,
indexed_by<
hashed_unique <
tag<by_block_id>,
member<validation_state, block_id_type, &validation_state::block_id>,
std::hash<block_id_type>
>,
ordered_non_unique<
tag<by_status_and_num>,
composite_key<
validation_state,
member<validation_state, bool, &validation_state::enough>,
member<validation_state, uint32_t, &validation_state::block_num>
>,
composite_key_compare< greater<>, greater<> >
>
>
> local_state_multi_index_type;

class pbft_database {
public:
explicit pbft_database(controller& ctrl);
Expand Down Expand Up @@ -502,17 +534,14 @@ namespace eosio {
block_info_type cal_pending_stable_checkpoint() const;
bool is_less_than_high_watermark(block_num_type bnum);
bool is_valid_prepared_certificate(const pbft_prepared_certificate& certificate, bool add_to_pbft_db = false);
bool is_valid_committed_certificate(const pbft_committed_certificate& certificate, bool add_to_pbft_db = false);
bool is_valid_longest_fork(const block_info_type& bi, fork_info_type& block_infos, unsigned long threshold, unsigned long non_fork_bp_count);
bool is_valid_committed_certificate(const pbft_committed_certificate& certificate, bool add_to_pbft_db = false, bool at_the_top = false);
bool is_valid_longest_fork(const vector<producer_and_block_info>& producers, const block_info_type& cert_info, bool at_the_top = false);

producer_schedule_type lscb_active_producers() const;
vector<block_num_type>& get_updated_watermarks();
flat_map<public_key_type, uint32_t>& get_updated_fork_schedules();
block_num_type get_current_pbft_watermark();

vector<fork_info_type> fetch_fork_from(fork_info_type& block_infos);
fork_info_type fetch_first_fork_from(fork_info_type& bi);

void set(const pbft_state_ptr& s);
void set(const pbft_checkpoint_state_ptr& s);
void prune(const pbft_state_ptr& h);
Expand Down Expand Up @@ -542,4 +571,5 @@ FC_REFLECT(eosio::chain::pbft_stable_checkpoint, (block_info)(checkpoints))

FC_REFLECT(eosio::chain::pbft_state, (block_id)(block_num)(prepares)(is_prepared)(commits)(is_committed))
FC_REFLECT(eosio::chain::pbft_view_change_state, (view)(view_changes)(is_view_changed))
FC_REFLECT(eosio::chain::pbft_checkpoint_state, (block_id)(block_num)(checkpoints)(is_stable))
FC_REFLECT(eosio::chain::pbft_checkpoint_state, (block_id)(block_num)(checkpoints)(is_stable))
FC_REFLECT(eosio::chain::validation_state, (block_id)(block_num)(producers)(enough))
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ namespace eosio { namespace chain { namespace wasm_injections {
struct post_op_injectors : wasm_ops::op_types<pass_injector> {
using loop_t = wasm_ops::loop <checktime_injection>;
using call_t = wasm_ops::call <fix_call_index>;
using grow_memory_t = wasm_ops::grow_memory <checktime_injection>;
};

template <typename ... Visitors>
Expand Down
Loading