Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7823 from EOSIO/merge-release-1.8.2-to-master
Browse files Browse the repository at this point in the history
Merge release 1.8.2 to master
  • Loading branch information
heifner authored Aug 28, 2019
2 parents 1418543 + 0bc3432 commit be804bf
Show file tree
Hide file tree
Showing 28 changed files with 958 additions and 206 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 8)
set(VERSION_PATCH 1)
set(VERSION_PATCH 2)
#set(VERSION_SUFFIX develop)

if(VERSION_SUFFIX)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Examples of unacceptable behavior include:

## Contributor License & Acknowledgments

Whenever you make a contribution to this project, you license your contribution under the same terms as set out in LICENSE, and you represent and warrant that you have the right to license your contribution under those terms. Whenever you make a contribution to this project, you also certify in the terms of the Developer’s Certificate of Origin set out below:
Whenever you make a contribution to this project, you license your contribution under the same terms as set out in [LICENSE](./LICENSE), and you represent and warrant that you have the right to license your contribution under those terms. Whenever you make a contribution to this project, you also certify in the terms of the Developer’s Certificate of Origin set out below:

```
Developer Certificate of Origin
Expand Down
27 changes: 27 additions & 0 deletions IMPORTANT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Important Notice

We (block.one and its affiliates) make available EOSIO and other software, updates, patches and documentation (collectively, Software) on a voluntary basis as a member of the EOSIO community. A condition of you accessing any Software, websites, articles, media, publications, documents or other material (collectively, Material) is your acceptance of the terms of this important notice.

## Software
We are not responsible for ensuring the overall performance of Software or any related applications. Any test results or performance figures are indicative and will not reflect performance under all conditions. Software may contain components that are open sourced and subject to their own licenses; you are responsible for ensuring your compliance with those licenses.

We make no representation, warranty, guarantee or undertaking in respect of Software, whether expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.

Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with such Software.

Material is not made available to any person or entity that is the subject of sanctions administered or enforced by any country or government or otherwise designated on any list of prohibited or restricted parties (including but not limited to the lists maintained by the United Nations Security Council, the U.S. Government, the European Union or its Member States, or other applicable government authority) or organized or resident in a country or territory that is the subject of country-wide or territory-wide sanctions. You represent and warrant that neither you nor any party having a direct or indirect beneficial interest in you or on whose behalf you are acting as agent or nominee is such a person or entity and you will comply with all applicable import, re-import, sanctions, anti-boycott, export, and re-export control laws and regulations. If this is not accurate or you do not agree, then you must immediately cease accessing our Material and delete all copies of Software.

Any person using or offering Software in connection with providing software, goods or services to third parties shall advise such third parties of this important notice, including all limitations, restrictions and exclusions of liability.

## Trademarks
Block.one, EOSIO, EOS, the heptahedron and associated logos and related marks are our trademarks. Other trademarks referenced in Material are the property of their respective owners.

## Third parties
Any reference in Material to any third party or third-party product, resource or service is not an endorsement or recommendation by Block.one. We are not responsible for, and disclaim any and all responsibility and liability for, your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so information in Material may be out of date or inaccurate.

## Forward-looking statements
Please note that in making statements expressing Block.one’s vision, we do not guarantee anything, and all aspects of our vision are subject to change at any time and in all respects at Block.one’s sole discretion, with or without notice. We call these “forward-looking statements”, which includes statements on our website and in other Material, other than statements of historical facts, such as statements regarding EOSIO’s development, expected performance, and future features, or our business strategy, plans, prospects, developments and objectives. These statements are only predictions and reflect Block.one’s current beliefs and expectations with respect to future events; they are based on assumptions and are subject to risk, uncertainties and change at any time.

We operate in a rapidly changing environment and new risks emerge from time to time. Given these risks and uncertainties, you are cautioned not to rely on these forward-looking statements. Actual results, performance or events may differ materially from what is predicted in the forward-looking statements. Some of the factors that could cause actual results, performance or events to differ materially from the forward-looking statements include, without limitation: technical feasibility and barriers; market trends and volatility; continued availability of capital, financing and personnel; product acceptance; the commercial success of any new products or technologies; competition; government regulation and laws; and general economic, market or business conditions.

All statements are valid only as of the date of first posting and Block.one is under no obligation to, and expressly disclaims any obligation to, update or alter any statements, whether as a result of new information, subsequent events or otherwise. Nothing in any Material constitutes technological, financial, investment, legal or other advice, either in general or with regard to any particular situation or implementation. Please consult with experts in appropriate areas before implementing or utilizing anything contained in Material.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ $ brew remove eosio

#### Ubuntu 18.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio_1.8.1-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.1-1-ubuntu-18.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.2/eosio_1.8.2-1-ubuntu-18.04_amd64.deb
$ sudo apt install ./eosio_1.8.2-1-ubuntu-18.04_amd64.deb
```
#### Ubuntu 16.04 Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio_1.8.1-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.1-1-ubuntu-16.04_amd64.deb
$ wget https://github.com/eosio/eos/releases/download/v1.8.2/eosio_1.8.2-1-ubuntu-16.04_amd64.deb
$ sudo apt install ./eosio_1.8.2-1-ubuntu-16.04_amd64.deb
```
#### Ubuntu Package Uninstall
```sh
$ sudo apt remove eosio
```
#### Centos RPM Package Install
```sh
$ wget https://github.com/eosio/eos/releases/download/v1.8.1/eosio-1.8.1-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.1-1.el7.x86_64.rpm
$ wget https://github.com/eosio/eos/releases/download/v1.8.2/eosio-1.8.2-1.el7.x86_64.rpm
$ sudo yum install ./eosio-1.8.2-1.el7.x86_64.rpm
```
#### Centos RPM Package Uninstall
```sh
Expand Down Expand Up @@ -107,4 +107,6 @@ Instructions detailing the process of getting the software, building it, running

