Skip to content

Conversation

@Dentosal
Copy link
Member

@Dentosal Dentosal commented Feb 1, 2024

Part of FuelLabs/fuel-core#1605. See the corresponding fuel-core PR as well: FuelLabs/fuel-core#1609

This PR adds Compact derive macro and fuel-compression machinery, that are used to convert Transaction and contained types into CompressedTransaction and Compressed*. The compact types are equivalent to the original types, except that malleable fields are removed, and often-repeated types like AssetId and Address are converted to three-byte keys to a separate database, called temporal storage. UtxoIds (which are used only once) are converted to use TxPointer instead.

@Dentosal Dentosal added fuel-types Related to the `fuel-types` crate. mainnet labels Feb 1, 2024
@Dentosal Dentosal self-assigned this Feb 1, 2024
@Dentosal Dentosal mentioned this pull request Feb 1, 2024
6 tasks
@xgreenx xgreenx requested a review from a team February 19, 2024 18:11
Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you nice PR!=) It is cool that Compact can be derived almost for all types.

I feel like we put too many details about the implementation of the algorithm and how keys are created, and it seems we can simplify that part a lot to be agnostic. But the main with compaction looks good; I will review it one more time, more precisely when PR is in final shape.

BTW, compilation fails for me:

image

Copy link
Contributor

@bvrooman bvrooman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6/41 so far, will continue review at the next chance I get

@Dentosal Dentosal marked this pull request as ready for review July 22, 2024 16:57
@Dentosal Dentosal requested a review from xgreenx September 9, 2024 10:27
xgreenx
xgreenx previously approved these changes Sep 9, 2024
@xgreenx xgreenx requested a review from a team September 9, 2024 13:17
Co-authored-by: Rafał Chabowski <[email protected]>
Copy link
Contributor

@rafal-ch rafal-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Dentosal Dentosal added this pull request to the merge queue Sep 10, 2024
Merged via the queue into master with commit d28a143 Sep 10, 2024
@Dentosal Dentosal deleted the dento/da-compression branch September 10, 2024 08:29
xgreenx added a commit to FuelLabs/fuel-core that referenced this pull request Oct 5, 2024
Related #1605. VM PR
FuelLabs/fuel-vm#670.

This PR adds DA compression crate for Fuel blocks, performed upon block
creation. The compressed blocks are stored into the offchain database
and can be fetched using the GraphQL API.

## Note for reviewers

To keep this reasonably compact, decompression support is not included
in this PR, and will be done as a follow-up. As a result, the full data
roundtrip testing is not part of this PR. There's no proof here that
compression of full blocks is reversible.

## TODO
#### Features
- [x] Temporal registry db support
- [x] Optimize temporal registry eviction implementation
- [x] Implement TxId ↔ TxPointer lookups
- [x] Integrate with the block committer (GraphQL interface, probably)
#### Tests
- [x] compressed blocks are available from non-block-producer nodes
- [ ] e2e test for the full decompression cycle (moved to a follow-up)


## Follow-up issues
- Sync the node from L1:
#2208
- Decompression roudntrip tests
#2238
- Figure out which cache eviction algorithm/behavior is wanted:
#2231
- Figure out if we need to remove the compressed blocks from the db
after a while
- Merkle roots for fraud proofs
#2232

---------

Co-authored-by: Aaryamann Challani <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Rafał Chabowski <[email protected]>
kuroki-yosuke added a commit to kuroki-yosuke/core-fuel that referenced this pull request Apr 5, 2025
Related FuelLabs/fuel-core#1605. VM PR
FuelLabs/fuel-vm#670.

This PR adds DA compression crate for Fuel blocks, performed upon block
creation. The compressed blocks are stored into the offchain database
and can be fetched using the GraphQL API.

## Note for reviewers

To keep this reasonably compact, decompression support is not included
in this PR, and will be done as a follow-up. As a result, the full data
roundtrip testing is not part of this PR. There's no proof here that
compression of full blocks is reversible.

## TODO
#### Features
- [x] Temporal registry db support
- [x] Optimize temporal registry eviction implementation
- [x] Implement TxId ↔ TxPointer lookups
- [x] Integrate with the block committer (GraphQL interface, probably)
#### Tests
- [x] compressed blocks are available from non-block-producer nodes
- [ ] e2e test for the full decompression cycle (moved to a follow-up)


## Follow-up issues
- Sync the node from L1:
FuelLabs/fuel-core#2208
- Decompression roudntrip tests
FuelLabs/fuel-core#2238
- Figure out which cache eviction algorithm/behavior is wanted:
FuelLabs/fuel-core#2231
- Figure out if we need to remove the compressed blocks from the db
after a while
- Merkle roots for fraud proofs
FuelLabs/fuel-core#2232

