-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Exit transaction early when insufficient account cpu - 2.0 #8638
Conversation
…cpu to execute according to last time trx was executed.
… of explicit_billed_cpu_time
…ch push_transaction
…g with tx_cpu_usage_exceeded so correct exception thrown in early eval of previously billed cpu
…on. Rename failure_is_subjective to block_is_exhausted to better reflect what the function does.
@@ -172,6 +172,11 @@ namespace eosio { namespace chain { | |||
deadline_exception_code = billing_timer_exception_code; | |||
} | |||
|
|||
if( !explicit_billed_cpu_time ) { | |||
// if account no longer has enough cpu to exec trx, don't try | |||
validate_account_cpu_usage( billed_cpu_time_us, account_cpu_limit ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to take leeway or the block cpu limit into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. @arhag and I discussed that and came to the conclusion that it should be fine that it doesn't take leeway into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't that effectively make leeway useless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only comes into play on unapplied transactions. So if not applied before then leeway will be in effect. Leeway will just not be used for unapplied transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we start relaying the billed_cpu_time over the p2p network then we will have to factor in leeway somehow.
Change Description
Consensus Changes
API Changes
Documentation Additions