-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Market-orientated transaction pricing #1963
Conversation
Avoid a strict gas-limit and let the market decide through using a priority queue based around gas pricing for transactions. In periods of low transaction volume, they'll be processed for a lower fee.
return false; | ||
} | ||
// Operation maybe ok: only if hash not found in gas-price Set. | ||
from.remove(gas_price).is_some() |
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.
I would move this to line #334
- cause it will happen only in that case.
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.
would like to, but hashes
has captured an &mut
of into
in this scope so it has to escape before it can be remove
d.
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.
Maybe explicit drop(hashes)
would work?
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.
not until non-lexical lifetimes are designed and implemented in rust.
Test would be nice :) |
I believe that any new logic introduced without a test that triggers it should be considered a major issue |
@tomusdrw please review change in tests/logic carefully. |
AFAIR So behaviour in this PR would be: favor transactions that were inserted prior to the limit, when limit is reached you need to provide sufficient gas price to (potentialy) replace one transaction from the queue. Is this correct/expected? |
assert_eq!(txq.status().pending, 2); | ||
assert_eq!(txq.last_nonce(&sender), Some(nonce)); | ||
*/ | ||
assert!(res.is_err()); |
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.
I would check exact error here if possible:
assert_eq!(res, Err(TransactionError::InsufficientGasPrice {
minimal: <min>,
got: <gas_price>,
}));
yes - that's the expected behaviour. |
Avoid a strict gas-limit and let the market decide through using
a priority queue based around gas pricing for transactions. In
periods of low transaction volume, they'll be processed for a lower
fee.