refactor: improve transactions and messages storing #2
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.
Description
This PR completely changes how transactions and messages are stored inside the database.
All tables have changed their name to follow the table naming convention of using plurals instead of singular names:
validator
validators
block
blocks
pre_commit
pre_commits
transaction
transactions
message
messages
Also, the
transactions
andmessages
tables scheme have changed. Here are the new ones:Finally, a new table named
message_involved_addresses
has been introduced:The module
messages
has been removed, as messages are now stored inside the database when storing a transaction (without the need for an external module doing that).Two new methods have been added to the
parsecmd.Config
type:WithTransactionFilter
andWithMessageFilterBuilder
. These allow to specify specific filtering rules that will be used to determine whether a transaction or message should be stored or not inside the database.Finally, the
message.type
field now is populated usind the messagbe type URL generated by the Cosmos SDK, instead of the generic Proto name generated by gogoproto.Note
Due to the high breaking changes that this commit brings, we suggest dropping the database tables and migrating existing data using custom scripts. We do not provide a migration procedure for this update.
Checklist
Files changed
in the Github PR explorer.