Waivio

Updated Dice/Card Oracle

4 comments

thecrazygm2 days agoPeakD2 min read

Hey everyone,

I'm back with another update, this time focusing on some performance issues with our Discord bot.

image.png

The ever-vigilant @ecoinstant pointed out that the bot wasn't responding to games like it used to. I immediately looked into it and found that the core problem was the API calls to the Hive nodes were sometimes not "quick enough." When the node response lagged, it caused the games to fail or time out, leading to a frustrating experience.

After spending a bit of time adjusting timeouts and tweaking error handling, which provided only marginal improvements, I decided it was time for a more fundamental change. I needed to change the oracle for the deterministic results.

The New Oracle: Faster, Simpler, Stronger

The solution involved a shift away from the previous, more complex method. The new system is far simpler: it now uses the getStatus API call on Hive-Engine nodes and relies on a single API call for its result.

This new approach made a world of difference. Since we are using the status of the Hive Engine side, which includes the last processed block, and the game roll itself is not a transaction, I don't need to include the previous block hash in the request.

However, to ensure truly unique and deterministic results, especially if multiple people roll at the exact same time, I still add a small salt value to the user's request. This ensures that even in simultaneous events, the final random seed remains distinct.

Here is a look at it in use:

Damn! That's an Amazing Poker Hand!
Damn! That's an Amazing Poker Hand!

This makes the oracle faster, more reliable, and still entirely transparent and verifiable.

barkeep.png

ledger.png

seer.png

Come Join the Conversation!

Want to see the new oracle in action, suggest a feature, or just hang out?

As always,
Michael Garcia a.k.a. TheCrazyGM

Hashtags 7
A general topic community built around PoB technology and the POB token

Comments

Sort byBest