Patch/parser updates for fixing message parsers #468
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR contains a few bug fixes and parser updates. It also has updates to support fixing old message types that have errors and prevent them from happening in the future.
Parser Updates
MsgWithdrawValidatorCommission
We are using a new event to get the receiver address for Validator commission. The old event was searching for the
withdraw_commission
event, which was turning up blank in later Osmosis blocks. We now look for thecoin_received
event to get the proper address.Fixing this in old blocks will require to run the indexer with the
--re-index-message-type "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission"
option set.Closes #460
MsgSplitRouteSwapExactAmountIn
This is a complex swap. The parser will gather token in and token out from the event structure.
MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition
This is a delegation action provided in Superfluid. We have decided to ignore Superfluid, so we add this one to the ignore list and only index the fees as normal.
Transaction Indexer DB Loop CreateOrUpdate
The transaction DB loop will now do CreateOrUpdate operations rather than a CreateOrFind. This was an unfinished aspect of the reindexing feature of the application that was preventing updates from happening when reindexing old blocks.
Better Indexer Error Passing
Event GetValueForAttribute Error Raise
The GetValueForAttribute util function will now return an error if the attribute was not found. This was originally silently passing an empty string if the attribute was not found, which was the original cause of the MsgWithdrawValidatorCommission error.
Throw Failed Block when Message Parser or Ignore List Entry Missing
When a parser or ignore list entry was not found for a message (i.e. we have encountered a new message we have never seen before), we would originally just output a Log saying so. This PR changes this so that an error is passed up. This will cause the block to fail and we will be able to track down missing message types easier.
CSV Parsers for Osmosis Pool Manager Swaps
This PR adds CSV parsers for all CSV formats for the Osmosis Pool Manager Swaps.