Titan Tech Teatime #2
Latest technical updates and new builder features coming straight from Saturn's orbit
Blocks built to date: 141,866
Welcome to the Second Serving of Technical Teatime with Titan! 🍵 Today, we delve into the intriguing world of priority queues – what they are, why we need them, and how we go about classifying Searchers in the different queues.
What are priority queues and why do we use them?
Those of you with an attention to detail may have already noticed that we briefly introduced priority queues in our docs. Priority queues are basically our way of handling all the bundles we receive, and choosing how to feed them to our builder.
But let’s take a step back - why do we need priority queues in the first place? Our builder (like most other builders) receives an overwhelming amount of bundles every second. Since block building is a very time sensitive operation, to maximise our performance it is paramount that we prioritise feeding to our builder the bundles that give us the best chances of building the most valuable blocks first.
Titan’s objective function is to maximise the value of all blocks built.
How many different queues are there?
We have four distinct priority queues (yes, the eagle-eyed among you will have noticed that we only mention three of them in our docs, but bear with us, we’re experimenting and will update the docs soon):
High Priority: Signed header + Reputation
Medium Priority: Signed header
Low Priority: Unsigned header
Ultra-low Priority: Spammers’ sin-bin
By default, any Searcher sending us bundles will end up either in the Low or Medium priority queues, depending on whether they sign their header or not.
To access the High priority queue, you must send bundles with a signed header, and also maintain a good inclusion track record, as we use a function of inclusion rate (i.e. the ratio of bundles landed : bundles sent) and bundle value to determine who to promote from the Medium priority queue. For example, if you are like jaredfromsubway.eth, i.e. someone who lands high value bundles very often, it makes sense for us to prioritise your bundles over someone else who sends many bundles but only occasionally lands in a block. Our objective function is to always produce the most valuable block possible.
On the opposite end of the spectrum we have the Ultra-low priority queue, which we have recently introduced to address the issues caused by some pesky Searchers who have an abnormally low inclusion rate, or in other words those who send us a lot of bundles but only very rarely land in a block. The reason we need this queue is to deprioritise their bundles and avoid choking up our infrastructure with low-value flow.
How does the queue system work?
By now you’ll have understood that not all bundles reach our builder at the same speed, but it’s very important to clarify that once they do hit our builder engine, they are all treated equally by our bundle merging algorithms.
Bundles will reach our builder at different speeds (based on their priority queue), but all bundles are treated equally by our builder engine.
So, how does the queuing system really work you’ll be asking? Let’s dive in.
Firstly, this is what the general flow looks like: Searchers send bundles to our RPC endpoint, these then hit our Priority Queue, and are eventually sent to the Builder Engine.
Now let’s dive deeper into how bundles are processed within the Titan Priority Queue. As bundles arrive, they are separated and placed in the High, Medium and Low priority queues. These are then sent to the Builder Engine with a process that ensures that on average a bundle in the High priority queue will hit the Builder Engine 1.5x faster than a bundle in the Medium queue, and 3x faster than a bundle in the Low queue.
And what about the Ultra-low priority queue, I hear you ask? Well, to be completely honest if you’ve ended up in this queue you’re in trouble. We will only pick a bundle from each Searcher belonging to this queue every 1 second, so as you can imagine it will take orders of magnitude longer to reach the Builder Engine, and it’s quite likely that most bundles here will never make it before the slot cut-off time.
Fear not however - you really need to misbehave to end up in this queue. To give a sense of what we mean, to end up in the Ultra-low priority queue you would need to be sending more than 150 bundles per slot consistently, and have a bundles sent : bundles landed ratio below 0.0001 (0.01%).
That being said - if you do frequently send more than 150 bundles per slot (and have a low inclusion rate) and are worried that you may have entered our Ultra-low queue, feel free to reach out to our crew on Discord - if you give us your pub-keys we’ll be able to tell you which queue you’re in. Just to be clear though - it is very unlikely that you have ended up in there unless you’re voluntarily spamming our builder, as currently we only have a handful of misbehavers in there.
Tips & Tricks
If you’ve made it this far - you’ll have realised that there’s some ways to optimise your priority queue. Here’s a few simple tips and tricks:
How not to enter the Ultra-low priority queue hell:
Do not spam us
How to move from Low → Medium priority queue:
Sign your header!
How to move from Medium → High priority queue:
Try to maintain as high an inclusion rate as possible while sending high value bundles
We’ll soon be releasing a tool that will allow you to query our API and know exactly which priority queue you are in. Rumour has it there may also be an Ultra-high priority queue in the works… watch this space for more updates!
Until Next Time…
Thank you for joining us on this technical soiree! If this brew of knowledge was to your liking, do share it with fellow aficionados.
Happy bundling with Titan! 🚀
Thanks for reading Titan’s Substack! Subscribe for free to receive new posts and support my work.