Releases: FuelLabs/fuel-core
v0.26.0
Version v0.26.0
Fixed
Breaking
- #1868: Include the
event_inbox_root
in the header hash. Changed types of thetransactions_count
tou16
andmessage_receipt_count
tou32
instead ofu64
. Updated the application hash root calculation to not pad numbers. - #1866: Fixed a runtime panic that occurred when restarting a node. The panic happens when the relayer database is already populated, and the relayer attempts an empty commit during start up. This invalid commit is removed in this PR.
- #1871: Fixed
block
endpoint to return fetch the blocks from both databases after regenesis. - #1856: Replaced instances of
Union
withEnum
for GraphQL definitions ofConsensusParametersVersion
and related types. This is needed becauseUnion
does not support multipleVersion
s inside discriminants or empty variants. - #1870: Fixed benchmarks for the
0.25.3
. - #1870: Improves the performance of getting the size of the contract from the
InMemoryTransaction
. - #1851: Provided migration capabilities (enabled addition of new column families) to RocksDB instance.
Added
- #1853: Added a test case to verify the database's behavior when new columns are added to the RocksDB database.
- #1860: Regenesis now preserves
FuelBlockIdsToHeights
off-chain table.
Changed
- #1847: Simplify the validation interface to use
Block
. RemoveValidation
variant ofExecutionKind
. - #1832: Snapshot generation can be cancelled. Progress is also reported.
- #1837: Refactor the executor and separate validation from the other use cases
What's Changed
- Weekly
cargo update
by @github-actions in #1850 - Refactor/separate validation from other executions by @MitchTurner in #1837
- fix: Use
Enum
forConsensusParametersVersion
and related types by @bvrooman in #1856 - feat: snapshot generation graceful shutdown by @segfault-magnet in #1832
- regenesis: migrate FuelBlockIdsToHeights by @Dentosal in #1860
- Weekly
cargo update
by @github-actions in #1869 - Refactor/Simplify validation logic by @MitchTurner in #1847
- Fixed
block
endpoint to return fetch the blocks from both databases after regenesis by @xgreenx in #1871 - Add Eq and Partial Eq to tx response and status by @MujkicA in #1872
- test: restart with relayer data by @bvrooman in #1866
- Fix
BlockHeader
hash by @MitchTurner in #1868 - Added a test for the case of adding new columns into the existing RocksDB database by @xgreenx in #1853
- Fixed benchmarks for the
0.25.3
by @xgreenx in #1870 - Release v0.26.0 by @xgreenx in #1874
Full Changelog: v0.25.3...v0.26.0
v0.25.3
v0.24.3
v0.25.2
Version v0.25.1
Fixed
- #1844: Fixed the publishing of the
fuel-core 0.25.1
release. - 1842: Ignore RUSTSEC-2024-0336:
rustls::ConnectionCommon::complete_io
could fall into an infinite loop based on network - #1840: Fixed the publishing of the
fuel-core 0.25.0
release. - #1821: Can handle missing tables in snapshot.
- #1814: Bugfix: the
iter_all_by_prefix
was not working for all tables. The change adds aRust
level filtering.
Added
- #1831: Included the total gas and fee used by transaction into
TransactionStatus
. - #1821: Propagate shutdown signal to (re)genesis. Also add progress bar for (re)genesis.
- #1813: Added back support for
/health
endpoint. - #1799: Snapshot creation is now concurrent.
- #1811: Regenesis now preserves old blocks and transactions for GraphQL API.
Changed
- #1833: Regenesis of
SpentMessages
andProcessedTransactions
. - #1830: Use versioning enum for WASM executor input and output.
- #1816: Updated the upgradable executor to fetch the state transition bytecode from the database when the version doesn't match a native one. This change enables the WASM executor in the "production" build and requires a
wasm32-unknown-unknown
target. - #1812: Follow-up PR to simplify the logic around parallel snapshot creation.
- #1809: Fetch
ConsensusParameters
from the database - #1808: Fetch consensus parameters from the provider.
Breaking
- #1826: The changes make the state transition bytecode part of the
ChainConfig
. It guarantees the state transition's availability for the network's first blocks.
The change has many minor improvements in different areas related to the state transition bytecode:-
The state transition bytecode lies in its own file(
state_transition_bytecode.wasm
) along with the chain config file. TheChainConfig
loads it automatically whenChainConfig::load
is called and pushes it back whenChainConfig::write
is called. -
The
fuel-core
release bundle also contains thefuel-core-wasm-executor.wasm
file of the corresponding executor version. -
The regenesis process now considers the last block produced by the previous network. When we create a (re)genesis block of a new network, it has the
height = last_block_of_old_netowkr + 1
. It continues the old network and doesn't overlap blocks(before, we hadold_block.height == new_genesis_block.hegiht
). -
Along with the new block height, the regenesis process also increases the state transition bytecode and consensus parameters versions. It guarantees that a new network doesn't use values from the previous network and allows us not to migrate
StateTransitionBytecodeVersions
andConsensusParametersVersions
tables. -
Added a new CLI argument,
native-executor-version,
that allows overriding of the default version of the native executor. It can be useful for side rollups that have their own history of executor upgrades. -
Replaced:
let file = std::fs::File::open(path)?; let mut snapshot: Self = serde_json::from_reader(&file)?;
with a:
let mut json = String::new(); std::fs::File::open(&path) .with_context(|| format!("Could not open snapshot file: {path:?}"))? .read_to_string(&mut json)?; let mut snapshot: Self = serde_json::from_str(json.as_str())?;
because it is 100 times faster for big JSON files.
-
Updated all tests to use
Config::local_node_*
instead of working with theSnapshotReader
directly. It is the preparation of the tests for the futures bumps of theExecutor::VERSION
. When we increase the version, all tests continue to useGenesisBlock.state_transition_bytecode = 0
while the version is different, which forces the usage of the WASM executor, while for tests, we still prefer to test native execution. TheConfig::local_node_*
handles it and forces the executor to use the native version. -
Reworked the
build.rs
file of the upgradable executor. The script now caches WASM bytecode to avoid recompilation. Also, fixed the issue with outdated WASM bytecode. The script reacts on any modifications of thefuel-core-wasm-executor
and forces recompilation (it is why we need the cache), so WASM bytecode always is actual now.
-
- #1822: Removed support of
Create
transaction from debugger since it doesn't have any script to execute. - #1822: Use
fuel-vm 0.49.0
with new transactions types -Upgrade
andUpload
. Also addedmax_bytecode_subsections
field to theConsensusParameters
to limit the number of bytecode subsections in the state transition bytecode. - #1816: Updated the upgradable executor to fetch the state transition bytecode from the database when the version doesn't match a native one. This change enables the WASM executor in the "production" build and requires a
wasm32-unknown-unknown
target.
What's Changed
- Add PR template by @Dentosal in #1806
- feat: Parallellize snapshot creation by @segfault-magnet in #1799
- Follow-up PR to simplify the logic around parallel snapshot creation by @xgreenx in #1812
- Bugfix: the
iter_all_by_prefix
was not working for all tables by @xgreenx in #1814 - Added back support for
/health
endpoint by @xgreenx in #1813 - Fetch consensus parameters from the provider by @xgreenx in #1808
- Fetch
ConsensusParameters
from the database by @xgreenx in #1809 - Handle FTI messages in executor by @Voxelot in #1787
- Use state transition bytecode from the database by @xgreenx in #1816
- feat: (re)genesis graceful shutdown by @segfault-magnet in #1821
- Use
fuel-vm 0.49.0
with new transactions types by @xgreenx in #1822 - Included the total gas and fee into
TransactionStatus
by @xgreenx in #1831 - Use versioning enum for WASM executor input and output by @xgreenx in #1830
- Support upgradability of the consensus parameters and state transition bytecode in genesis by @xgreenx in #1826
- Store old blocks and txs after regenesis by @Dentosal in #1811
- Regenesis of
SpentMessages
andProcessedTransactions
by @xgreenx in #1833 - Release v0.25.0 by @xgreenx in #1839
- Fixed the publishing of the
fuel-core 0.25.0
by @xgreenx in #1840 - Release v0.25.1 by @xgreenx in #1841
- Ignore vulnerability
RUSTSEC-2024-0336
by @MitchTurner in #1842 - Fixed the publishing of the
fuel-core 0.25.1
by @xgreenx in #1844 - Release v0.25.2 by @xgreenx in #1845
Full Changelog: v0.24.2...v0.25.2
v0.24.2
Version v0.24.2
Changed
Breaking
- #1798: add nonce to relayed transactions and also hash full messages in the inbox root.
Fixed
- #1802: Fixed a runtime panic that occurred when restarting a node. The panic was caused by an invalid database commit while loading an existing off-chain database. The invalid commit is removed in this PR.
- #1803: Produce block when da height haven't changed.
- #1795: Fixed the building of the
fuel-core-wasm-executor
to work outside of thefuel-core
context. The change uses the path to the manifest file of thefuel-core-upgradable-executor
to build thefuel-core-wasm-executor
instead of relying on the workspace.
What's Changed
- Weekly
cargo update
by @github-actions in #1794 - Improvements for the
fuel-core-upgradable-executor
build script by @xgreenx in #1795 - Use full hash for messages in inbox_root and add nonce to relayed transactions by @Voxelot in #1798
- Modify block producer to take into account the total gas used by the L1 transactions by @MitchTurner in #1785
- Fix: Produce block when da height haven't changed by @xgreenx in #1803
- fix: Fix commit error on GraphQL service startup by @bvrooman in #1802
- Release v0.24.2 by @xgreenx in #1805
Full Changelog: v0.24.1...v0.24.2
v0.24.1
Version v0.24.1
Added
- #1786: Regenesis now includes off-chain tables.
- #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 awasm32-unknown-unknown
target to build. - #1770: Add the new L1 event type for forced transactions.
- #1767: Added consensus parameters version and state transition version to the
ApplicationHeader
to describe what was used to produce this block. - #1760: Added tests to verify that the network operates with a custom chain id and base asset id.
- #1752: Add
ProducerGasPrice
trait that theProducer
depends on to get the gas price for the block. - #1747: The DA block height is now included in the genesis state.
- #1740: Remove optional fields from genesis configs
- #1737: Remove temporary tables for calculating roots during genesis.
- #1731: Expose
schema.sdl
fromfuel-core-client
.
Changed
Breaking
-
#1771: Contract 'states' and 'balances' brought back into
ContractConfig
. Parquet now writes a file per table. -
1779: Modify Relayer service to order Events from L1 by block index
-
#1783: The PR upgrade
fuel-vm
to0.48.0
release. Because of some breaking changes, we also adapted our codebase to follow them:- Implementation of
Default
for configs was moved under thetest-helpers
feature. Thefuel-core
binary uses testnet configuration instead ofDefault::default
(for cases whenChainConfig
was not provided by the user). - All parameter types are enums now and require corresponding modifications across the codebase(we need to use getters and setters). The GraphQL API remains the same for simplicity, but each parameter now has one more field -
version
, that can be used to decide how to deserialize. - The
UtxoId
type now is 34 bytes instead of 33. It affects hex representation and requires adding00
. - The
block_gas_limit
was moved toConsensusParameters
fromChainConfig
. It means the block producer doesn't specify the block gas limit anymore, and we don't need to propagate this information. - The
bytecodeLength
field is removed from theCreate
transaction. - Removed
ConsensusParameters
from executor config becauseConsensusParameters::default
is not available anymore. Instead, executors fetchConsensusParameters
from the database.
- Implementation of
-
#1769: Include new field on header for the merkle root of imported events. Rename other message root field.
-
#1768: Moved
ContractsInfo
table to the off-chain database. Removedsalt
field from theContractConfig
. -
#1761: Adjustments to the upcoming testnet configs:
- Decreased the max size of the contract/predicate/script to be 100KB.
- Decreased the max size of the transaction to be 110KB.
- Decreased the max number of storage slots to be 1760(110KB / 64).
- Removed fake coins from the genesis state.
- Renamed folders to be "testnet" and "dev-testnet".
- The name of the networks are "Upgradable Testnet" and "Upgradable Dev Testnet".
-
#1694: The change moves the database transaction logic from the
fuel-core
to thefuel-core-storage
level. The corresponding issue described the reason behind it.Technical details of implementation
-
The change splits the
KeyValueStore
intoKeyValueInspect
andKeyValueMutate
, as well theBlueprint
intoBlueprintInspect
andBlueprintMutate
. It allows requiring less restricted constraints for any read-related operations. -
One of the main ideas of the change is to allow for the actual storage only to implement
KeyValueInspect
andModifiable
without theKeyValueMutate
. It simplifies work with the databases and provides a safe way of interacting with them (Modification into the database can only go through theModifiable::commit_changes
). This feature is used to track the height of each database during commits and even limit how commits are done, providing additional safety. This part of the change was done as a separate commit. -
The
StorageTransaction
is aStructuredStorage
that usesInMemoryTransaction
inside to accumulate modifications. OnlyInMemoryTransaction
has a real implementation of theKeyValueMutate
(Other types only implement it in tests). -
The implementation of the
Modifiable
for theDatabase
contains a business logic that provides additional safety but limits the usage of the database. TheDatabase
now tracks its height and is responsible for its updates. In thecommit_changes
function, it analyzes the changes that were done and tries to find a new height(For example, in the case of theOnChain
database, we are looking for a newBlock
in theFuelBlocks
table). -
As was planned in the issue, now the executor has full control over how commits to the storage are done.
-
All mutation methods now require
&mut self
- exclusive ownership over the object to be able to write into it. It almost negates the chance of concurrent modification of the storage, but it is still possible since theDatabase
implements theClone
trait. To be sure that we don't corrupt the state of the database, thecommit_changes
function implements additional safety checks to be sure that we commit updates per each height only once time. -
Side changes:
- The
drop
function was moved fromDatabase
toRocksDB
as a preparation for the state rewind since the read view should also keep the drop function until it is destroyed. - The
StatisticTable
table lives in the off-chain worker. - Removed duplication of the
Database
from thedap::ConcreteStorage
since it is already available from the VM. - The executor return only produced
Changes
instead of the storage transaction, which simplifies the interaction between modules and port definition. - The logic related to the iteration over the storage is moved to the
fuel-core-storage
crate and is now reusable. It provides aninterator
method that duplicates the logic fromMemoryStore
on iterating over theBTreeMap
and methods likeiter_all
,iter_all_by_prefix
, etc. It was done in a separate revivable commit. - The
MemoryTransactionView
is fully replaced by theStorageTransactionInner
. - Removed
flush
method from theDatabase
since it is not needed after #1664.
- The
-
-
#1693: The change separates the initial chain state from the chain config and stores them in separate files when generating a snapshot. The state snapshot can be generated in a new format where parquet is used for compression and indexing while postcard is used for encoding. This enables importing in a stream like fashion which reduces memory requirements. Json encoding is still supported to enable easy manual setup. However, parquet is prefered for large state files.
Snapshot command
The CLI was expanded to allow customizing the used encoding. Snapshots are now generated along with a metadata file describing the encoding used. The metadata file contains encoding details as well as the location of additional files inside the snapshot directory containing the actual data. The chain config is always generated in the JSON format.
The snapshot command now has the '--output-directory' for specifying where to save the snapshot.
Run command
The run command now includes the 'db_prune' flag which when provided will prune the existing db and start genesis from the provided snapshot metadata file or the local testnet configuration.
The snapshot metadata file contains paths to the chain config file and files containing chain state items (coins, messages, contracts, contract states, and balances), which are loaded via streaming.
Each item group in the genesis process is handled by a separate worker, allowing for parallel loading. Workers stream file contents in batches.
A database transaction is committed every time an item group is succesfully loaded. Resumability is achieved by recording the last loaded group index within the same db tx. If loading is aborted, the remaining workers are shutdown. Upon restart, workers resume from the last processed group.
Contract States and Balances
Using uniform-sized batches may result in batches containing items from multiple contracts. Optimal performance can presumably be achieved by selecting a batch size that typically encompasses an entire contract's state or balance, allowing for immediate initialization of relevant Merkle trees.
Removed
v0.22.4
Version v0.22.4
Added
- #1743: Added blacklisting of the transactions on the
TxPool
level.--tx-blacklist-addresses <TX_BLACKLIST_ADDRESSES> The list of banned addresses ignored by the `TxPool` [env: TX_BLACKLIST_ADDRESSES=] --tx-blacklist-coins <TX_BLACKLIST_COINS> The list of banned coins ignored by the `TxPool` [env: TX_BLACKLIST_COINS=] --tx-blacklist-messages <TX_BLACKLIST_MESSAGES> The list of banned messages ignored by the `TxPool` [env: TX_BLACKLIST_MESSAGES=] --tx-blacklist-contracts <TX_BLACKLIST_CONTRACTS> The list of banned contracts ignored by the `TxPool` [env: TX_BLACKLIST_CONTRACTS=]
What's Changed
Full Changelog: v0.22.3...v0.22.4
v0.22.3
v0.22.2
v0.23.0
Version v0.23.0
Added
- #1713: Added automatic
impl
of traitsStorageWrite
andStorageRead
forStructuredStorage
. Tables that use aBlueprint
can be read and written using these interfaces provided by structured storage types. - #1671: Added a new
Merklized
blueprint that maintains the binary Merkle tree over the storage data. It supports only the insertion of the objects without removing them. - #1657: Moved
ContractsInfo
table fromfuel-vm
to on-chain tables, and created version-ableContractsInfoType
to 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
ContractsInfo
table. - #1657: Upgrade to
fuel-vm
0.46.0. - #1671: The logic related to the
FuelBlockIdsToHeights
is moved to the off-chain worker. - #1663: Reduce the punishment criteria for mempool gossipping.
- #1658: Removed
Receipts
table. Instead, receipts are part of theTransactionStatuses
table. - #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
AtomicView
in all services for consistent results. - #1597: Unify namespacing for
libp2p
modules - #1591: Simplify libp2p dependencies and not depend on all sub modules directly.
- #1590: Use
AtomicView
in theTxPool
to read the state of the database during insertion of the transactions. - #1587: Use
BlockHeight
as a primary key for theFuelsBlock
table. - #1585: Let
NetworkBehaviour
macro generateFuelBehaviorEvent
in 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
BlockImporter
instead 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 doc
passes in the CI. - #1636: Add more docs to GraphQL DAP API.
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:- 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
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. - The
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. - The
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. - The
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. - The metadata of the
Checked<Tx>
doesn't containmax_fee
andmin_fee
anymore. Onlymax_gas
andmin_gas
. Themax_fee
is controlled by the user via theMaxFee
policy. - Added automatic
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.
Removedreason
from theTransactionExecutionResult::Failed
. It can be calculated based on the program state and receipts.
Also, it is not possible to fetchreceipts
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...