Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blob tx and instructions #592

Merged
merged 15 commits into from
Jul 31, 2024
Merged

Blob tx and instructions #592

merged 15 commits into from
Jul 31, 2024

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Jun 24, 2024

Work towards #589. The VM PR FuelLabs/fuel-vm#780 contains a working implementation.

To allow contracts larger than the contract size limit, and to allow upgradability, we'll be adding a new tx type that's just a bunch of bytes, and opcodes to load subsections of that. A blob will be like a contract, but without state or balances, allowing it to be quite a bit cheaper. The new instructions BSIZ and BLDD and the new blob mode for LDC closely follow how CSIZ, LDC and CCP work, but only operation on blob data.

Before requesting review

  • I have reviewed the code myself

@Dentosal Dentosal added enhancement New feature or request comp:FVM Component: FuelVM labels Jun 24, 2024
@Dentosal Dentosal self-assigned this Jun 24, 2024
@Dentosal Dentosal marked this pull request as ready for review June 24, 2024 12:31
@Dentosal Dentosal requested review from a team June 24, 2024 12:31
@IGI-111
Copy link
Contributor

IGI-111 commented Jun 24, 2024

I know it's bikeshedding but can we call it something other than "blob"? It evokes either object based storage or proprietary binaries in kernel land. What this really is is an executable.

@Dentosal
Copy link
Member Author

Dentosal commented Jun 24, 2024

I know it's bikeshedding but can we call it something other than "blob"? It evokes either object based storage or proprietary binaries in kernel land. What this really is is an executable.

From vm and storage layer perspective, this is just an opaque bytearray, addressed by hash. The executability is just a nice side effect of the generic design, although it's also the main purpose for introducing this.

@IGI-111
Copy link
Contributor

IGI-111 commented Jun 26, 2024

it's also the main purpose for introducing this

That's my point really. Clarity of intent. I understand that this is just a distributed byte array. But it's not meant to store things, it's meant to store code that will be executed.

"Executable" might not be a good name for it since it is not guaranteed to be a whole executable.

Really it's just a bunch of loadable bytecode. "Chunk" maybe?

Copy link

@segfault-magnet segfault-magnet left a comment

Choose a reason for hiding this comment

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

LDC docs should be updated to show mode and that the first arg can now be a blob_id.

@Voxelot
Copy link
Member

Voxelot commented Jul 31, 2024

@Dentosal should this PR also include the changes to the LDC opcode?

@Dentosal
Copy link
Member Author

@Dentosal should this PR also include the changes to the LDC opcode?

Yes. They were not originally included as it was unclear whether we would have them in LDC or a separate instruction, but it seems like we have converged on LDC. The new changes are included in 71f7462.

@Dentosal Dentosal merged commit f182c55 into master Jul 31, 2024
6 checks passed
@Dentosal Dentosal deleted the dento/blob-tx branch July 31, 2024 16:20
Voxelot pushed a commit to FuelLabs/fuel-core that referenced this pull request Aug 1, 2024
Work towards FuelLabs/fuel-specs#589. Spec PR
FuelLabs/fuel-specs#592.

Adds support for Blob transactions, which are inserted into the onchain
database column called `Blobs`.
Also updates fuel-vm to 0.56.0, which introduces the new tx type.

Work-in-progress, still needs:
- [x] Regenesis support
- [x] Tests

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests

### 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

- [ ] [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)

---------

Co-authored-by: Ahmed Sagdati <[email protected]>
Co-authored-by: segfault-magnet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:FVM Component: FuelVM enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants