provenance-io / explorer-service

The server side of the blockchain Explorer app. Allows for UI browsing of the blockchain.
Apache License 2.0
6 stars 3 forks source link

Fix group save tx processing #531

Closed nullpointer0x00 closed 2 months ago

nullpointer0x00 commented 2 months ago

Description

This PR addresses an issue with the saveGroups processing in transaction handling. Previously, due to the changes introduced in cosmos-sdk v50, the removal of logs from block results caused failures in loading all transactions into the database. This led to the explorer showing no transactions for blocks containing at least one group-related transaction after the v1.19.0 Provenance release.

The fix implemented here uses events for a block's transactions and the new msg index attribute, ensuring backward compatibility. It allows the re-processing of blocks prior to v1.19.0 where logs were available but the msg index attribute was not.

Additionally, this PR moves GroupSave processing to the groups service, laying the groundwork for a more robust test suite. While the test suite still needs further development, the ability to re-run transactions using saved JSON files from a gRPC endpoint will significantly speed up debugging in the future. This pattern can also be applied in other areas of the project.

Other improvements include enhanced logging for retries and proper saving of the error block. Previously, the error block wasn't updated on retries, making it difficult to track changes in errors. Now, the error block will always be updated correctly during retries.

closes: #528 closes: #529


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.