I'm syncronizing part of the sawtooth ledger with an external database by subscribing to events 'sawtooth/state-delta' and 'sawtooth/block-commit', so when a Fork accures I have to be able to recognize invalidated transactions as described in the documentation:
However, the state-delta events don't have any attribute referencing the block that generated them. The closest I've gotten is by looking at the sawtooth project:
https://github.com/hyperledger-archives/sawtooth-supply-chain.git
In that project is seems that events are grouped in "EventLists", and that if you subscribe to both to 'sawtooth/state-delta' and 'sawtooth/block-commit' events you can tell a delta event corresponds to a block if they are included in the same "EventList". The problem is that the documentation, as far as I can tell, does not guarantee this behavior.