refactor cost calculation (#21062)
* - cache calculated transaction cost to allow sharing; - atomic cost tracking op; - only lock accounts for transactions eligible for current block; - moved qos service and stats reporting to its own model; - add cost_weight default to neutral (as 1), vote has zero weight; Co-authored-by: Tyera Eulberg <teulberg@gmail.com> * Update core/src/qos_service.rs Co-authored-by: Tyera Eulberg <teulberg@gmail.com> * Update core/src/qos_service.rs Co-authored-by: Tyera Eulberg <teulberg@gmail.com> Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
@ -110,9 +110,8 @@ pub enum TransactionError {
|
||||
#[error("Transaction processing left an account with an outstanding borrowed reference")]
|
||||
AccountBorrowOutstanding,
|
||||
|
||||
#[error(
|
||||
"Transaction could not fit into current block without exceeding the Max Block Cost Limit"
|
||||
)]
|
||||
/// Transaction would exceed max Block Cost Limit
|
||||
#[error("Transaction would exceed max Block Cost Limit")]
|
||||
WouldExceedMaxBlockCostLimit,
|
||||
|
||||
/// Transaction version is unsupported
|
||||
@ -122,6 +121,10 @@ pub enum TransactionError {
|
||||
/// Transaction loads a writable account that cannot be written
|
||||
#[error("Transaction loads a writable account that cannot be written")]
|
||||
InvalidWritableAccount,
|
||||
|
||||
/// Transaction would exceed max account limit within the block
|
||||
#[error("Transaction would exceed max account limit within the block")]
|
||||
WouldExceedMaxAccountCostLimit,
|
||||
}
|
||||
|
||||
pub type Result<T> = result::Result<T, TransactionError>;
|
||||
|
Reference in New Issue
Block a user