-
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
Versioning of the protocol-required database types #1552
Labels
epic
An epic is a high-level master issue for large pieces of work.
SDK team
The issue is ready to be addressed by SDK team
upgradability
Comments
xgreenx
added
SDK team
The issue is ready to be addressed by SDK team
upgradability
labels
Dec 14, 2023
xgreenx
changed the title
Versioning of the protocol required database types
Versioning of the protocol-required database types
Dec 14, 2023
bvrooman
pushed a commit
that referenced
this issue
Jan 29, 2024
Related issues: - #1552 This PR converts the `Message` struct to an enum that can house multiple variants for versioning. Version variants contain an instance of a versioned struct, e.g., `MessageV1`. The `Message` enum exposes getters to the underlying data and abstracts the version. Setters are exposed only in test environments to allow tests to set up `Messages` in specific ways for the test. --------- Co-authored-by: Green Baneling <[email protected]>
xgreenx
pushed a commit
that referenced
this issue
Jan 31, 2024
Related issues: - #1552 --------- Co-authored-by: Matt <[email protected]>
xgreenx
added
the
epic
An epic is a high-level master issue for large pieces of work.
label
Feb 4, 2024
xgreenx
pushed a commit
that referenced
this issue
Feb 28, 2024
…ble (#1712) Related issues: - #1552 This PR remodels the existing `ContractUtxoInfo` type as an enum for the purpose of representing different versions of the data. This PR introduces `ContractUtxoInfoV1` which simply holds the existing data types for `ContractUtxoInfo`. This allows the `ContractsLatestUtxo` table to now use a versioned data type.
This was referenced Mar 18, 2024
crypto523
added a commit
to crypto523/fuel-core
that referenced
this issue
Oct 7, 2024
Related issues: - FuelLabs/fuel-core#1552
crypto523
added a commit
to crypto523/fuel-core
that referenced
this issue
Oct 7, 2024
Related issues: - FuelLabs/fuel-core#1552 This PR converts the `Message` struct to an enum that can house multiple variants for versioning. Version variants contain an instance of a versioned struct, e.g., `MessageV1`. The `Message` enum exposes getters to the underlying data and abstracts the version. Setters are exposed only in test environments to allow tests to set up `Messages` in specific ways for the test. --------- Co-authored-by: Green Baneling <[email protected]>
crypto523
added a commit
to crypto523/fuel-core
that referenced
this issue
Oct 7, 2024
…ble (#1712) Related issues: - FuelLabs/fuel-core#1552 This PR remodels the existing `ContractUtxoInfo` type as an enum for the purpose of representing different versions of the data. This PR introduces `ContractUtxoInfoV1` which simply holds the existing data types for `ContractUtxoInfo`. This allows the `ContractsLatestUtxo` table to now use a versioned data type.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
epic
An epic is a high-level master issue for large pieces of work.
SDK team
The issue is ready to be addressed by SDK team
upgradability
Overview
In order to support upgrades, database types must support seamless versioning. For example, we must support the ability to change the key type and/or value type of a given table while maintaining backwards compatibility with existing data.
Database tables:
CompressedCoin
ContractsAssetsNote:ContractsAssets::Value
will always be aWord
Value:Word
ContractsAssetsMerkleDataNote:sparse::Primitive
does not need to be versionedValue:fuel_merkle::sparse::Primitive
SparseMerkleMetadata
(Salt, Bytes32)
ContractUtxoInfo
for theContractsLatestUtxo
table #1712)ContractUtxoInfo
ContractsRawCodeNote:ContractsRawCode::Value
will always be a[u8]
Value:[u8]
(write)OwnedValue:Contract
(read)Bytes32
ContractsStateMerkleDataNote:sparse::Primitive
does not need to be versionedValue:fuel_merkle::sparse::Primitive
SparseMerkleMetadata
FuelBlockMerkleDataNote:binary::Primitive
does not need to be versionedValue:fuel_merkle::binary::Primitive
DenseMerkleMetadata
Block
versionable #1593)CompressedBlock
Message
#1632)Message
()
()
Transaction
Implementation
For each database type:
MakeMappable::Key
versionableMappable::Value
versionableUse
non_exhaustive
for enums.Note: Double-check that we spend one byte to store discriminant of the enum
The text was updated successfully, but these errors were encountered: