From 88e5db9c041480bd04015bf4666ff623b527cdb8 Mon Sep 17 00:00:00 2001 From: Jerry <1032246642@qq.com> Date: Tue, 11 Sep 2018 17:32:05 +0800 Subject: [PATCH 1/4] avoid plugin through irreversible_block signal change block, so that apply_block faild. andkeep signal according to the order of accepted_transaction, applied_transaction and irreversible_block. --- libraries/chain/controller.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index b6f461af984..ce3a6a47b02 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -1027,13 +1027,15 @@ struct controller_impl { bool trust = !conf.force_all_checks && (s == controller::block_status::irreversible || s == controller::block_status::validated); auto new_header_state = fork_db.add( b, trust ); emit( self.accepted_block_header, new_header_state ); - // on replay irreversible is not emitted by fork database, so emit it explicitly here - if( s == controller::block_status::irreversible ) - emit( self.irreversible_block, new_header_state ); if ( read_mode != db_read_mode::IRREVERSIBLE ) { maybe_switch_forks( s ); } + + // on replay irreversible is not emitted by fork database, so emit it explicitly here + if( s == controller::block_status::irreversible ) + emit( self.irreversible_block, new_header_state ); + } FC_LOG_AND_RETHROW( ) } From 53d8d5f969b5a0016ce6d446c8a56e9c107ff26a Mon Sep 17 00:00:00 2001 From: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> Date: Sun, 16 Sep 2018 12:08:49 -0400 Subject: [PATCH 2/4] Fix trivial error message print in cleos http resolve failure --- programs/cleos/httpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/cleos/httpc.cpp b/programs/cleos/httpc.cpp index 343e396ef95..380c054d44e 100644 --- a/programs/cleos/httpc.cpp +++ b/programs/cleos/httpc.cpp @@ -129,7 +129,7 @@ namespace eosio { namespace client { namespace http { boost::system::error_code ec; auto result = resolver.resolve(tcp::v4(), url.server, url.port, ec); if (ec) { - EOS_THROW(fail_to_resolve_host, "Error resolving \"${server}:${url}\" : ${m}", ("server", url.server)("port",url.port)("m",ec.message())); + EOS_THROW(fail_to_resolve_host, "Error resolving \"${server}:${port}\" : ${m}", ("server", url.server)("port",url.port)("m",ec.message())); } // non error results are guaranteed to return a non-empty range From 398ad21f792ac93d56adc073e918fd94064ae616 Mon Sep 17 00:00:00 2001 From: Bart Wyatt Date: Tue, 18 Sep 2018 17:49:19 -0400 Subject: [PATCH 3/4] Consolidated Security Fixes for 1.2.6 - Consider peers for syncing at most once Co-authored-by: Matt Witherspoon <32485495+spoonincode@users.noreply.github.com> --- plugins/net_plugin/net_plugin.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index d907e7f7390..bb3b33a8f23 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -1344,19 +1344,16 @@ namespace eosio { } //scan the list of peers looking for another able to provide sync blocks. - while (cptr != cend) { + auto cstart_it = cptr; + do { //select the first one which is current and break out. - if ((*cptr)->current()) { + if((*cptr)->current()) { source = *cptr; break; } - else { - // advance the iterator in a round robin fashion. - if (++cptr == my_impl->connections.end()) { + if(++cptr == my_impl->connections.end()) cptr = my_impl->connections.begin(); - } - } - } + } while(cptr != cstart_it); // no need to check the result, either source advanced or the whole list was checked and the old source is reused. } } From fc99f6aad4e42fd768354234b5adf818f84319ed Mon Sep 17 00:00:00 2001 From: Bart Wyatt Date: Tue, 18 Sep 2018 18:01:37 -0400 Subject: [PATCH 4/4] bump version to 1.2.6 --- CMakeLists.txt | 2 +- Docker/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b8b286846b..52ae84745ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ set( CXX_STANDARD_REQUIRED ON) set(VERSION_MAJOR 1) set(VERSION_MINOR 2) -set(VERSION_PATCH 5) +set(VERSION_PATCH 6) set( CLI_CLIENT_EXECUTABLE_NAME cleos ) set( NODE_EXECUTABLE_NAME nodeos ) diff --git a/Docker/README.md b/Docker/README.md index 82eee59c523..c94c61f7ccc 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -20,10 +20,10 @@ cd eos/Docker docker build . -t eosio/eos ``` -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 v1.2.5 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 v1.2.6 tag, you could do the following: ```bash -docker build -t eosio/eos:v1.2.5 --build-arg branch=v1.2.5 . +docker build -t eosio/eos:v1.2.6 --build-arg branch=v1.2.6 . ``` By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.