-
Notifications
You must be signed in to change notification settings - Fork 151
Improve tx priority #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Improve tx priority #688
Conversation
Improve how transaction priority is computed for new entities.
src/ticking/pending_txs_pool.h
Outdated
| // latestTransferTick = latestOutgoingTransferTick if latestOutgoingTransferTick > 0, | ||
| // latestTransferTick = latestIncomingTransferTick otherwise (new entity). | ||
| const EntityRecord& entity = spectrum[sourceIndex]; | ||
| const auto latestTransferTick = (entity.latestOutgoingTransferTick) ? entity.latestOutgoingTransferTick : entity.latestIncomingTransferTick; |
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'm not a big fan of auto when it's not a complex type. Here I'd prefer writing unsigned int explicitly.
src/ticking/pending_txs_pool.h
Outdated
| // latestTransferTick = latestIncomingTransferTick otherwise (new entity). | ||
| const EntityRecord& entity = spectrum[sourceIndex]; | ||
| const auto latestTransferTick = (entity.latestOutgoingTransferTick) ? entity.latestOutgoingTransferTick : entity.latestIncomingTransferTick; | ||
| priority = smul(balance, static_cast<sint64>(tx->tick - latestTransferTick + 1)); |
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.
While you're anyways touching this file, could you use math_lib::smul here to get rid of the qpi.h include? (we didn't have smul available outside qpi before but I moved it to math_lib for the contract exec fees)
Franziska-Mueller
left a comment
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.
looks good now!
I suggest to wait with merging to develop until we have the first non-seamless transition after the holidays. I'd like to keep develop in a non-breaking state to facilitate optional updates.
Improve how transaction priority is computed for new entities.
https://discord.com/channels/@me/1167399046357471242/1450385128978251796