Either you sort the transactions by priority fee before they go into the block or you sort them during replay...