I noticed a couple of slot battles shown on pooltool recently and was trying to see the leader vrf values to confirm how they were resolved. I pulled the data from my cncli database and found that the leader_vrf_0 values were not always less for the winner. But, I thought that the winner should have the lower leader vrf value according to this reference:
Here is a query that lists the 5 most recent slot battles where the winner had the higher leader_vrf_0 result stored in the cncli database (when the winner should have the lower value):
sqlite3 /var/lib/cardano/cncli.db 'select winner.block_number, winner.slot_number, winner.pool_id, winner.hash, winner.leader_vrf_0, loser.leader_vrf_0 from chain winner inner join chain loser on winner.slot_number = loser.slot_number and winner.block_number = loser.block_number and winner.orphaned=0 and loser.orphaned=1 and winner.leader_vrf_0 > loser.leader_vrf_0 order by winner.block_number desc limit 5;'
BlockNo | SlotNo | Winner PoolID | Winner block hash | Winner Leader VRF | Loser Leader VRF
7814905|72793921|ac5ba151fae6889e25021acc723b0e34655828bf3328b6f1180e1d65|fd15a900f46e8bf9c03ad987da1d99e9102dea99ae1e0423113ba5c7ad1f903b|0003b0ad7390b0da547e3e43b1adae072c709d5bd06d4962ef992ac42221deb3|00016073b18d7c4f9ae4174085401da8426eae37646a29c0027b0ba57ee8f456
7814595|72787725|ee98a72dfb3ba43e9de2e39ef825a69d5d45627d2e918ea3e260f2dd|7b02eb92d0f5ac4e820d7535f18825d242086336413a6c51e30a1c9d581594d2|0004106510affa94afddb43845a59dc6041b3887ce563e7f1114018f75329072|0000d4662f2c7d626857c552b6063b2c70f891b2d602412a6a15baa2fd200a43
7814482|72785510|b619d366a0acc2e5a8e0f8e373d6eb926a01811f05a381aaa7a8564c|99656c88d38916a8ce932d53a5a06db8ebbafb0ff1a37112ea86c248a03539c1|000703cbe5d02357b7dcd72b6319679ac58089eb91a8ff9a961e3050d41ec0fb|00024b9090d39771158f8426e876f687053c0efe2fe4f8335b34f656006183b5
7814446|72784819|971212db48d9390662faa0fa725950f3b9ac1a898227f5fcf1096399|c97725be2f3854730037af89ace0f6a4e1dabedf70040b56842b87795c26f2e3|00039b61db164c09c820bf86194d5b8e58f2c5400f6f6ec8f017ec397389a343|0003307de189e839e1a5ee43dd37553f505383f3b1407071b316a8ac63426c90
7814351|72782882|ed40b0a319f639a70b1e2a4de00f112c4f7b7d4849f0abd25c4336a4|dc67f5747cfbe163ef6efd7a29e5e49296504757372bdb8fa7575e65eb79ae26|0008cdbb377d1a589908b8a763f95a3878ccc916110dd5575fcdb89094d13698|00003e02943eba2de8de080a022878350b26d1a0bff472c6b370496519b9d722
If you take the top example. The leader_vrf_0 value for the winner was 0003bâŚ, but the loser had a lower value of 00016âŚ
Pooltool shows this battle and confirms the winner block has hash fd15⌠which is the same as my query confirms was the winner : Cardano PoolTool - The most comprehensive staking statistics for Cardano on the web.
According to the reference, the lower leader vrf value should win the slot battle.
The format of the chain table in the cncli database is:
sqlite3 /var/lib/cardano/cncli.db '.schema chain'
CREATE TABLE chain (
id INTEGER PRIMARY KEY AUTOINCREMENT,
block_number INTEGER NOT NULL,
slot_number INTEGER NOT NULL,
hash TEXT NOT NULL,
prev_hash TEXT NOT NULL,
eta_v TEXT NOT NULL,
node_vkey TEXT NOT NULL,
node_vrf_vkey TEXT NOT NULL,
eta_vrf_0 TEXT NOT NULL,
eta_vrf_1 TEXT NOT NULL,
leader_vrf_0 TEXT NOT NULL,
leader_vrf_1 TEXT NOT NULL,
block_size INTEGER NOT NULL,
block_body_hash TEXT NOT NULL,
pool_opcert TEXT NOT NULL,
unknown_0 INTEGER NOT NULL,
unknown_1 INTEGER NOT NULL,
unknown_2 TEXT NOT NULL,
protocol_major_version INTEGER NOT NULL,
protocol_minor_version INTEGER NOT NULL,
orphaned INTEGER NOT NULL DEFAULT 0 ,
pool_id TEXT NOT NULL DEFAULT ââ,
block_vrf_0 TEXT NOT NULL DEFAULT ââ,
block_vrf_1 TEXT NOT NULL DEFAULT ââ
);
CREATE INDEX idx_chain_slot_number ON chain(slot_number);
CREATE INDEX idx_chain_orphaned ON chain(orphaned);
CREATE INDEX idx_chain_hash ON chain(hash);
CREATE INDEX idx_chain_block_number ON chain(block_number);
CREATE INDEX idx_chain_node_vkey ON chain(node_vkey);
CREATE INDEX idx_chain_pool_id ON chain(pool_id);
Are the leader_vrf_0 values that cncli database stores not the proper leader vrf values?
The leader_vrf_1 values are empty and I donât know what eta_vrf_0 or eta_vrf_1 values represent.
Can anyone explain this?
Is there some other way to look up what the leader vrf values were for each block in a slot battle? The system logs donât show these values and nor does pooltool when it shows the slot battle winner.