Use inputs/outputs instead of events to compress blocks (#3071)
## Linked Issues/PRs <!-- List of related issues/PRs --> closes https://github.com/FuelLabs/fuel-core/issues/3066 ## Description <!-- List of detailed changes --> The `UninitializedCompressionService` relies on the the validation of old blocks. The problem is that if the block was committed too long ago, we can't reproduce the state before it was committed. This will cause the compression service to break if we are trying to sync old blocks. This removes the need to get the events from execution and instead gets the correct information from inputs and outputs of the block in storage. This code also improves the performance by sorting all the UTxOs used in each block before looking up the tx_pointer for each tx. So it's O(N) instead of O(N^2). ### Note: I didn't add any new tests since this should have parity with the old behavior. It might be nice to add a test for the case where we are behind state rewind? ### Before requesting review - [x] I have reviewed the code myself ### Followup Issues The work done in this PR wasn't meant to add any behavior, so we didn't add any tests. But it clarified some places we were missing coverage, so I've created a followup issue: https://github.com/FuelLabs/fuel-core/issues/3073
M
Mitchell Turner committed
d53296c9e3df0c1d9fea4730e3b8737529422011
Parent: 01d562e
Committed by GitHub <noreply@github.com>
on 8/2/2025, 5:18:01 PM