---------

Co-authored-by: Aaryamann Challani <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Rafał Chabowski <[email protected]>
ChapmaBeerbohm added a commit to ChapmaBeerbohm/holo-kit that referenced this pull request Sep 26, 2025
Related FuelLabs/fuel-core#1605. VM PR
FuelLabs/fuel-vm#670.

This PR adds DA compression crate for Fuel blocks, performed upon block
creation. The compressed blocks are stored into the offchain database
and can be fetched using the GraphQL API.

## Note for reviewers

To keep this reasonably compact, decompression support is not included
in this PR, and will be done as a follow-up. As a result, the full data
roundtrip testing is not part of this PR. There's no proof here that
compression of full blocks is reversible.

## TODO
#### Features
- [x] Temporal registry db support
- [x] Optimize temporal registry eviction implementation
- [x] Implement TxId ↔ TxPointer lookups
- [x] Integrate with the block committer (GraphQL interface, probably)
#### Tests
- [x] compressed blocks are available from non-block-producer nodes
- [ ] e2e test for the full decompression cycle (moved to a follow-up)


## Follow-up issues
- Sync the node from L1:
FuelLabs/fuel-core#2208
- Decompression roudntrip tests
FuelLabs/fuel-core#2238
- Figure out which cache eviction algorithm/behavior is wanted:
FuelLabs/fuel-core#2231
- Figure out if we need to remove the compressed blocks from the db
after a while
- Merkle roots for fraud proofs
FuelLabs/fuel-core#2232

---------

Co-authored-by: Aaryamann Challani <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Rafał Chabowski <[email protected]>
GeorgeBake added a commit to GeorgeBake/pipeline-cli that referenced this pull request Sep 29, 2025
Related FuelLabs/fuel-core#1605. VM PR
FuelLabs/fuel-vm#670.

This PR adds DA compression crate for Fuel blocks, performed upon block
creation. The compressed blocks are stored into the offchain database
and can be fetched using the GraphQL API.

## Note for reviewers

To keep this reasonably compact, decompression support is not included
in this PR, and will be done as a follow-up. As a result, the full data
roundtrip testing is not part of this PR. There's no proof here that
compression of full blocks is reversible.

## TODO
#### Features
- [x] Temporal registry db support
- [x] Optimize temporal registry eviction implementation
- [x] Implement TxId ↔ TxPointer lookups
- [x] Integrate with the block committer (GraphQL interface, probably)
#### Tests
- [x] compressed blocks are available from non-block-producer nodes
- [ ] e2e test for the full decompression cycle (moved to a follow-up)


## Follow-up issues
- Sync the node from L1:
FuelLabs/fuel-core#2208
- Decompression roudntrip tests
FuelLabs/fuel-core#2238
- Figure out which cache eviction algorithm/behavior is wanted:
FuelLabs/fuel-core#2231
- Figure out if we need to remove the compressed blocks from the db
after a while
- Merkle roots for fraud proofs
FuelLabs/fuel-core#2232

---------

Co-authored-by: Aaryamann Challani <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Rafał Chabowski <[email protected]>
BugSeeker84 added a commit to BugSeeker84/fuel-core that referenced this pull request Nov 16, 2025
Related FuelLabs/fuel-core#1605. VM PR
FuelLabs/fuel-vm#670.

This PR adds DA compression crate for Fuel blocks, performed upon block
creation. The compressed blocks are stored into the offchain database
and can be fetched using the GraphQL API.

## Note for reviewers

To keep this reasonably compact, decompression support is not included
in this PR, and will be done as a follow-up. As a result, the full data
roundtrip testing is not part of this PR. There's no proof here that
compression of full blocks is reversible.

## TODO
#### Features
- [x] Temporal registry db support
- [x] Optimize temporal registry eviction implementation
- [x] Implement TxId ↔ TxPointer lookups
- [x] Integrate with the block committer (GraphQL interface, probably)
#### Tests
- [x] compressed blocks are available from non-block-producer nodes
- [ ] e2e test for the full decompression cycle (moved to a follow-up)


## Follow-up issues
- Sync the node from L1:
FuelLabs/fuel-core#2208
- Decompression roudntrip tests
FuelLabs/fuel-core#2238
- Figure out which cache eviction algorithm/behavior is wanted:
FuelLabs/fuel-core#2231
- Figure out if we need to remove the compressed blocks from the db
after a while
- Merkle roots for fraud proofs
FuelLabs/fuel-core#2232

---------

Co-authored-by: Aaryamann Challani <[email protected]>
Co-authored-by: Green Baneling <[email protected]>
Co-authored-by: Rafał Chabowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuel-types Related to the `fuel-types` crate. mainnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants