-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SpentMessages table #1829
Remove SpentMessages table #1829
Conversation
are we removing spent messages due to the extra hassle of regenesis migration? We had that table to provide extra redundancy protection against double spending messages in case of any relayer hiccups. Are we just going to rely on the relayer offchain tables to track included events now? I guess this should be ok, since we pass the events through the executor now instead of letting the relayer directly update the onchain tables. |
We added the However, with a new flow, the relayer writes all events into the The new flow provides the same protection by default because relayer hiccups/pruning no longer affect the |
/// The possible states a Message can be in | ||
pub enum MessageState { | ||
/// Message is still unspent | ||
pub enum MessageStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, I forgot that it affects the GraphQL API endpoint. Hmm, we need to find a way to still support this endpoint because the bridge relies on it.
Maybe we need to move this table to off-chain database instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm in that case I'm probably just going to redo the whole PR.
tx.storage::<ProcessedTransactions>() | ||
.insert(&transaction.key, &())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this migration even shouldn't exist because we have OldTransactions
for that. I think we forgot to remove it during #1811.
Hmm, it seems we need to migrate the ProcessedTransactions
table instead of fetching it from OldTransactions
because we can't rely on off-chain data during migration. Off-chain data migration is optional and only for nodes that want to support GraphQL API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-implementation of the #1829 Work towards #1790 The change migrates the `ProcessedTransactions` table as part of the on-chain snapshot. Since it is used to validate blocks, the root of all processed transactions must be part of the `Genesis` structure along with messages, coins, and contracts. The changes also moved `SpentMessages` from the on-chain database to the off-chain database since now it is only used for the GraphQL API. ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Re-implementation of the FuelLabs/fuel-core#1829 Work towards FuelLabs/fuel-core#1790 The change migrates the `ProcessedTransactions` table as part of the on-chain snapshot. Since it is used to validate blocks, the root of all processed transactions must be part of the `Genesis` structure along with messages, coins, and contracts. The changes also moved `SpentMessages` from the on-chain database to the off-chain database since now it is only used for the GraphQL API. ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Re-implementation of the FuelLabs/fuel-core#1829 Work towards FuelLabs/fuel-core#1790 The change migrates the `ProcessedTransactions` table as part of the on-chain snapshot. Since it is used to validate blocks, the root of all processed transactions must be part of the `Genesis` structure along with messages, coins, and contracts. The changes also moved `SpentMessages` from the on-chain database to the off-chain database since now it is only used for the GraphQL API. ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: Hannes Karppila <hannes.karppila@gmail.com>
Work towards #1790
Depends on #1811
Removes
SpentMessages
table.Checklist
Before requesting review
Before merging
master