I have a native build of EOS 1.1.4 on MacOS for developing and stress testing a smart contract. No problems.

However, when I run the contract in Docker (on both Ubuntu and MacOS) I occasionally but not repeatably encounter the following problems:

  1. max cpu limit exceeded error when executing a contract action (this happens mostly on MacOS hosts)
  2. http calls to nodeosd stop responding, resulting in http timeouts; but nodeosd is up and running, producing logs, memory and cpu usage looks fine (this happens mostly on Ubuntu hosts)

Has anyone else experienced nodeosd working fine when running native but failing in these ways when running in Docker?


For the first issue, you could be exceeding the maximum CPU usage time allowed for a transaction. You can see below where this is hard coded:

const static uint32_t   default_max_block_cpu_usage                 = 200'000; /// max block cpu usage in microseconds
const static uint32_t   default_target_block_cpu_usage_pct          = 10 * percent_1;
const static uint32_t   default_max_transaction_cpu_usage           = 3*default_max_block_cpu_usage/4; /// max trx cpu usage in microseconds
const static uint32_t   default_min_transaction_cpu_usage           = 100; /// min trx cpu usage in microseconds (10000 TPS equiv)


This also appears to be elaborated on here: https://github.com/EOSIO/eos/issues/3200

As far as resource limit is concerned, in order to successfully push a transaction to blockchain, there’re two prerequisite:

  1. the account itself must have enough resource(RAM, NET, CPU)

  2. the block that BP trying to pack transaction inside into must have enough resource(e.g. CPU time)

Inside exceptions.hpp, defines a series exceptions related to resource exhaustion:

 FC_DECLARE_DERIVED_EXCEPTION( tx_cpu_usage_exceeded, resource_exhausted_exception, 
                               3080004, "transaction exceeded the current CPU usage limit imposed on the transaction" ) 

As for the second, you're not getting a stale chain are you? I.e., --enable-stale-production allows empty blocks to be produced continually, but if that flag is not set the chain will eventually stop producing and will need to be restarted.

  • Thank you for the thoughts. As for CPU, why would there be no problem ever in native but a problem when running in Docker? I am replaying the same transactions in each during tests. As for stale chain, I am already using enable-stale-production = true in config.ini. – kkurian Dec 10 '18 at 19:30
  • 1
    Not sure. I know docker is deprecated, so I wouldn't recommend using it for the long term. – Nat Dec 10 '18 at 20:03

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.