Fix chain_state tracking for empty blocks (v1.4.4)#106
Fix chain_state tracking for empty blocks (v1.4.4)#106papadritta wants to merge 4 commits intonamada-net:masterfrom
Conversation
In v1.4.4, commit 3f9ee6c introduced an optimization to skip committing empty blocks. However, this caused chain_state to stop updating during sequences of empty blocks, making the indexer appear frozen even though it continued processing blocks internally. This fix maintains the performance optimization while ensuring chain_state updates for all blocks by: - Adding fast-path commit for empty blocks (skips expensive MASP processing) - Removing the skip logic that prevented chain_state updates - Preserving API visibility of indexer progress Fixes progress tracking regression introduced in v1.4.4.
this is not true.
this PR doesn't optimize anything. it just reverts the changes introduced by commit 3f9ee6c in a contrived way. the whole point of those changes were to avoid unnecessarily querying postgres. another advantage of only advancing to heights that contain masp txs is that you don't need to waste time syncing empty blocks. the height pointed to by |
|
I'll be closing this PR, since IMO these changes will result in a performance regression with no added benefit (outside of the convenience of monitoring the health of the service from an HTTP endpoint vs. parsing logs through grafana or smth) |
|
@sug0 Got it, thanks for explaining the reasoning behind this. Makes sense now. |
Problem
In v1.4.4, commit
3f9ee6cintroduced an optimization to skip committing empty blocks. However, this causedchain_stateto stop updating during sequences of empty blocks, making the indexer appear frozen even though it continued processing blocks internally.Impact:
Solution
This fix maintains the performance optimization while ensuring
chain_stateupdates for all blocks by:chain_stateupdatesFixes progress tracking regression introduced in v1.4.4.
Testing
Checked on Mainnet:
namada.5f5de2dd1b88cba30586420chain_stateupdates continuously through empty blocksChecked on Testnet:
housefire-alpaca.cc0d3e0c033beBoth deployments show correct behavior with the fix applied.