Skip to content

Commit

Permalink
fix: remove all feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc committed Jan 15, 2025
1 parent 22e2afc commit 9e19ab5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
1 change: 0 additions & 1 deletion bin/fuel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ production = [
"parquet",
"aws-kms",
]
fault-proving = ["fuel-core-compression/fault-proving"]
1 change: 0 additions & 1 deletion crates/compression/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ test-helpers = [
"fuel-core-types/random",
"fuel-core-types/std",
]
fault-proving = []
2 changes: 1 addition & 1 deletion crates/compression/src/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
let transactions = target.compress_with(&mut ctx).await?;
let registrations: RegistrationsPerTable = ctx.finalize()?;

Ok(VersionedCompressedBlock::new(
Ok(VersionedCompressedBlock::new_v1(
block.header(),
registrations,
transactions,
Expand Down
24 changes: 14 additions & 10 deletions crates/compression/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ pub use config::Config;
use enum_dispatch::enum_dispatch;
pub use registry::RegistryKeyspace;

use crate::compressed_block_payload::v0::CompressedBlockPayloadV0;
#[cfg(feature = "fault-proving")]
use crate::compressed_block_payload::v1::CompressedBlockPayloadV1;
use crate::compressed_block_payload::{
v0::CompressedBlockPayloadV0,
v1::CompressedBlockPayloadV1,
};
use fuel_core_types::{
blockchain::{
header::{
Expand Down Expand Up @@ -51,23 +52,27 @@ pub trait VersionedBlockPayload {
#[enum_dispatch(VersionedBlockPayload)]
pub enum VersionedCompressedBlock {
V0(CompressedBlockPayloadV0),
#[cfg(feature = "fault-proving")]
V1(CompressedBlockPayloadV1),
}

impl VersionedCompressedBlock {
fn new(
fn new_v0(
header: &BlockHeader,
registrations: RegistrationsPerTable,
transactions: Vec<CompressedTransaction>,
) -> Self {
#[cfg(not(feature = "fault-proving"))]
return Self::V0(CompressedBlockPayloadV0::new(
Self::V0(CompressedBlockPayloadV0::new(
header,
registrations,
transactions,
));
#[cfg(feature = "fault-proving")]
))
}

fn new_v1(
header: &BlockHeader,
registrations: RegistrationsPerTable,
transactions: Vec<CompressedTransaction>,
) -> Self {
Self::V1(CompressedBlockPayloadV1::new(
header,
registrations,
Expand Down Expand Up @@ -240,7 +245,6 @@ mod tests {
});
}

#[cfg(feature = "fault-proving")]
#[test]
fn postcard_roundtrip_v1() {
use compressed_block_payload::v1::{
Expand Down
1 change: 0 additions & 1 deletion crates/fuel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,3 @@ test-helpers = [
# features to enable in production, but increase build times
rocksdb-production = ["rocksdb", "rocksdb/jemalloc"]
wasm-executor = ["fuel-core-upgradable-executor/wasm-executor"]
fault-proving = ["fuel-core-compression/fault-proving"]

0 comments on commit 9e19ab5

Please sign in to comment.