Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version v0.23.0
Added
impl
of traitsStorageWrite
andStorageRead
forStructuredStorage
. Tables that use aBlueprint
can be read and written using these interfaces provided by structured storage types.Merklized
blueprint that maintains the binary Merkle tree over the storage data. It supports only the insertion of the objects without removing them.ContractsInfo
table fromfuel-vm
to on-chain tables, and created version-ableContractsInfoType
to act as the table's data type.Changed
ContractsInfo
table.fuel-vm
0.46.0.FuelBlockIdsToHeights
is moved to the off-chain worker.Receipts
table. Instead, receipts are part of theTransactionStatuses
table.AtomicView
in all services for consistent results.libp2p
modulesAtomicView
in theTxPool
to read the state of the database during insertion of the transactions.BlockHeight
as a primary key for theFuelsBlock
table.NetworkBehaviour
macro generateFuelBehaviorEvent
in p2pBlockImporter
instead of the executor.cargo doc
passes in the CI.Breaking
#1725: All API endpoints now are prefixed with
/v1
version. New usage looks like:/v1/playground
,/v1/graphql
,/v1/graphql-sub
,/v1/metrics
,/v1/health
.#1722: Bugfix: Zero
predicate_gas_used
field during validation of the produced block.#1714: The change bumps the
fuel-vm
to0.47.1
. It breaks several breaking changes into the protocol:Transaction
doesn't define the gas price anymore. The gas price is defined by the block producer and recorded in theMint
transaction at the end of the block. A price of future blocks can be fetched through a new API nedopoint and the price of the last block can be fetch or via the block or another API endpoint.GasPrice
policy is replaced with theTip
policy. The user may specify in the native tokens how much he wants to pay the block producer to include his transaction in the block. It is the prioritization mechanism to incentivize the block producer to include users transactions earlier.MaxFee
policy is mandatory to set. Without it, the transaction pool will reject the transaction. Since the block producer defines the gas price, the only way to control how much user agreed to pay can be done only through this policy.maturity
field is removed from theInput::Coin
. The same affect can be achieve with theMaturity
policy on the transaction and predicate. This changes breaks how input coin is created and removes the passing of this argument.Checked<Tx>
doesn't containmax_fee
andmin_fee
anymore. Onlymax_gas
andmin_gas
. Themax_fee
is controlled by the user via theMaxFee
policy.impl
of traitsStorageWrite
andStorageRead
forStructuredStorage
. Tables that use aBlueprint
can be read and written using these interfaces provided by structured storage types.#1712: Make
ContractUtxoInfo
type a version-able enum for use in theContractsLatestUtxo
table.#1657: Changed
CROO
gas price type fromWord
toDependentGasPrice
. The dependent gas price values are dummy values while awaiting updated benchmarks.#1671: The GraphQL API uses block height instead of the block id where it is possible. The transaction status contains
block_height
instead of theblock_id
.#1675: Simplify GQL schema by disabling contract resolvers in most cases, and just return a ContractId scalar instead.
#1658: Receipts are part of the transaction status.
Removed
reason
from theTransactionExecutionResult::Failed
. It can be calculated based on the program state and receipts.Also, it is not possible to fetch
receipts
from theTransaction
directly anymore. Instead, you need to fetchstatus
and its receipts.#1646: Remove redundant receipts from queries.
#1639: Make Merkle metadata, i.e.
SparseMerkleMetadata
andDenseMerkleMetadata
type version-able enums#1632: Make
Message
type a version-able enum#1631: Modify api endpoint to dry run multiple transactions.
#1629: Use a separate database for each data domain. Each database has its own folder where data is stored.
#1628: Make
CompressedCoin
type a version-able enum#1616: Make
BlockHeader
type a version-able enum#1614: Use the default consensus key regardless of trigger mode. The change is breaking because it removes the
--dev-keys
argument. If thedebug
flag is set, the default consensus key will be used, regardless of the trigger mode.#1596: Make
Consensus
type a version-able enum#1593: Make
Block
type a version-able enum#1576: The change moves the implementation of the storage traits for required tables from
fuel-core
tofuel-core-storage
crate. The change also adds a more flexible configuration of the encoding/decoding per the table and allows the implementation of specific behaviors for the table in a much easier way. It unifies the encoding between database, SMTs, and iteration, preventing mismatching bytes representation on the Rust type system level. Plus, it increases the re-usage of the code by applying the same blueprint to other tables.It is a breaking PR because it changes database encoding/decoding for some tables.
StructuredStorage
The change adds a new type
StructuredStorage
. It is a wrapper around the key-value storage that implements the storage traits(StorageInspect
,StorageMutate
,StorageRead
, etc) for the tables with blueprint. This blueprint works in tandem with theTableWithBlueprint
trait. The table may implementTableWithBlueprint
specifying the blueprint, as an example:It is a definition of the blueprint for the
ContractsRawCode
table. It has a plain blueprint meaning it simply encodes/decodes bytes and stores/loads them into/from the storage. As a key codec and value codec, it uses aRaw
encoding/decoding that simplifies writing bytes and loads them back into the memory without applying any serialization or deserialization algorithm.If the table implements
TableWithBlueprint
and the selected codec satisfies all blueprint requirements, the corresponding storage traits for that table are implemented on theStructuredStorage
type.Codecs
Each blueprint allows customizing the key and value codecs. It allows the use of different codecs for different tables, taking into account the complexity and weight of the data and providing a way of more optimal implementation.
That property may be very useful to perform migration in a more easier way. Plus, it also can be a
no_std
migration potentially allowing its fraud proving.An example of migration:
Structures
The blueprint of the table defines its behavior. As an example, a
Plain
blueprint simply encodes/decodes bytes and stores/loads them into/from the storage. TheSMT
blueprint builds a sparse merkle tree on top of the key-value pairs.Implementing a blueprint one time, we can apply it to any table satisfying the requirements of this blueprint. It increases the re-usage of the code and minimizes duplication.
It can be useful if we decide to create global roots for all required tables that are used in fraud proving.
Side changes
iter_all
The
iter_all
functionality now accepts the table instead ofK
andV
generics. It is done to use the correct codec during deserialization. Also, the table definition provides the column.Duplicated unit tests
The
fuel-core-storage
crate provides macros that generate unit tests. Almost all tables had the same test likeget
,insert
,remove
,exist
. All duplicated tests were moved to macros. The unique one still stays at the same place where it was before.StorageBatchMutate
Added a new
StorageBatchMutate
trait that we can move tofuel-storage
crate later. It allows batch operations on the storage. It may be more performant in some cases.#1573: Remove nested p2p request/response encoding. Only breaks p2p networking compatibility with older fuel-core versions, but is otherwise fully internal.
What's Changed
cargo update
by @github-actions in Weeklycargo update
#1557KeyValueStore
trait by @xgreenx in Remove duplicating logic in theKeyValueStore
trait #1559KeyValueStore
to thefuel-core-storage
crate by @xgreenx in MoveKeyValueStore
to thefuel-core-storage
crate #1566libp2p
from0.50.0
to0.53.1
by @MitchTurner in Updatelibp2p
from0.50.0
to0.53.1
#1379cargo update
by @github-actions in Weeklycargo update
#1575cargo update
by @github-actions in Weeklycargo update
#1578BlockImporter
instead of the executor by @xgreenx in Moved insertion of the blocks into theBlockImporter
instead of the executor #1577NetworkBehaviour
macro generateFuelBehaviorEvent
in p2p by @MitchTurner in LetNetworkBehaviour
macro generateFuelBehaviorEvent
in p2p #1585cargo update
by @github-actions in Weeklycargo update
#1588Block
versionable by @MitchTurner in MakeBlock
versionable #1593cargo update
by @github-actions in Weeklycargo update
#1599fuel-core-storage
crate by @xgreenx in Move storage traits implementation to thefuel-core-storage
crate #1576BlockHeight
as a primary key for theFuelsBlock
table by @xgreenx in UseBlockHeight
as a primary key for theFuelsBlock
table #1587AtomicView
in theTxPool
by @xgreenx in UseAtomicView
in theTxPool
#1590cargo update
by @github-actions in Weeklycargo update
#1611Consensus
version-able by @MitchTurner in MakeConsensus
version-able #1596BlockHeader
a versionable enum by @MitchTurner in MakeBlockHeader
a versionable enum #1616AtomicView
in all services by @xgreenx in UseAtomicView
in all services #1612cargo update
by @github-actions in Weeklycargo update
#1634Message
by @bvrooman in feat: VersionableMessage
#1632cargo update
by @github-actions in Weeklycargo update
#1644cargo update
by @github-actions in Weeklycargo update
#16550.22.1
release by @xgreenx in Duplication of the0.22.1
release #1665cargo update
by @github-actions in Weeklycargo update
#1682FuelBlockSecondaryKeyBlockHeights
table to an off-chain worker by @xgreenx in Extraction of theFuelBlockSecondaryKeyBlockHeights
table to an off-chain worker #1671cargo update
by @github-actions in Weeklycargo update
#1707ContractInfo
table and versionableContractInfoType
to on-chain storage by @bvrooman in feat: AddContractInfo
table and versionableContractInfoType
to on-chain storage #1657ContractUtxoInfo
for theContractsLatestUtxo
table by @bvrooman in feat: VersionableContractUtxoInfo
for theContractsLatestUtxo
table #1712cargo update
by @github-actions in Weeklycargo update
#1719fuel-vm
dep to 0.47.1 by @MitchTurner in Bumpfuel-vm
dep to 0.47.1 #1714utxo_validation
fails by @bvrooman in Bugfix: Calling of the contract with enabledutxo_validation
fails #1717predicate_gas_used
field during validation of the produced block by @xgreenx in Bugfix: Zeropredicate_gas_used
field during validation of the produced block #1722New Contributors
Full Changelog: v0.22.0...v0.23.0