Version v0.23.0
Added
- #1713: Added automatic
implof traitsStorageWriteandStorageReadforStructuredStorage. Tables that use aBlueprintcan be read and written using these interfaces provided by structured storage types. - #1671: Added a new
Merklizedblueprint that maintains the binary Merkle tree over the storage data. It supports only the insertion of the objects without removing them. - #1657: Moved
ContractsInfotable fromfuel-vmto on-chain tables, and created version-ableContractsInfoTypeto act as the table's data type.
Changed
- #1723: Notify about imported blocks from the off-chain worker.
- #1717: The fix for the #1657 to include the contract into
ContractsInfotable. - #1657: Upgrade to
fuel-vm0.46.0. - #1671: The logic related to the
FuelBlockIdsToHeightsis moved to the off-chain worker. - #1663: Reduce the punishment criteria for mempool gossipping.
- #1658: Removed
Receiptstable. Instead, receipts are part of theTransactionStatusestable. - #1640: Upgrade to fuel-vm 0.45.0.
- #1635: Move updating of the owned messages and coins to off-chain worker.
- #1650: Add api endpoint for getting estimates for future gas prices
- #1649: Add api endpoint for getting latest gas price
- #1600: Upgrade to fuel-vm 0.45.0
- #1633: Notify services about importing of the genesis block.
- #1625: Making relayer independent from the executor and preparation for the force transaction inclusion.
- #1613: Add api endpoint to retrieve a message by its nonce.
- #1612: Use
AtomicViewin all services for consistent results. - #1597: Unify namespacing for
libp2pmodules - #1591: Simplify libp2p dependencies and not depend on all sub modules directly.
- #1590: Use
AtomicViewin theTxPoolto read the state of the database during insertion of the transactions. - #1587: Use
BlockHeightas a primary key for theFuelsBlocktable. - #1585: Let
NetworkBehaviourmacro generateFuelBehaviorEventin p2p - #1579: The change extracts the off-chain-related logic from the executor and moves it to the GraphQL off-chain worker. It creates two new concepts - Off-chain and On-chain databases where the GraphQL worker has exclusive ownership of the database and may modify it without intersecting with the On-chain database.
- #1577: Moved insertion of sealed blocks into the
BlockImporterinstead of the executor. - #1574: Penalizes peers for sending invalid responses or for not replying at all.
- #1601: Fix formatting in docs and check that
cargo docpasses in the CI. - #1636: Add more docs to GraphQL DAP API.
Breaking
-
#1725: All API endpoints now are prefixed with
/v1version. New usage looks like:/v1/playground,/v1/graphql,/v1/graphql-sub,/v1/metrics,/v1/health. -
#1722: Bugfix: Zero
predicate_gas_usedfield during validation of the produced block. -
#1714: The change bumps the
fuel-vmto0.47.1. It breaks several breaking changes into the protocol:- All malleable fields are zero during the execution and unavailable through the GTF getters. Accessing them via the memory directly is still possible, but they are zero.
- The
Transactiondoesn't define the gas price anymore. The gas price is defined by the block producer and recorded in theMinttransaction 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. - The
GasPricepolicy is replaced with theTippolicy. 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. - The
MaxFeepolicy 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. - The
maturityfield is removed from theInput::Coin. The same affect can be achieve with theMaturitypolicy on the transaction and predicate. This changes breaks how input coin is created and removes the passing of this argument. - The metadata of the
Checked<Tx>doesn't containmax_feeandmin_feeanymore. Onlymax_gasandmin_gas. Themax_feeis controlled by the user via theMaxFeepolicy. - Added automatic
implof traitsStorageWriteandStorageReadforStructuredStorage. Tables that use aBlueprintcan be read and written using these interfaces provided by structured storage types.
-
#1712: Make
ContractUtxoInfotype a version-able enum for use in theContractsLatestUtxotable. -
#1657: Changed
CROOgas price type fromWordtoDependentGasPrice. 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_heightinstead 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.
Removedreasonfrom theTransactionExecutionResult::Failed. It can be calculated based on the program state and receipts.
Also, it is not possible to fetchreceiptsfrom theTransactiondirectly anymore. Instead, you need to fetchstatusand its receipts. -
#1646: Remove redundant receipts from queries.
-
#1639: Make Merkle metadata, i.e.
SparseMerkleMetadataandDenseMerkleMetadatatype version-able enums -
#1632: Make
Messagetype 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
CompressedCointype a version-able enum -
#1616: Make
BlockHeadertype a version-able enum -
#1614: Use the default consensus key regardless of trigger mode. The change is breaking because it removes the
--dev-keysargument. If thedebugflag is set, the default consensus key will be used, regardless of the trigger mode. -
#1596: Make
Consensustype a version-able enum -
#1593: Make
Blocktype a version-able enum -
#1576: The change moves the implementation of the storage traits for required tables from
fuel-coretofuel-core-storagecrate. 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 theTableWithBlueprinttrait. The table may implementTableWithBlueprintspecifying the blueprint, as an example:impl TableWithBlueprint for ContractsRawCode { type Blueprint = Plain<Raw, Raw>; fn column() -> Column { Column::ContractsRawCode } }
It is a definition of the blueprint for the
ContractsRawCodetable. 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 aRawencoding/decoding that simplifies writing bytes and loads them back into the memory without applying any serialization or deserialization algorithm.If the table implements
TableWithBlueprintand the selected codec satisfies all blueprint requirements, the corresponding storage traits for that table are implemented on theStructuredStoragetype.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_stdmigration potentially allowing its fraud proving.An example of migration:
/// Define the table for V1 value encoding/decoding. impl TableWithBlueprint for ContractsRawCodeV1 { type Blueprint = Plain<Raw, Raw>; fn column() -> Column { Column::ContractsRawCode } } /// Define the table for V2 value encoding/decoding. /// It uses `Postcard` codec for the value instead of `Raw` codec. /// /// # Dev-note: The columns is the same. impl TableWithBlueprint for ContractsRawCodeV2 { type Blueprint = Plain<Raw, Postcard>; fn column() -> Column { Column::ContractsRawCode } } fn migration(storage: &mut Database) { let mut iter = storage.iter_all::<ContractsRawCodeV1>(None); while let Ok((key, value)) = iter.next() { // Insert into the same table but with another codec. storage.storage::<ContractsRawCodeV2>().insert(key, value); } }
Structures
The blueprint of the table defines its behavior. As an example, a
Plainblueprint simply encodes/decodes bytes and stores/loads them into/from the storage. TheSMTblueprint 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.
impl TableWithBlueprint for SpentMessages { type Blueprint = Plain<Raw, Postcard>; fn column() -> Column { Column::SpentMessages } } | | \|/ impl TableWithBlueprint for SpentMessages { type Blueprint = Sparse<Raw, Postcard, SpentMessagesMerkleMetadata, SpentMessagesMerkleNodes>; fn column() -> Column { Column::SpentMessages } }
Side changes
iter_allThe
iter_allfunctionality now accepts the table instead ofKandVgenerics. It is done to use the correct codec during deserialization. Also, the table definition provides the column.Duplicated unit tests
The
fuel-core-storagecrate 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.StorageBatchMutateAdded a new
StorageBatchMutatetrait that we can move tofuel-storagecrate 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
- Fix the example tx in README.md by @Dentosal in #1543
- Weekly
cargo updateby @github-actions in #1557 - Update LICENSE by @Voxelot in #1558
- Remove duplicating logic in the
KeyValueStoretrait by @xgreenx in #1559 - Move
KeyValueStoreto thefuel-core-storagecrate by @xgreenx in #1566 - Update
libp2pfrom0.50.0to0.53.1by @MitchTurner in #1379 - Weekly
cargo updateby @github-actions in #1575 - Weekly
cargo updateby @github-actions in #1578 - Moved insertion of the blocks into the
BlockImporterinstead of the executor by @xgreenx in #1577 - Let
NetworkBehaviourmacro generateFuelBehaviorEventin p2p by @MitchTurner in #1585 - Remove RustSec Ignore for RUSTSEC-2022-0093 by @MitchTurner in #1586
- Simplify p2p request/response message serialization by @Dentosal in #1573
- Weekly
cargo updateby @github-actions in #1588 - Depend on libp2p directly instead of submodules by @MitchTurner in #1591
- Make
Blockversionable by @MitchTurner in #1593 - Switch katyo/publish-crates@v2 to xgreenx/publish-crates@v1 for the CI by @Dentosal in #1603
- Weekly
cargo updateby @github-actions in #1599 - Fix cargo doc, check for cargo doc in the CI by @Dentosal in #1601
- Move storage traits implementation to the
fuel-core-storagecrate by @xgreenx in #1576 - Extract off chain logic from the executor by @xgreenx in #1579
- Applying comments from the PR for the storage crate by @xgreenx in #1610
- Use
BlockHeightas a primary key for theFuelsBlocktable by @xgreenx in #1587 - Use
AtomicViewin theTxPoolby @xgreenx in #1590 - Unify namespacing in P2P codebase by @MitchTurner in #1597
- Weekly
cargo updateby @github-actions in #1611 - Make
Consensusversion-able by @MitchTurner in #1596 - feat: add api endpoint to retrieve messages by nonce by @matt-user in #1613
- Update Docker tags for Flux integration by @liviudm in #1617
- Remove dev consensus key by @MujkicA in #1614
- Make
BlockHeadera versionable enum by @MitchTurner in #1616 - feat: Versionable CompressedCoin by @bvrooman in #1628
- Use
AtomicViewin all services by @xgreenx in #1612 - Notify services about importing of the genesis block by @xgreenx in #1633
- Weekly
cargo updateby @github-actions in #1634 - feat: Versionable
Messageby @bvrooman in #1632 - Making relayer independent from the executor by @xgreenx in #1625
- Upgrade to the fuel-vm 0.44.0 by @Dentosal in #1600
- Upgrade to fuel-vm 0.45.0 by @MitchTurner in #1640
- feat: Versionable Merkle metadata by @bvrooman in #1639
- Add docs for GraphQL DAP endpoints by @Dentosal in #1636
- Use a separate database for each data domain by @xgreenx in #1629
- feat: dry run multiple transactions by @matt-user in #1631
- Weekly
cargo updateby @github-actions in #1644 - Decrease peer reputation on request timeouts and decode errors by @Dentosal in #1574
- refactor: remove redudant receipts queries by @matt-user in #1646
- Latest gas price endpoint by @MitchTurner in #1649
- Estimate gas price API Endpoint by @MitchTurner in #1650
- Fix for the race condition with tx status and receipts by @xgreenx in #1658
- Bump up rust to 1.75 by @MitchTurner in #1656
- Weekly
cargo updateby @github-actions in #1655 - Duplication of the
0.22.1release by @xgreenx in #1665 - Move updating of the owned messages and coins to off-chain worker by @xgreenx in #1635
- Weekly
cargo updateby @github-actions in #1682 - Remove nested contract resolvers in GQL schema by @Voxelot in #1675
- Soften txpool p2p reputation requirements by @Voxelot in #1663
- Remove failing deployment job by @Voxelot in #1692
- chore: format cargo tomls and add ci check by @segfault-magnet in #1691
- Extraction of the
FuelBlockSecondaryKeyBlockHeightstable to an off-chain worker by @xgreenx in #1671 - Weekly
cargo updateby @github-actions in #1707 - Increase liveness probe timeout to 5 minutes by @rfuelsh in #1709
- feat: Add
ContractInfotable and versionableContractInfoTypeto on-chain storage by @bvrooman in #1657 - feat: Versionable
ContractUtxoInfofor theContractsLatestUtxotable by @bvrooman in #1712 - Weekly
cargo updateby @github-actions in #1719 - Bump
fuel-vmdep to 0.47.1 by @MitchTurner in #1714 - Bugfix: Calling of the contract with enabled
utxo_validationfails by @bvrooman in #1717 - Bugfix: Zero
predicate_gas_usedfield during validation of the produced block by @xgreenx in #1722 - Notify about imported blocks from the off-chain worker by @xgreenx in #1723
- Added versioning suffix to the GraphQL endpoint by @xgreenx in #1725
- Release v0.23.0 by @xgreenx in #1726
- Use a right version of the release
0.23.0by @xgreenx in #1728
New Contributors
Full Changelog: v0.22.0...v0.23.0