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

pddate tps plugin and bugfix #97

Merged
merged 20 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4f4ef31
bugfix: fork_db migration incorrect pos align
qianxiaofeng May 7, 2019
6a24939
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 7, 2019
a8b5875
bug fix: return default block id when trying to fetch block num 0; up…
VincentOCL May 8, 2019
720b617
add migration log
qianxiaofeng May 8, 2019
e1a52bd
improve: change algorithm in LIB upgrade fork database migration, hug…
qianxiaofeng May 8, 2019
79ee901
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
qianxiaofeng May 8, 2019
27e4177
use schedule in ucb when there is no stable checkpoint.
VincentOCL May 8, 2019
5184306
update snapshot migration logic to reflect struct change in block hea…
qianxiaofeng May 10, 2019
ddc3e61
add forkdb block states into snapshot after pbft is enabled; fix repl…
VincentOCL May 10, 2019
899ee7a
change block producing log
VincentOCL May 11, 2019
4c677e0
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng May 11, 2019
e2a0abf
update tps plugin, now tps trx support symbol BOS and cal cpu/net bill
qianxiaofeng May 13, 2019
c6e44f3
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 13, 2019
eb964cb
fix a potential crash during commit cert generation.
VincentOCL May 13, 2019
2c2ddd7
fix typo.
VincentOCL May 13, 2019
8b8c9b3
Merge remote-tracking branch 'origin/feature/dpos-pbft-bos-upgrade' i…
VincentOCL May 13, 2019
f9e86b1
Merge branch 'develop' into feature/dpos-pbft-bos-upgrade
qianxiaofeng May 13, 2019
3edf744
update readme in txn generator plugin
qianxiaofeng May 13, 2019
3264995
Merge branch 'feature/dpos-pbft-bos-upgrade' of https://github.com/eo…
qianxiaofeng May 13, 2019
9ee66b4
Merge pull request #96 from eosiosg/feature/dpos-pbft-bos-upgrade
Thaipanda May 13, 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
20 changes: 10 additions & 10 deletions libraries/chain/include/eosio/chain/pbft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,45 +56,45 @@ namespace eosio {

const vector<pbft_prepare> &get_prepares_cache() const;

void set_prepares_cache(const vector<pbft_prepare> &prepares_cache);
void set_prepares_cache(const vector<pbft_prepare> &pcache);

const vector<pbft_commit> &get_commits_cache() const;

void set_commits_cache(const vector<pbft_commit> &commits_cache);
void set_commits_cache(const vector<pbft_commit> &ccache);

const vector<pbft_view_change> &get_view_changes_cache() const;

void set_view_changes_cache(const vector<pbft_view_change> &view_changes_cache);
void set_view_changes_cache(const vector<pbft_view_change> &vc_cache);

const uint32_t &get_current_view() const;

void set_current_view(const uint32_t &cv);

const vector<pbft_prepared_certificate> &get_prepared_certificate() const;

void set_prepared_certificate(const vector<pbft_prepared_certificate> &prepared_certificate);
void set_prepared_certificate(const vector<pbft_prepared_certificate> &pcert);

const vector<vector<pbft_committed_certificate>> &get_committed_certificate() const;

void set_committed_certificate(const vector<vector<pbft_committed_certificate>> &pbft_committed_certificate_vector);
void set_committed_certificate(const vector<vector<pbft_committed_certificate>> &ccert);

const vector<pbft_view_changed_certificate> &get_view_changed_certificate() const;

void set_view_changed_certificate(const vector<pbft_view_changed_certificate> &view_changed_certificate);
void set_view_changed_certificate(const vector<pbft_view_changed_certificate> &vc_cert);

const uint32_t &get_target_view_retries() const;

void set_target_view_retries(const uint32_t &target_view_reties);
void set_target_view_retries(const uint32_t &tv_reties);

const uint32_t &get_target_view() const;

void set_target_view(const uint32_t &target_view);
void set_target_view(const uint32_t &tv);

const uint32_t &get_view_change_timer() const;

void set_view_change_timer(const uint32_t &view_change_timer);
void set_view_change_timer(const uint32_t &vc_timer);

void manually_set_current_view(const uint32_t &current_view);
void manually_set_current_view(const uint32_t &cv);

protected:
psm_cache cache;
Expand Down
40 changes: 20 additions & 20 deletions libraries/chain/pbft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ namespace eosio {
current->on_new_view(this, e, pbft_db);
}

void psm_machine::manually_set_current_view(const uint32_t &current_view) {
current->manually_set_view(this, current_view);
void psm_machine::manually_set_current_view(const uint32_t &cv) {
current->manually_set_view(this, cv);
}

/**
Expand Down Expand Up @@ -575,24 +575,24 @@ namespace eosio {
return this->cache.prepares_cache;
}

void psm_machine::set_prepares_cache(const vector<pbft_prepare> &prepares_cache) {
this->cache.prepares_cache = prepares_cache;
void psm_machine::set_prepares_cache(const vector<pbft_prepare> &pcache) {
this->cache.prepares_cache = pcache;
}

const vector<pbft_commit> &psm_machine::get_commits_cache() const {
return this->cache.commits_cache;
}

void psm_machine::set_commits_cache(const vector<pbft_commit> &commits_cache) {
this->cache.commits_cache = commits_cache;
void psm_machine::set_commits_cache(const vector<pbft_commit> &ccache) {
this->cache.commits_cache = ccache;
}

const vector<pbft_view_change> &psm_machine::get_view_changes_cache() const {
return this->cache.view_changes_cache;
}

void psm_machine::set_view_changes_cache(const vector<pbft_view_change> &view_changes_cache) {
this->cache.view_changes_cache = view_changes_cache;
void psm_machine::set_view_changes_cache(const vector<pbft_view_change> &vc_cache) {
this->cache.view_changes_cache = vc_cache;
}

const uint32_t &psm_machine::get_current_view() const {
Expand All @@ -607,49 +607,49 @@ namespace eosio {
return this->cache.prepared_certificate;
}

void psm_machine::set_prepared_certificate(const vector<pbft_prepared_certificate> &prepared_certificate) {
this->cache.prepared_certificate = prepared_certificate;
void psm_machine::set_prepared_certificate(const vector<pbft_prepared_certificate> &pcert) {
this->cache.prepared_certificate = pcert;
}

const vector<vector<pbft_committed_certificate>> &psm_machine::get_committed_certificate() const {
return this->cache.committed_certificate;
}

void psm_machine::set_committed_certificate(const vector<vector<pbft_committed_certificate>> &pbft_committed_certificate_vector) {
this->cache.committed_certificate = pbft_committed_certificate_vector;
void psm_machine::set_committed_certificate(const vector<vector<pbft_committed_certificate>> &ccert) {
this->cache.committed_certificate = ccert;
}

const vector<pbft_view_changed_certificate> &psm_machine::get_view_changed_certificate() const {
return this->cache.view_changed_certificate;
}

void psm_machine::set_view_changed_certificate(
const vector<pbft_view_changed_certificate> &view_changed_certificate) {
this->cache.view_changed_certificate = view_changed_certificate;
const vector<pbft_view_changed_certificate> &vc_cert) {
this->cache.view_changed_certificate = vc_cert;
}

const uint32_t &psm_machine::get_target_view_retries() const {
return this->target_view_retries;
}

void psm_machine::set_target_view_retries(const uint32_t &target_view_reties) {
this->target_view_retries = target_view_reties;
void psm_machine::set_target_view_retries(const uint32_t &tv_reties) {
this->target_view_retries = tv_reties;
}

const uint32_t &psm_machine::get_target_view() const {
return this->target_view;
}

void psm_machine::set_target_view(const uint32_t &target_view) {
this->target_view = target_view;
void psm_machine::set_target_view(const uint32_t &tv) {
this->target_view = tv;
}

const uint32_t &psm_machine::get_view_change_timer() const {
return this->view_change_timer;
}

void psm_machine::set_view_change_timer(const uint32_t &view_change_timer) {
this->view_change_timer = view_change_timer;
void psm_machine::set_view_change_timer(const uint32_t &vc_timer) {
this->view_change_timer = vc_timer;
}
}
}
6 changes: 4 additions & 2 deletions libraries/chain/pbft_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,11 @@ namespace eosio {
pcc.resize(ctrl.my_signature_providers().size());
const auto &by_commit_and_num_index = pbft_state_index.get<by_commit_and_num>();
auto itr = by_commit_and_num_index.begin();
if (itr == by_commit_and_num_index.end()) return vector<vector<pbft_committed_certificate>>{};

pbft_state_ptr psp = *itr;
if (itr == by_commit_and_num_index.end() || !psp->should_committed) return vector<vector<pbft_committed_certificate>>{};

if (!psp->should_committed) return vector<vector<pbft_committed_certificate>>{};

auto highest_committed_block_num = psp->block_num;

Expand Down Expand Up @@ -1200,7 +1202,7 @@ namespace eosio {
}

if (!pending_checkpoint_block_num.empty()) {
std::sort(pending_checkpoint_block_num.begin(), pending_checkpoint_block_num.begin());
std::sort(pending_checkpoint_block_num.begin(), pending_checkpoint_block_num.end());
for (auto h: pending_checkpoint_block_num) {
for (auto const &my_sp : ctrl.my_signature_providers()) {
auto uuid = boost::uuids::to_string(uuid_generator());
Expand Down
2 changes: 1 addition & 1 deletion plugins/txn_test_gen_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ add_library( txn_test_gen_plugin

add_dependencies(txn_test_gen_plugin eosio.token)

target_link_libraries( txn_test_gen_plugin appbase fc http_plugin chain_plugin )
target_link_libraries( txn_test_gen_plugin appbase fc http_plugin chain_plugin net_plugin)
target_include_directories( txn_test_gen_plugin PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
target_include_directories( txn_test_gen_plugin PUBLIC ${CMAKE_BINARY_DIR}/contracts )
22 changes: 21 additions & 1 deletion plugins/txn_test_gen_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,28 @@ $ ./cleos set contract eosio ~/eos/build.release/contracts/eosio.bios/

### Initialize the accounts txn_test_gen_plugin uses
```bash
$ curl --data-binary '["eosio", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]' http://127.0.0.1:8888/v1/txn_test_gen/create_test_accounts
$ curl --data-binary '[<creator>, <creator's private key>, <core_symbol>]' http://127.0.0.1:8888/v1/txn_test_gen/create_test_accounts

example:
$ curl --data-binary '["eosio", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3", "EOS"]' http://127.0.0.1:8888/v1/txn_test_gen/create_test_accounts
```
> **make sure there are more than 4000,0000 <core_symbol>** in creator


This api does:
1. creates following accounts:
aaaaaaaaaaaa
bbbbbbbbbbbb
cccccccccccc

1. delegate 1000,0000 cpu, 100 net, and 100 ram to above accounts using <creator>
1. deploy a token contract to account cccccccccccc and issue a large number of tokens to cccccccccccc, then transfer some tokens to aaaaaaaaaaaa and bbbbbbbbbbbb
1. subsequent trx will be generated using deployed token contract
1. aaaaaaaaaaaa transfer to bbbbbbbbbbbb
1. bbbbbbbbbbbb transfer to aaaaaaaaaaaa




### Start transaction generation, this will submit 20 transactions evey 20ms (total of 1000TPS)
```bash
Expand Down
Loading