Skip to content

Commit

Permalink
feat: Add some off chain tables to regenesis (#1786)
Browse files Browse the repository at this point in the history
related to: #1619 

Doesn't close the issue, still need to migrate a few tables.

The following tables are now part of regenesis:
OnChain:
* Transactions (saved in snapshot)

OffChain:
* TransactionStatuses (saved in snapshot)
* OwnedTransactions (saved in snapshot)
* OwnedMessageIds (derived from Messages in snapshot)
* OwnedCoins (derived from Coins in snapshot)
* ContractsInfo (derived from Transactions in snapshot)

We have open questions to @xgreenx: 
1. Should we regenesize `FuelBlockIdsToHeights`? We attempted it but it
caused issues with the "don't commit changes related to more than one
block" guard.
2. Also what about the restoring the following tables:
* Metadata
* Statistics
* All relayer tables
* ProcessedTransactions

There are opportunities for optimization, namely we're reading some
snapshot data twice (e.g. Transactions are read once to restore the
`Transactions` table and once to derive the `ContractsInfo` table). That
could probably be done in one go writing to both on chain and off chian
tables at once.

---------

Co-authored-by: Hannes Karppila <[email protected]>
Co-authored-by: xgreenx <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2024
1 parent 099853c commit a6b1ec1
Show file tree
Hide file tree
Showing 18 changed files with 980 additions and 660 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Description of the upcoming release here.

### Added

- [#1786](https://github.com/FuelLabs/fuel-core/pull/1786): Regenesis now includes off-chain tables.
- [#1716](https://github.com/FuelLabs/fuel-core/pull/1716): Added support of WASM state transition along with upgradable execution that works with native(std) and WASM(non-std) executors. The `fuel-core` now requires a `wasm32-unknown-unknown` target to build.
- [#1770](https://github.com/FuelLabs/fuel-core/pull/1770): Add the new L1 event type for forced transactions.
- [#1767](https://github.com/FuelLabs/fuel-core/pull/1767): Added consensus parameters version and state transition version to the `ApplicationHeader` to describe what was used to produce this block.
Expand Down
1 change: 1 addition & 0 deletions bin/fuel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ tracing-subscriber = { workspace = true, features = [
url = { version = "2.2", optional = true }

[dev-dependencies]
fuel-core = { workspace = true, features = ["test-helpers"] }
fuel-core-types = { workspace = true, features = ["test-helpers"] }
pretty_assertions = { workspace = true }
rand = { workspace = true }
Expand Down
Loading

0 comments on commit a6b1ec1

Please sign in to comment.