-
Notifications
You must be signed in to change notification settings - Fork 10
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Description:
PR #118 have introduced versioned database types for block related data; the block header and transactions. The reason why we only versioned these types (instead of all the types for all the database tables) is because:
- other than the
HeadersandTransactionstables (and other block-specific tables), the values for the rest of the tables can actually be derived again from the re-execution the stored blocks. - if new fields are introduced to types like
Receipt, we won't be able to have those fields on olderReceipts. New fields may be added that that extend the capability of Katana and aren't tight to specific protocol changes (eg., l2 gas fields). These new fields/data can't be derived for older entries without performing a re-execution of their respective transactions. - versioning all the types would be a huge maintenance effort.
To complete the database migration feature we need to perform the re-execution of historical blocks. We should be able to take existing database and perform execution of all the blocks in the database.
Feature Request:
- Create a new crate called
migrationinside of <crates/storage>. Put all the logics related to database migration in this crate. - Don't integrate with
katana-nodeyet. We only want to create a standalone implementation that is easily testable and the output can be easily verified. - The migration implementation shouldn't rely on concrete database type (eg.,
DbEnvfor libmdbx implementation) it should only use the database abstraction traits defined in <crates/storage/db/src/abstraction> to perform any database related operations.
References:
- Versioned types can be found in <crates/storage/db/src/models/versioned>.
- Use the
katana-executorcrate to perform transaction execution. The executor implementation can be found in <crates/executor/src/implementation/blockifier/mod.rs>. An example of how to use the executor can be found in <crates/executor/tests/executor.rs>. - Before we can execute the blocks, we need to convert the database types to an executable types. Executable types can be found in <crates/primitives/src/transaction.rs> and <crates/primitives/src/block.rs>.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request