Application Specific Ordering
Application Specific Ordering is a primitive that allows developers to specify the order of transactions in block batches. A block batch is 20ms, full blocks are sealed every 500ms.
How to use
Application Specific Ordering is available via the Priority
event in Solidity.
Priority.sol
contract Main {
function doSomething(uint256 priority) public {
emit Priority(priority);
}
}
The Priority
event is understood by Fiber nodes. The current validator uses a double-pass block production approach that attemps to re-order the transactions to satisfy the ordering.
However, priority are namespaced by contract address. Two contracts can emit two different priorities that do not conflict. If the transaction is found to have conflicting priorities, this transaction is then considered invalid and dropped.