Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [2387](https://github.com/FuelLabs/fuel-core/pull/2387): Update description `tx-max-depth` flag.
- [2630](https://github.com/FuelLabs/fuel-core/pull/2630): Removed some noisy `tracing::info!` logs
- [2643](https://github.com/FuelLabs/fuel-core/pull/2643): Before this fix when tip is zero, transactions that use 30M have the same priority as transactions with 1M gas. Now they are correctly ordered.
- [2659](https://github.com/FuelLabs/fuel-core/pull/2659): Replace `derivative` crate with `educe` crate.

### Breaking
- [2661](https://github.com/FuelLabs/fuel-core/pull/2661): Dry run now supports running in past blocks. `dry_run_opt` method now takes block number as the last argument. To retain old behavior, simply pass in `None` for the last argument.
Expand Down
66 changes: 34 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ async-trait = "0.1"
aws-sdk-kms = "1.37"
cynic = { version = "3.1.0", features = ["http-reqwest"] }
clap = "4.4"
derivative = { version = "2" }
derive_more = { version = "0.99" }
educe = { version = "0.6", default-features = false, features = [
"Eq",
"PartialEq",
"Hash",
"Debug",
] }
derive_more = { version = "1", features = ["into", "from", "display"] }
enum_dispatch = "0.3.13"
enum-iterator = "1.2"
hex = { version = "0.4", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/chain-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = "Fuel Chain config types"
[dependencies]
anyhow = { workspace = true }
bech32 = { version = "0.9.0", default-features = false, optional = true }
derivative = { workspace = true }
educe = { workspace = true }
fuel-core-storage = { workspace = true, features = ["alloc"] }
fuel-core-types = { workspace = true, default-features = false, features = [
"alloc",
Expand Down
7 changes: 4 additions & 3 deletions crates/chain-config/src/config/chain.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use educe::Educe;
use fuel_core_storage::MerkleRoot;
use fuel_core_types::{
blockchain::header::StateTransitionBytecodeVersion,
Expand Down Expand Up @@ -28,8 +29,8 @@ use crate::SnapshotMetadata;
pub const LOCAL_TESTNET: &str = "local_testnet";
pub const BYTECODE_NAME: &str = "state_transition_bytecode.wasm";

#[derive(Clone, derivative::Derivative, Deserialize, Serialize, Eq, PartialEq)]
#[derivative(Debug)]
#[derive(Clone, Educe, Deserialize, Serialize, Eq, PartialEq)]
#[educe(Debug)]
pub struct ChainConfig {
pub chain_name: String,
pub consensus_parameters: ConsensusParameters,
Expand All @@ -39,7 +40,7 @@ pub struct ChainConfig {
/// Note: The state transition bytecode is stored in a separate file
/// under the `BYTECODE_NAME` name in serialization form.
#[serde(skip)]
#[derivative(Debug(format_with = "fmt_truncated_hex::<16>"))]
#[educe(Debug(method(fmt_truncated_hex::<16>)))]
pub state_transition_bytecode: Vec<u8>,
pub consensus: ConsensusConfig,
}
Expand Down
26 changes: 12 additions & 14 deletions crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,28 @@ use fuel_core_types::services::executor::Error as ExecutorError;
#[allow(missing_docs)]
pub enum Error {
/// Error occurred during serialization or deserialization of the entity.
#[display(fmt = "error performing serialization or deserialization")]
#[display("error performing serialization or deserialization")]
Codec,
/// The version of database or data is invalid (possibly not migrated).
#[display(
fmt = "Invalid database version, expected {expected:#x}, found {found:#x}"
)]
#[display("Invalid database version, expected {expected:#x}, found {found:#x}")]
InvalidDatabaseVersion {
/// the current database version
found: u32,
/// the database version expected by this build of fuel-core
expected: u32,
},
/// Multiple heights found in the commit to the database.
#[display(fmt = "Multiple heights found in the commit {heights:?}")]
#[display("Multiple heights found in the commit {heights:?}")]
MultipleHeightsInCommit {
/// List of heights found in the commit.
heights: Vec<u64>,
},
/// Failed to advance the height.
#[display(fmt = "Failed to advance the height")]
#[display("Failed to advance the height")]
FailedToAdvanceHeight,
/// The new and old heights are not linked.
#[display(
fmt = "New and old heights are not linked: prev_height: {prev_height:#x}, new_height: {new_height:#x}"
"New and old heights are not linked: prev_height: {prev_height:#x}, new_height: {new_height:#x}"
)]
HeightsAreNotLinked {
/// The old height.
Expand All @@ -53,35 +51,35 @@ pub enum Error {
},
/// The new height is not found, but the old height is set.
#[display(
fmt = "The new height is not found, but the old height is set: prev_height: {prev_height:#x}"
"The new height is not found, but the old height is set: prev_height: {prev_height:#x}"
)]
NewHeightIsNotSet {
/// The old height known by the database.
prev_height: u64,
},
#[display(fmt = "The historical database doesn't have any history yet")]
#[display("The historical database doesn't have any history yet")]
NoHistoryIsAvailable,
#[display(
fmt = "The historical database doesn't have history for the requested height {requested_height:#x}, \
"The historical database doesn't have history for the requested height {requested_height:#x}, \
the oldest available height is {oldest_available_height:#x}"
)]
NoHistoryForRequestedHeight {
requested_height: u64,
oldest_available_height: u64,
},
#[display(fmt = "Reached the end of the history")]
#[display("Reached the end of the history")]
ReachedEndOfHistory,

#[cfg(feature = "backup")]
#[display(fmt = "BackupEngine initialization error: {}", _0)]
#[display("BackupEngine initialization error: {}", _0)]
BackupEngineInitError(anyhow::Error),

#[cfg(feature = "backup")]
#[display(fmt = "Backup error: {}", _0)]
#[display("Backup error: {}", _0)]
BackupError(anyhow::Error),

#[cfg(feature = "backup")]
#[display(fmt = "Restore error: {}", _0)]
#[display("Restore error: {}", _0)]
RestoreError(anyhow::Error),

/// Not related to database error.
Expand Down
Loading
Loading