SIGN IN SIGN UP
FuelLabs / fuel-core UNCLAIMED

Rust full node implementation of the Fuel v2 protocol.

0 0 15 Rust

chore(compression): include registry root in compressed block header (#2909)

## Linked Issues/PRs
<!-- List of related issues/PRs -->
part of https://github.com/FuelLabs/fuel-core/issues/2232
closes https://github.com/FuelLabs/fuel-core/issues/2568

## Description
<!-- List of detailed changes -->
enhances the compression and decompression processes to handle a new
`registry_root` field.

### Feature flag `fault-proving` support:

*
[`.github/workflows/ci.yml`](diffhunk://#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR152-R153):
Added a new `nextest` command to run integration tests with the
`fault-proving` feature enabled.

### Compression and decompression updates:

*
[`crates/compression/src/compress.rs`](diffhunk://#diff-6d3f24703843ef40147c63bb3cd0f1fa8d6277ce298cc704d21514bdd480d552R44-R69):
Introduced conditional modules and traits for `CompressDb` based on the
`fault-proving` feature, and included `registry_root` in the compression
process.
[[1]](diffhunk://#diff-6d3f24703843ef40147c63bb3cd0f1fa8d6277ce298cc704d21514bdd480d552R44-R69)
[[2]](diffhunk://#diff-6d3f24703843ef40147c63bb3cd0f1fa8d6277ce298cc704d21514bdd480d552R96-R106)
*
[`crates/compression/src/decompress.rs`](diffhunk://#diff-d0b271dacdbc77c5808aab48fee0fa85f338d593e1adc25e8bd0205c370dd824R49-R71):
Added conditional modules and traits for `DecompressDb` and included
`registry_root` verification in the decompression process.
[[1]](diffhunk://#diff-d0b271dacdbc77c5808aab48fee0fa85f338d593e1adc25e8bd0205c370dd824R49-R71)
[[2]](diffhunk://#diff-d0b271dacdbc77c5808aab48fee0fa85f338d593e1adc25e8bd0205c370dd824R115-R131)

### Registry root handling:

*
[`crates/compression/src/compressed_block_payload/v1.rs`](diffhunk://#diff-d8d7fa8cb497931632674d904112a5bbea802757e71df7d92e06474a71463307R22-R24):
Added `RegistryRoot` type and included it in `CompressedBlockHeader` and
`CompressedBlockPayloadV1`.
[[1]](diffhunk://#diff-d8d7fa8cb497931632674d904112a5bbea802757e71df7d92e06474a71463307R22-R24)
[[2]](diffhunk://#diff-d8d7fa8cb497931632674d904112a5bbea802757e71df7d92e06474a71463307L32-R42)
[[3]](diffhunk://#diff-d8d7fa8cb497931632674d904112a5bbea802757e71df7d92e06474a71463307R64)
[[4]](diffhunk://#diff-d8d7fa8cb497931632674d904112a5bbea802757e71df7d92e06474a71463307R121-R124)
*
[`crates/compression/src/lib.rs`](diffhunk://#diff-be21606b619b01dffba7556a2716b7083b03ab1525dd249f6a517e92d16d27baR63-R64):
Updated `VersionedCompressedBlock` to handle `registry_root`.
[[1]](diffhunk://#diff-be21606b619b01dffba7556a2716b7083b03ab1525dd249f6a517e92d16d27baR63-R64)
[[2]](diffhunk://#diff-be21606b619b01dffba7556a2716b7083b03ab1525dd249f6a517e92d16d27baR77)

### Error handling and trait implementations:

*
[`crates/services/compression/src/errors.rs`](diffhunk://#diff-4e1e8a438c26f0ee9cde7ff8e033cb1ab58ffd3f5fad9dd5f39a74269a4a971cR32-R34):
Added a new error variant `FailedToComputeRegistryRoot`.
*
[`crates/services/compression/src/temporal_registry.rs`](diffhunk://#diff-390e459c3eb588077c8f7a95ae572fcf01a144a449ce1fbccf2d3dc61b489546R359-R517):
Implemented `ComputeRegistryRoot` trait and related methods for
computing and verifying `registry_root`.

### Configuration updates:

*
[`crates/services/compression/Cargo.toml`](diffhunk://#diff-3b348e1ded89f349afd45656ad5c57ebbab5e690f2bf64e059dd5d7c32de228dR45-R50):
Added `fault-proving` feature dependencies.
*
[`tests/Cargo.toml`](diffhunk://#diff-9abb8310fe65807f370f136db9528106606118c7e98654141b0bbd87b07639f7R95-R103):
Added `fault-proving` feature dependencies for testing.

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests
- [x] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [x] I have reviewed the code myself
- [x] I have created follow-up issues caused by this PR and linked them
here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
A
Aaryamann Challani committed
38c7a5851e4a07aec51bb449dcad657f6bd726e0
Parent: 6d7524d
Committed by GitHub <noreply@github.com> on 3/28/2025, 4:52:07 PM