## Important

See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.
See [LICENSE](./LICENSE) for copyright and license terms.

All repositories and other materials are provided subject to the terms of this [IMPORTANT](./IMPORTANT.md) notice and you must familiarize yourself with its terms. The notice contains important information, limitations and restrictions relating to our software, publications, trademarks, third-party resources, and forward-looking statements. By accessing any of our repositories and other materials, you accept and agree to the terms of the notice.
11 changes: 9 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ struct controller_impl {
template<typename Signal, typename Arg>
void emit( const Signal& s, Arg&& a ) {
try {
s(std::forward<Arg>(a));
s( std::forward<Arg>( a ));
} catch (std::bad_alloc& e) {
wlog( "std::bad_alloc" );
throw e;
} catch (boost::interprocess::bad_alloc& e) {
wlog( "bad alloc" );
throw e;
Expand Down Expand Up @@ -1495,13 +1498,17 @@ struct controller_impl {
});
in_trx_requiring_checks = true;
push_transaction( onbtrx, fc::time_point::maximum(), self.get_global_properties().configuration.min_transaction_cpu_usage, true );
} catch( const boost::interprocess::bad_alloc& e ) {
} catch( const std::bad_alloc& e ) {
elog( "on block transaction failed due to a std::bad_alloc" );
throw;
} catch( const boost::interprocess::bad_alloc& e ) {
elog( "on block transaction failed due to a bad allocation" );
throw;
} catch( const fc::exception& e ) {
wlog( "on block transaction failed, but shouldn't impact block generation, system contract needs update" );
edump((e.to_detail_string()));
} catch( ... ) {
elog( "on block transaction failed due to unknown exception" );
}

clear_expired_input_transactions();
Expand Down
11 changes: 6 additions & 5 deletions libraries/chain/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,19 @@ fc::microseconds transaction::get_signature_keys( const vector<signature_type>&

std::unique_lock<std::mutex> lock(cache_mtx, std::defer_lock);
fc::microseconds sig_cpu_usage;
const auto digest_time = fc::time_point::now() - start;
for(const signature_type& sig : signatures) {
auto now = fc::time_point::now();
EOS_ASSERT( now < deadline, tx_cpu_usage_exceeded, "transaction signature verification executed for too long",
("now", now)("deadline", deadline)("start", start) );
auto sig_start = fc::time_point::now();
EOS_ASSERT( sig_start < deadline, tx_cpu_usage_exceeded, "transaction signature verification executed for too long",
("now", sig_start)("deadline", deadline)("start", start) );
public_key_type recov;
const auto& tid = id();
lock.lock();
recovery_cache_type::index<by_sig>::type::iterator it = recovery_cache.get<by_sig>().find( sig );
if( it == recovery_cache.get<by_sig>().end() || it->trx_id != tid ) {
lock.unlock();
recov = public_key_type( sig, digest );
fc::microseconds cpu_usage = fc::time_point::now() - start;
fc::microseconds cpu_usage = fc::time_point::now() - sig_start;
lock.lock();
recovery_cache.emplace_back( cached_pub_key{tid, recov, sig, cpu_usage} ); //could fail on dup signatures; not a problem
sig_cpu_usage += cpu_usage;
Expand All @@ -141,7 +142,7 @@ fc::microseconds transaction::get_signature_keys( const vector<signature_type>&
recovery_cache.erase( recovery_cache.begin());
lock.unlock();

return sig_cpu_usage;
return sig_cpu_usage + digest_time;
} FC_CAPTURE_AND_RETHROW() }

vector<transaction_extensions> transaction::validate_and_extract_extensions()const {
Expand Down
2 changes: 1 addition & 1 deletion libraries/chainbase
4 changes: 2 additions & 2 deletions libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace eosio { namespace testing {
if( !skip_pending_trxs ) {
unapplied_transactions_type unapplied_trxs = control->get_unapplied_transactions(); // make copy of map
for (const auto& entry : unapplied_trxs ) {
auto trace = control->push_transaction(entry.second, fc::time_point::maximum());
auto trace = control->push_transaction(entry.second, fc::time_point::maximum(), DEFAULT_BILLED_CPU_TIME_US );
if(trace->except) {
trace->except->dynamic_rethrow_exception();
}
Expand All @@ -257,7 +257,7 @@ namespace eosio { namespace testing {
vector<transaction_id_type> scheduled_trxs;
while( (scheduled_trxs = get_scheduled_transactions() ).size() > 0 ) {
for (const auto& trx : scheduled_trxs ) {
auto trace = control->push_scheduled_transaction(trx, fc::time_point::maximum());
auto trace = control->push_scheduled_transaction(trx, fc::time_point::maximum(), DEFAULT_BILLED_CPU_TIME_US);
if(trace->except) {
trace->except->dynamic_rethrow_exception();
}
Expand Down
18 changes: 16 additions & 2 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ fc::microseconds chain_plugin::get_abi_serializer_max_time() const {
return my->abi_serializer_max_time_ms;
}

void chain_plugin::log_guard_exception(const chain::guard_exception&e ) const {
void chain_plugin::log_guard_exception(const chain::guard_exception&e ) {
if (e.code() == chain::database_guard_exception::code_value) {
elog("Database has reached an unsafe level of usage, shutting down to avoid corrupting the database. "
"Please increase the value set for \"chain-state-db-size-mb\" and restart the process!");
Expand All @@ -1251,7 +1251,7 @@ void chain_plugin::log_guard_exception(const chain::guard_exception&e ) const {
dlog("Details: ${details}", ("details", e.to_detail_string()));
}

void chain_plugin::handle_guard_exception(const chain::guard_exception& e) const {
void chain_plugin::handle_guard_exception(const chain::guard_exception& e) {
log_guard_exception(e);

// quit the app
Expand All @@ -1264,6 +1264,12 @@ void chain_plugin::handle_db_exhaustion() {
std::_Exit(1);
}

void chain_plugin::handle_bad_alloc() {
elog("std::bad_alloc - memory exhausted");
//return -2 -- it's what programs/nodeos/main.cpp reports for std::exception
std::_Exit(-2);
}

namespace chain_apis {

const string read_only::KEYi64 = "i64";
Expand Down Expand Up @@ -1885,6 +1891,8 @@ void read_write::push_block(read_write::push_block_params&& params, next_functio
next(read_write::push_block_results{});
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const std::bad_alloc& ) {
chain_plugin::handle_bad_alloc();
} CATCH_AND_CALL(next);
}

Expand Down Expand Up @@ -1966,6 +1974,8 @@ void read_write::push_transaction(const read_write::push_transaction_params& par
});
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const std::bad_alloc& ) {
chain_plugin::handle_bad_alloc();
} CATCH_AND_CALL(next);
}

Expand Down Expand Up @@ -2000,6 +2010,8 @@ void read_write::push_transactions(const read_write::push_transactions_params& p
push_recurse(this, 0, params_copy, result, next);
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const std::bad_alloc& ) {
chain_plugin::handle_bad_alloc();
} CATCH_AND_CALL(next);
}

Expand Down Expand Up @@ -2035,6 +2047,8 @@ void read_write::send_transaction(const read_write::send_transaction_params& par
});
} catch ( boost::interprocess::bad_alloc& ) {
chain_plugin::handle_db_exhaustion();
} catch ( const std::bad_alloc& ) {
chain_plugin::handle_bad_alloc();
} CATCH_AND_CALL(next);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,11 @@ class chain_plugin : public plugin<chain_plugin> {
chain::chain_id_type get_chain_id() const;
fc::microseconds get_abi_serializer_max_time() const;

void handle_guard_exception(const chain::guard_exception& e) const;

static void handle_guard_exception(const chain::guard_exception& e);
static void handle_db_exhaustion();
static void handle_bad_alloc();
private:
void log_guard_exception(const chain::guard_exception& e) const;
static void log_guard_exception(const chain::guard_exception& e);

unique_ptr<class chain_plugin_impl> my;
};
Expand Down
Loading

0 comments on commit be804bf

Please sign in to comment.