diff --git a/.buildkite/coverage.yml b/.buildkite/coverage.yml index 908d3a3bf8d..bbb8fa91387 100644 --- a/.buildkite/coverage.yml +++ b/.buildkite/coverage.yml @@ -15,7 +15,7 @@ steps: agents: - "role=linux-coverage" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job mounts: diff --git a/.buildkite/debug.yml b/.buildkite/debug.yml index 8d7aaa7c502..d6f95814f54 100644 --- a/.buildkite/debug.yml +++ b/.buildkite/debug.yml @@ -22,7 +22,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -37,7 +37,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -52,7 +52,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -67,7 +67,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -82,7 +82,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 @@ -128,7 +128,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -152,7 +152,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -176,7 +176,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -200,7 +200,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -224,7 +224,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 diff --git a/.buildkite/long_running_tests.yml b/.buildkite/long_running_tests.yml index 28a456db1ec..d4bc7244193 100644 --- a/.buildkite/long_running_tests.yml +++ b/.buildkite/long_running_tests.yml @@ -22,7 +22,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -37,7 +37,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -52,7 +52,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -67,7 +67,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -82,7 +82,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 @@ -128,7 +128,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -152,7 +152,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -176,7 +176,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -200,7 +200,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -224,7 +224,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 16163b09a3a..c4ba85ae46e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -22,7 +22,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -37,7 +37,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -52,7 +52,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -67,7 +67,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -82,7 +82,7 @@ steps: - "role=linux-builder" artifact_paths: "build.tar.gz" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 @@ -128,7 +128,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu" workdir: /data/job timeout: 60 @@ -152,7 +152,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:ubuntu18" workdir: /data/job timeout: 60 @@ -176,7 +176,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:fedora" workdir: /data/job timeout: 60 @@ -200,7 +200,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:centos" workdir: /data/job timeout: 60 @@ -224,7 +224,7 @@ steps: - "build/genesis.json" - "build/config.ini" plugins: - docker#v1.1.1: + docker#v1.4.0: image: "eosio/ci:amazonlinux" workdir: /data/job timeout: 60 diff --git a/CMakeLists.txt b/CMakeLists.txt index c374afa42ef..76f7afa7a91 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 1) +set(VERSION_PATCH 2) set( CLI_CLIENT_EXECUTABLE_NAME cleos ) set( NODE_EXECUTABLE_NAME nodeos ) diff --git a/Docker/README.md b/Docker/README.md index d1d38924bdb..4bd51558e36 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.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 v1.2.2 tag, you could do the following: ```bash -docker build -t eosio/eos:v1.2.1 --build-arg branch=v1.2.1 . +docker build -t eosio/eos:v1.2.2 --build-arg branch=v1.2.2 . ``` By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image. diff --git a/contracts/eosiolib/types.h b/contracts/eosiolib/types.h index 32448f99141..120c896cd87 100644 --- a/contracts/eosiolib/types.h +++ b/contracts/eosiolib/types.h @@ -27,13 +27,13 @@ typedef uint64_t account_name; /** * @brief Name of a permission - * @details Name of an account + * @details Name of a permission */ typedef uint64_t permission_name; /** * @brief Name of a table - * @details Name of atable + * @details Name of a table */ typedef uint64_t table_name; diff --git a/libraries/fc b/libraries/fc index a6b2756b100..62a19a75868 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit a6b2756b100098296f7548a191e6210e770b7b3a +Subproject commit 62a19a758682679e3de27d956986eaf8b016465d diff --git a/plugins/chain_plugin/chain_plugin.cpp b/plugins/chain_plugin/chain_plugin.cpp index 11b62273808..58295d52da8 100644 --- a/plugins/chain_plugin/chain_plugin.cpp +++ b/plugins/chain_plugin/chain_plugin.cpp @@ -1404,11 +1404,15 @@ void read_write::push_transaction(const read_write::push_transaction_params& par auto trx_trace_ptr = result.get(); try { - fc::variant pretty_output; - pretty_output = db.to_variant_with_abi(*trx_trace_ptr, abi_serializer_max_time); - chain::transaction_id_type id = trx_trace_ptr->id; - next(read_write::push_transaction_results{id, pretty_output}); + fc::variant output; + try { + output = db.to_variant_with_abi( *trx_trace_ptr, abi_serializer_max_time ); + } catch( chain::abi_exception& ) { + output = *trx_trace_ptr; + } + + next(read_write::push_transaction_results{id, output}); } CATCH_AND_CALL(next); } }); @@ -1472,6 +1476,8 @@ read_only::get_code_results read_only::get_code( const get_code_params& params ) const auto& d = db.db(); const auto& accnt = d.get( params.account_name ); + EOS_ASSERT( params.code_as_wasm, unsupported_feature, "Returning WAST from get_code is no longer supported" ); + if( accnt.code.size() ) { if (params.code_as_wasm) { result.wasm = string(accnt.code.begin(), accnt.code.end()); @@ -1664,7 +1670,7 @@ read_only::get_required_keys_result read_only::get_required_keys( const get_requ abi_serializer::from_variant(params.transaction, pretty_input, resolver, abi_serializer_max_time); } EOS_RETHROW_EXCEPTIONS(chain::transaction_type_exception, "Invalid transaction") - auto required_keys_set = db.get_authorization_manager().get_required_keys(pretty_input, params.available_keys); + auto required_keys_set = db.get_authorization_manager().get_required_keys( pretty_input, params.available_keys, fc::seconds( pretty_input.delay_sec )); get_required_keys_result result; result.required_keys = required_keys_set; return result; diff --git a/plugins/mongo_db_plugin/mongo_db_plugin.cpp b/plugins/mongo_db_plugin/mongo_db_plugin.cpp index cf0e4d1e9b3..c4d11e1bdee 100644 --- a/plugins/mongo_db_plugin/mongo_db_plugin.cpp +++ b/plugins/mongo_db_plugin/mongo_db_plugin.cpp @@ -104,7 +104,7 @@ class mongo_db_plugin_impl { void remove_account_control( const account_name& name, const permission_name& permission ); /// @return true if act should be added to mongodb, false to skip it - bool filter_include( const chain::action& act ) const; + bool filter_include( const chain::action_trace& action_trace ) const; void init(); void wipe_database(); @@ -200,13 +200,13 @@ const std::string mongo_db_plugin_impl::accounts_col = "accounts"; const std::string mongo_db_plugin_impl::pub_keys_col = "pub_keys"; const std::string mongo_db_plugin_impl::account_controls_col = "account_controls"; -bool mongo_db_plugin_impl::filter_include( const chain::action& act ) const { +bool mongo_db_plugin_impl::filter_include( const chain::action_trace& action_trace ) const { bool include = false; - if( filter_on_star || filter_on.find( {act.account, act.name, 0} ) != filter_on.end() ) { + if( filter_on_star || filter_on.find( {action_trace.receipt.receiver, action_trace.act.name, 0} ) != filter_on.end() ) { include = true; } else { - for( const auto& a : act.authorization ) { - if( filter_on.find( {act.account, act.name, a.actor} ) != filter_on.end() ) { + for( const auto& a : action_trace.act.authorization ) { + if( filter_on.find( {action_trace.receipt.receiver, action_trace.act.name, a.actor} ) != filter_on.end() ) { include = true; break; } @@ -215,14 +215,14 @@ bool mongo_db_plugin_impl::filter_include( const chain::action& act ) const { if( !include ) { return false; } - if( filter_out.find( {act.account, 0, 0} ) != filter_out.end() ) { + if( filter_out.find( {action_trace.receipt.receiver, 0, 0} ) != filter_out.end() ) { return false; } - if( filter_out.find( {act.account, act.name, 0} ) != filter_out.end() ) { + if( filter_out.find( {action_trace.receipt.receiver, action_trace.act.name, 0} ) != filter_out.end() ) { return false; } - for( const auto& a : act.authorization ) { - if( filter_out.find( {act.account, act.name, a.actor} ) != filter_out.end() ) { + for( const auto& a : action_trace.act.authorization ) { + if( filter_out.find( {action_trace.receipt.receiver, action_trace.act.name, a.actor} ) != filter_out.end() ) { return false; } } @@ -714,7 +714,7 @@ mongo_db_plugin_impl::add_action_trace( mongocxx::bulk_write& bulk_action_traces } bool added = false; - if( start_block_reached && store_action_traces && filter_include( atrace.act ) ) { + if( start_block_reached && store_action_traces && filter_include( atrace ) ) { auto action_traces_doc = bsoncxx::builder::basic::document{}; const chain::base_action_trace& base = atrace; // without inline action traces diff --git a/plugins/producer_plugin/producer_plugin.cpp b/plugins/producer_plugin/producer_plugin.cpp index 3997c997653..0200eb8f8ba 100644 --- a/plugins/producer_plugin/producer_plugin.cpp +++ b/plugins/producer_plugin/producer_plugin.cpp @@ -1166,28 +1166,35 @@ void producer_plugin_impl::schedule_production_loop() { static const boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1)); if (result == start_block_result::succeeded) { // ship this block off no later than its deadline - _timer.expires_at(epoch + boost::posix_time::microseconds(chain.pending_block_time().time_since_epoch().count() + (last_block ? _last_block_time_offset_us : _produce_time_offset_us))); - fc_dlog(_log, "Scheduling Block Production on Normal Block #${num} for ${time}", ("num", chain.pending_block_state()->block_num)("time",chain.pending_block_time())); + EOS_ASSERT( chain.pending_block_state(), missing_pending_block_state, "producing without pending_block_state, start_block succeeded" ); + auto deadline = chain.pending_block_time().time_since_epoch().count() + (last_block ? _last_block_time_offset_us : _produce_time_offset_us); + _timer.expires_at( epoch + boost::posix_time::microseconds( deadline )); + fc_dlog(_log, "Scheduling Block Production on Normal Block #${num} for ${time}", ("num", chain.pending_block_state()->block_num)("time",deadline)); } else { + EOS_ASSERT( chain.pending_block_state(), missing_pending_block_state, "producing without pending_block_state" ); auto expect_time = chain.pending_block_time() - fc::microseconds(config::block_interval_us); // ship this block off up to 1 block time earlier or immediately if (fc::time_point::now() >= expect_time) { _timer.expires_from_now( boost::posix_time::microseconds( 0 )); + fc_dlog(_log, "Scheduling Block Production on Exhausted Block #${num} immediately", ("num", chain.pending_block_state()->block_num)); } else { _timer.expires_at(epoch + boost::posix_time::microseconds(expect_time.time_since_epoch().count())); + fc_dlog(_log, "Scheduling Block Production on Exhausted Block #${num} at ${time}", ("num", chain.pending_block_state()->block_num)("time",expect_time)); } - fc_dlog(_log, "Scheduling Block Production on Exhausted Block #${num} immediately", ("num", chain.pending_block_state()->block_num)); } _timer.async_wait([&chain,weak_this,cid=++_timer_corelation_id](const boost::system::error_code& ec) { auto self = weak_this.lock(); if (self && ec != boost::asio::error::operation_aborted && cid == self->_timer_corelation_id) { + // pending_block_state expected, but can't assert inside async_wait + auto block_num = chain.pending_block_state() ? chain.pending_block_state()->block_num : 0; auto res = self->maybe_produce_block(); - fc_dlog(_log, "Producing Block #${num} returned: ${res}", ("num", chain.pending_block_state()->block_num)("res", res) ); + fc_dlog(_log, "Producing Block #${num} returned: ${res}", ("num", block_num)("res", res)); } }); } else if (_pending_block_mode == pending_block_mode::speculating && !_producers.empty() && !production_disabled_by_policy()){ fc_dlog(_log, "Specualtive Block Created; Scheduling Speculative/Production Change"); + EOS_ASSERT( chain.pending_block_state(), missing_pending_block_state, "speculating without pending_block_state" ); const auto& pbs = chain.pending_block_state(); schedule_delayed_production_loop(weak_this, pbs->header.timestamp); } else { diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index 1451cc20166..e478f42a2bd 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -681,8 +681,8 @@ struct set_account_permission_subcommand { const auto& existing_permissions = account_result.get_object()["permissions"].get_array(); auto permissionPredicate = [this](const auto& perm) { return perm.is_object() && - perm.get_object().contains("permission") && - boost::equals(perm.get_object()["permission"].get_string(), permissionStr); + perm.get_object().contains("perm_name") && + boost::equals(perm.get_object()["perm_name"].get_string(), permissionStr); }; auto itr = boost::find_if(existing_permissions, permissionPredicate); @@ -2354,7 +2354,6 @@ int main( int argc, char** argv ) { add_standard_transaction_options(transfer, "sender@active"); transfer->set_callback([&] { - signed_transaction trx; if (tx_force_unique && memo.size() == 0) { // use the memo to add a nonce memo = generate_nonce_string(); diff --git a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py index 11aee4e34c1..88821bfe21c 100755 --- a/tutorials/bios-boot-tutorial/bios-boot-tutorial.py +++ b/tutorials/bios-boot-tutorial/bios-boot-tutorial.py @@ -74,7 +74,7 @@ def startWallet(): run('mkdir -p ' + os.path.abspath(args.wallet_dir)) background(args.keosd + ' --unlock-timeout %d --http-server-address 127.0.0.1:6666 --wallet-dir %s' % (unlockTimeout, os.path.abspath(args.wallet_dir))) sleep(.4) - run(args.cleos + 'wallet create') + run(args.cleos + 'wallet create --to-console') def importKeys(): run(args.cleos + 'wallet import --private-key ' + args.private_key) @@ -347,7 +347,7 @@ def stepLog(): parser.add_argument('--public-key', metavar='', help="EOSIO Public Key", default='EOS8Znrtgwt8TfpmbVpTKvA2oB8Nqey625CLN8bCN3TEbgx86Dsvr', dest="public_key") parser.add_argument('--private-Key', metavar='', help="EOSIO Private Key", default='5K463ynhZoCDDa4RDcr63cUwWLTnKqmdcoTKTHBjqoKfv4u5V7p', dest="private_key") -parser.add_argument('--cleos', metavar='', help="Cleos command", default='../../build/programs/cleos/cleos --wallet-url http://localhost:6666 ') +parser.add_argument('--cleos', metavar='', help="Cleos command", default='../../build/programs/cleos/cleos --wallet-url http://127.0.0.1:6666 ') parser.add_argument('--nodeos', metavar='', help="Path to nodeos binary", default='../../build/programs/nodeos/nodeos') parser.add_argument('--keosd', metavar='', help="Path to keosd binary", default='../../build/programs/keosd/keosd') parser.add_argument('--contracts-dir', metavar='', help="Path to contracts directory", default='../../build/contracts/') @@ -381,7 +381,7 @@ def stepLog(): args = parser.parse_args() -args.cleos += '--url http://localhost:%d ' % args.http_port +args.cleos += '--url http://127.0.0.1:%d ' % args.http_port logFile = open(args.log_path, 'a')