Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update how transaction priority is affected by different factors #5672

Closed
shawntabrizi opened this issue Apr 16, 2020 · 1 comment · Fixed by #9834
Closed

Update how transaction priority is affected by different factors #5672

shawntabrizi opened this issue Apr 16, 2020 · 1 comment · Fixed by #9834
Assignees

Comments

@shawntabrizi
Copy link
Member

cc @tomusdrw

priority: info.weight as TransactionPriority,

This SignedExtension is bumping the priority by weight
Which is sort of dumb, why would higher weight transaction have higher priority 🤔

maybe it pays more in fees, but since weight is a scarce block resource, we should rather prioritize transactions with fee per weight unit, not overall fee

In general, it does not seem that we correctly factor and scale the different runtime factors which can affect the transaction queue priority.

@tomusdrw
Copy link
Contributor

Basically, since the end priority of a transaction is simply a sum of all priorities returned by individual SignedExtensions we should make sure to apply proper scaling factors to each of them. Currently we just add a bunch of numbers with different units together, namely:
weight (from CheckWeight) + weight (CheckNonce) + fee (Charge.Payment)

What's more, with Operational class we jump to max_value right away, which prevents any prioritisation within that class.

I think we should make sure that some sort of fee/weight metric has the most impact on priority.

The priority for unsigned transactions is also modified within pallet-local ValidateUnsigned implementations, which probably should be taken into account too.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants