<p>You can also check the logs on your block producer or on a relay.</p>
<p>This is how a slot battle looks like in the logs (it happened less than half an hour ago):</p>
<pre><code>Dec 22 07:16:53 relay4 bash[3623433]: #033[35m[relay4:cardano.node.ChainDB:Notice:365]#033[0m [2021-12-22 07:16:53.43 UTC] Chain extended, new tip: 701733ec51d44a307341e9fecb3ae7b921b3a8529fffcf1cda958aeaac813c9c at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[34m[relay4:cardano.node.ChainDB:Info:365]#033[0m [2021-12-22 07:16:53.60 UTC] Block fits onto some fork: 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[34m[relay4:cardano.node.ChainDB:Info:365]#033[0m [2021-12-22 07:16:53.66 UTC] Valid candidate 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[35m[relay4:cardano.node.ChainDB:Notice:365]#033[0m [2021-12-22 07:16:53.66 UTC] Switched to a fork, new tip: 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122
</code></pre>

CC BY-SA 4.0
2021-12-22T07:43:29.870Z
2021-12-22T07:43:29.870Z
George - APEX Stake Pool
<p>db-sync doesn't track forks so can't be analyzed to identify slot battles. There are some 3rd party tools, such as cncli that do track forks so you can analyze the data from the view of one of your nodes. Note that it can only be analyzed if it's running when it happens though. Here's a reference video that could help in understanding what they are, why they occur and how to analyze them using cncli and sqlite queries: <a href="https://www.youtube.com/watch?v=Cm5pBM7UYa0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Cm5pBM7UYa0</a></p>

CC BY-SA 4.0
2021-12-16T14:40:07.607Z
2021-12-16T14:40:07.607Z
Samuel Leathers
<p>On a relay node running cardano-node install cncli and get it fully sync'ed.</p>
<p>Query the cncli database using sqlite:</p>
<pre><code>sqlite3 cncli.db

.schema chain

select id, block_number, slot_number, hash, pool_id, orphaned from chain where pool_id = 'the_poolid_you_want_to_check' and orphaned = 1;
</code></pre>
<p>That should give you some ideas.</p>

CC BY-SA 4.0
2021-12-17T14:02:07.980Z
2021-12-17T14:02:07.980Z
74d4
<p>I wanted a way to check if a pool is having some sort of slot dispute with somebody else's pool for the right to mine a block.
I couldn't find a solution for that, maybe using dbsync I don't know exactly if its possible to check that information without be the owner of that pool in question.
I'm accepting suggestions or directions on how to query these block disputes for a pool analysis tool we are creating.</p>
<p>thank you</p>

CC BY-SA 4.0
2022-08-12T06:22:33.987Z
`db-sync` only records accepted blocks. Blocks that are rolled back are removed from the database before the roll forward.
Erik de Castro Lopo
<cardano-node><cardano-db-sync>
About slot battles and db sync
# About slot battles and db sync

(Asked by: username_0 on 2021-12-15)

I wanted a way to check if a pool is having some sort of slot dispute with somebody else's pool for the right to mine a block.
I couldn't find a solution for that, maybe using dbsync I don't know exactly if its possible to check that information without be the owner of that pool in question.
I'm accepting suggestions or directions on how to query these block disputes for a pool analysis tool we are creating.

thank you

**Tags:** cardano-node, cardano-db-sync
> **Comments:**
> **username_1**: `db-sync` only records accepted blocks. Blocks that are rolled back are removed from the database before the roll forward.  

---

## 3 answers

### Answer by username_2 on 2021-12-22. Score: 1

You can also check the logs on your block producer or on a relay.
This is how a slot battle looks like in the logs (it happened less than half an hour ago):
Dec 22 07:16:53 relay4 bash[3623433]: #033[35m[relay4:cardano.node.ChainDB:Notice:365]#033[0m [2021-12-22 07:16:53.43 UTC] Chain extended, new tip: 701733ec51d44a307341e9fecb3ae7b921b3a8529fffcf1cda958aeaac813c9c at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[34m[relay4:cardano.node.ChainDB:Info:365]#033[0m [2021-12-22 07:16:53.60 UTC] Block fits onto some fork: 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[34m[relay4:cardano.node.ChainDB:Info:365]#033[0m [2021-12-22 07:16:53.66 UTC] Valid candidate 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122
Dec 22 07:16:53 relay4 bash[3623433]: #033[35m[relay4:cardano.node.ChainDB:Notice:365]#033[0m [2021-12-22 07:16:53.66 UTC] Switched to a fork, new tip: 0cd72eebab15a4e66b3225694928938362c0aef931186ea5aaeffd9830753c63 at slot 48591122


---

### Answer by username_3 on 2021-12-16. Score: 0

db-sync doesn't track forks so can't be analyzed to identify slot battles. There are some 3rd party tools, such as cncli that do track forks so you can analyze the data from the view of one of your nodes. Note that it can only be analyzed if it's running when it happens though. Here's a reference video that could help in understanding what they are, why they occur and how to analyze them using cncli and sqlite queries: <https://www.youtube.com/watch?v=Cm5pBM7UYa0>


---

### Answer by username_4 on 2021-12-17. Score: 0

On a relay node running cardano-node install cncli and get it fully sync'ed.
Query the cncli database using sqlite:
sqlite3 cncli.db

.schema chain

select id, block_number, slot_number, hash, pool_id, orphaned from chain where pool_id = 'the_poolid_you_want_to_check' and orphaned = 1;

That should give you some ideas.


---

