1

In chain_config.hpp I need a new field "alfa_opt".

struct chain_config {
...
   uint32_t   max_block_cpu_usage;                 ///< the maxiumum billable cpu usage (in microseconds) for a block
   uint32_t   alfa_opt; /// < my parameter
...

But when I add it to "FC_REFLECT" item:

FC_REFLECT(eosio::chain::chain_config,                                                         
           (max_block_net_usage)(target_block_net_usage_pct)                                   
           (max_transaction_net_usage)(base_per_transaction_net_usage)(net_usage_leeway)       
           (context_free_discount_net_usage_num)(context_free_discount_net_usage_den)          

           (max_block_cpu_usage)(target_block_cpu_usage_pct)                                   
           (max_transaction_cpu_usage)(min_transaction_cpu_usage)                              

           (max_transaction_lifetime)(deferred_trx_expiration_window)(max_transaction_delay)   
           (max_inline_action_size)(max_inline_action_depth)(max_authority_depth)              
           (alfa_opt) // <=== that one (1)                                                        
)                                                                                              

Then unit tests

unittests/unit_test -t eosio_system_tests/setparams -- --wabt

failed with

"3080004 tx_cpu_usage_exceeded: Transaction exceeded the current CPU usage limit imposed on the transaction"

When I comment line (1), then test will be passed.

1) Why is that relation between field and tx_cpu_usage exists?

2) What is true-way to add a new field to chain_config?

Thank You!

1 Answer 1

1

Yes there is relation between fields and eos resources because by adding that field to your code it will take more ram,cpu and bandwith to process.,To resolve this issue stake more resources than current staked resources.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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