-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Preserve message proofs post-regenesis (#1891)
Related tickets: - Closes #1877 This PR adds block Merkle data and metadata to the list of migrated tables during regenesis. Creating a snapshot now inlcudes the `FuelBlockMerkleData` and `FuelBlockMerkleMetadata` tables. Loading the snapshot writes the `FuelBlockMerkleData` and `FuelBlockMerkleMetadata` snapshot tables to the `OldFuelBlockMerkleData` and `OldFuelBlockMerkleMetadata` database tables respectively (2 new tables added to the off-chain database). When querying for a message proof, we check the block height of the query. If the requested message proof is for block height at or above the regenesis block height, we continue to use the on-chain database for data lookups. If it is instead lower than the regenesis block height, we then check the off-chain database for the `Old` tables. This PR also refactors the block proof logic to rely on a new trait called `DatabaseMerklizedBlocks` which provides an interface for querying block related Merkle data. Specifically, this includes retrieving Merkle block data and metadata, and loading the block Merkle tree. The `DatabaseMessageProof` is now implemented by default for any type that implements this trait, which include the on-chain and off-chain databases that define the corresponding tables. This PR is intended to not be a breaking change. ## Checklist - [ ] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: xgreenx <xgreenx9999@gmail.com>
- Loading branch information
Showing
12 changed files
with
301 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.