Skip to content

feat: add forc-crypto as standalone package in channel TOML files #810

@JoshuaBatty

Description

@JoshuaBatty

Summary

Now that forc-crypto has been migrated from the sway repository to the forc monorepo (v0.71.0+), it's no longer bundled inside the forc-binaries tarball. The channel TOML files need to include forc-crypto as a separate package entry, similar to how forc-wallet is specified.

Background

Previously, forc-crypto was distributed as part of the forc-binaries tarball from the sway repo. Starting with v0.71.0, it's now a standalone release from FuelLabs/forc with its own tarball:

forc-crypto-0.71.0-linux_amd64.tar.gz
forc-crypto-0.71.0-linux_arm64.tar.gz
forc-crypto-0.71.0-darwin_amd64.tar.gz
forc-crypto-0.71.0-darwin_arm64.tar.gz

Related PRs/Issues

Files to Update

The build-channel tool and then regenerate:

channel-fuel-mainnet.toml
channel-fuel-testnet.toml
channel-fuel-devnet.toml
channel-fuel-nightly.toml

Implementation

Step 1: Update build-channel tool

Modify /ci/build-channel/src/main.rs to:

  1. Accept forc-crypto as a version-specifiable component (like forc and fuel-core)
  2. Generate the appropriate package entry for forc-crypto

Currently the tool accepts versions like:

build-channel my-channel.toml 2023-02-13 forc=0.70.1 fuel-core=0.46.0

After this change, it should also accept:

build-channel my-channel.toml 2023-02-13 forc=0.70.1 fuel-core=0.46.0 forc-crypto=0.71.0

Step 2: Expected Output Format

The generated TOML should include a new [pkg.forc-crypto] section:

[pkg.forc-crypto]
version = "0.71.0"

[pkg.forc-crypto.target.linux_amd64]
url = "https://github.com/FuelLabs/forc/releases/download/forc-crypto-0.71.0/forc-crypto-0.71.0-linux_amd64.tar.gz"
hash = "<sha256>"

[pkg.forc-crypto.target.linux_arm64]
url = "https://github.com/FuelLabs/forc/releases/download/forc-crypto-0.71.0/forc-crypto-0.71.0-linux_arm64.tar.gz"
hash = "<sha256>"

[pkg.forc-crypto.target.darwin_amd64]
url = "https://github.com/FuelLabs/forc/releases/download/forc-crypto-0.71.0/forc-crypto-0.71.0-darwin_amd64.tar.gz"
hash = "<sha256>"

[pkg.forc-crypto.target.darwin_arm64]
url = "https://github.com/FuelLabs/forc/releases/download/forc-crypto-0.71.0/forc-crypto-0.71.0-darwin_arm64.tar.gz"
hash = "<sha256>"

Key Implementation Details

  1. Repository: FuelLabs/forc
  2. Tag format: forc-crypto-{version} (not v{version})
  3. Tarball naming: forc-crypto-{version}-{target}.tar.gz
  4. Targets: linux_amd64, linux_arm64, darwin_amd64, darwin_arm64

The write_document function in main.rs already handles similar logic for other components. The key difference for forc-crypto is:

  • Uses the forc monorepo (FuelLabs/forc)
  • Uses component-prefixed tags (forc-crypto-0.71.0 instead of v0.71.0)
  • Has its own tarball prefix (forc-crypto instead of forc-binaries)

These patterns are already handled by Component::repository_for_version(), Component::tag_for_version(), and Component::tarball_prefix_for_version() from #808.

Step 3: Regenerate Channel Files

After updating the build-channel tool, regenerate the channel files with the appropriate forc-crypto version:

cd ci/build-channel
cargo build --release

# Example for mainnet (adjust versions as needed)
./target/release/build-channel channel-fuel-mainnet.toml 2025-01-15 forc=0.70.1 fuel-core=0.46.0 forc-crypto=0.71.0

Acceptance Criteria

  • build-channel tool accepts forc-crypto=X.Y.Z version specification
  • Generated TOML includes proper [pkg.forc-crypto] section with all 4 targets
  • URLs use correct tag format (forc-crypto-{version})
  • URLs use correct tarball naming (forc-crypto-{version}-{target}.tar.gz)
  • Hashes are correctly computed
  • Channel files regenerated and pushed to gh-pages
  • fuelup component add forc-crypto works with updated channels

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions