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

feat: add blob deployments for scripts and predicates #6607

Merged
merged 24 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
98 changes: 49 additions & 49 deletions Cargo.lock

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

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,24 @@ fuel-abi-types = "0.7"
# Although ALL verions are "X.Y", we need the complete semver for
# fuel-core-client as the GitHub Actions workflow parses this value to pull down
# the correct tarball
fuel-core-client = { version = "0.36.0", default-features = false }
fuel-core-types = { version = "0.36", default-features = false }
fuel-core-client = { version = "0.37.0", default-features = false }
fuel-core-types = { version = "0.37", default-features = false }

# Dependencies from the `fuels-rs` repository:

fuels = "0.66"
fuels-core = "0.66"
fuels-accounts = "0.66"

kayagokalp marked this conversation as resolved.
Show resolved Hide resolved
# Dependencies from the `fuel-vm` repository:
fuel-asm = "0.57"
fuel-crypto = "0.57"
fuel-types = "0.57"
fuel-tx = "0.57"
fuel-vm = "0.57"
fuel-asm = "0.58"
fuel-crypto = "0.58"
fuel-types = "0.58"
fuel-tx = "0.58"
fuel-vm = "0.58"

# Dependencies from the `forc-wallet` repository:
forc-wallet = "0.9"
forc-wallet = "0.10"

#
# External dependencies
Expand Down
23 changes: 22 additions & 1 deletion docs/book/src/forc/plugins/forc_client/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,25 @@ If an `address` is present, `forc` calls into that contract to update its `targe

## Large Contracts

For contracts over 100KB, `forc-deploy` will split the contract into chunks and deploy the contract with multiple transactions using the Rust SDK's [loader contract](https://github.com/FuelLabs/fuels-rs/blob/master/docs/src/deploying/large_contracts.md) functionality. Chunks that have already been deployed will be reused on subsequent deployments.
For contracts over the maximum contract size limit defined by the network, `forc-deploy` will split the contract into chunks and deploy the contract with multiple transactions using the Rust SDK's [loader contract](https://github.com/FuelLabs/fuels-rs/blob/master/docs/src/deploying/large_contracts.md) functionality. Chunks that have already been deployed will be reused on subsequent deployments.

## Deploying Scripts and Predicates

`forc deploy` now supports deploying scripts and predicates in addition to contracts. These are deployed as blobs with generated loaders for efficiency.

Scripts and predicates are deployed automatically when you run `forc deploy` on a project that contains them. The deployment process differs slightly from contract deployment:

1. For scripts and predicates, the bytecode is uploaded as a blob.
2. A loader is generated that can load and execute the blob.
3. The loader bytecode is saved in the project's output directory.

After deployment, you'll find new files in your project's output directory:

- For scripts: `<script_name>-loader.bin`
- For predicates: `<predicate_name>-loader.bin` and `<predicate_name>-loader-root`

The loader files contain the bytecode necessary to load and execute your script or predicate from the deployed blob.

This new deployment method allows for more efficient storage and execution of scripts and predicates on the Fuel network.

Note: Contracts are still deployed directly, not as blobs given that the contract size is under the maximum contract size limit defined by network.
Loading
Loading