Closed AndreMiras closed 1 year ago
This looks correct (as far as the SDK is concerned) - it's emitted as two separate events, on for the jail
and one for the slash
. That first event you're seeing is the slash - jailing doesn't mandate slashing, and neither does slashing require jailing.
https://github.com/cosmos/cosmos-sdk/blob/main/x/slashing/keeper/keeper.go#L120-L128
https://github.com/cosmos/cosmos-sdk/blob/main/x/slashing/keeper/keeper.go#L140-L145
Hey @codehans, thanks a mil for getting back so fast and sharing this piece of code, that makes sense. I guess I came across more downtime slashing events which in this case send the jailed key part of the other attributes. https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/x/slashing/keeper/infractions.go#L91-L100 So I assumed this was the norm, but I see now. Pretty crazy that double signing wouldn't always lead to jailing, or maybe it should/does, but that's more a CosmosSDK discussion.
I was exploring slashing events of Kujira lately and I came across something I'm not sure if it's a bug or a feature. Also I'm not sure if it's more a Tendermint bug (fixed in more recent release) or Kujira specific. At block 267445 there's a double signing slashing event on kujiravalcons1zrvl0kldjjuj9z996kak3sju08vyhj8tzy4e5s. However the event is split in 2 while I'm expecting it to be merged as a single object. This is what I get:
And this is what I was expecting:
I've shared below a snippet that I hope clarifies what I mean:
I tried to keep third party dependencies small. Code is ran this way:
And here is a screenshot of the run on the left and the code on the right.