Commit graph

3597 commits

Author SHA1 Message Date
xunilrj
4ac467c560 update tests 2025-12-16 14:03:58 -03:00
xunilrj
855aad08cc update tests 2025-12-16 14:03:58 -03:00
xunilrj
417a769ce4 update tests 2025-12-16 14:03:58 -03:00
xunilrj
7a6ec15557 remove inline never 2025-12-16 14:03:58 -03:00
xunilrj
aabd2ce7a7 update tests 2025-12-16 14:03:58 -03:00
xunilrj
2968fb0bd8 update tests 2025-12-16 14:03:58 -03:00
xunilrj
aa89ff50ea fmt and clippy issues 2025-12-16 14:03:58 -03:00
xunilrj
c8cae34571 small pr adjustments 2025-12-16 14:03:58 -03:00
xunilrj
8137dd0d44 improve auto impl for encoding 2025-12-16 14:03:58 -03:00
xunilrj
0b2f73c474 snapshot ASM output 2025-12-16 14:03:58 -03:00
xunilrj
542194b8f2 update tests 2025-12-16 14:03:58 -03:00
xunilrj
09620e2870 fmt and clippy 2025-12-16 14:03:58 -03:00
xunilrj
4f579069c8 unit type as trivially encodable/decodable 2025-12-16 14:03:58 -03:00
xunilrj
506d127ad9 update tests 2025-12-16 14:03:58 -03:00
xunilrj
3c1a3c8e41 try to improve compilation speed 2025-12-16 14:03:58 -03:00
xunilrj
ce6d3b2271 fix CI 2025-12-16 14:03:58 -03:00
xunilrj
26440288fb update predicate tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
0953baa930 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
362f339efd update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
afac530f9d update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
775a6c09d9 more trivial types 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
3b9044078a update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
a74a88637f update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
aa5cb90a94 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
7d2a9d4e9b more trivial types 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
5bcfa37cbb more trivial types 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
472c31b1f9 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
60aee61103 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
69e5e684d9 fmt and clippy issues 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
6fb7f86b6d auto-impl for is_trivial 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
94350b181e update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
bd8abfd7c2 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
c691d63f32 update tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
25fa2e2517 update snapshot tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
9eb4cdcd02 fix entry generation 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
975beda918 fmt and clippy issues 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
c763ad6262 fix entry generation 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
d093b2aca1 std formatting 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
826af66de8 using new fns 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
b5681ba580 fix tests 2025-12-16 14:03:58 -03:00
Daniel Frederico Lins Leite
3c0c312016 trivial fns allowing control ifa type is trivially encoded/decoded 2025-12-16 14:03:58 -03:00
João Matos
b4fa78d60a
Trait coherence: disallow inherent impls on external types (#7385)
Some checks are pending
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
github pages / deploy (push) Waiting to run
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
CI / build-forc-test-project (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
This improves the trait coherence checks for impl self case, and
polishes a bit of the wording on the existing diagnostics.

We now enforce package-level check in impl-self type checking, which
means we now reject inherent impls for external nominal types
(struct/enum).

There is still is a specialized whitelist for `StorageKey` so current
code that uses this pattern keeps working.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-12-16 14:02:59 -03:00
Igor Rončević
4a44a36718
Enable references tests and adjust them for zero sized unit type (#7513)
Some checks are pending
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
## Description

This PR enables `language/references` and `stdlib` tests that were
disabled because of the #6898. It also adjusts the `language/references`
tests to the change introduced in #7509, which changes unit to be a
zero-sized type.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-12-16 12:06:54 +00:00
Daniel Frederico Lins Leite
3f3fa379d0
Enable const generics as true by default (#7512)
Some checks are pending
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
## Description

The final step before closing
https://github.com/FuelLabs/sway/issues/6860. The `const_generics`
feature flag will be fully removed in a separate PR.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Igor Rončević <ironcev@hotmail.com>
2025-12-15 11:53:59 +00:00
Daniel Frederico Lins Leite
44ff0f4f8b
Convert const generics todos to ice (#7511)
## Description

This PR is the last of https://github.com/FuelLabs/sway/issues/6860
before we switch const generics on by default.
It is transforming all `todo` to ICE. 

The vast majority here is probably unreachable, and if not, we can
implement them as we find how to trigger them.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
2025-12-15 11:34:11 +00:00
Daniel Frederico Lins Leite
5e179b304e
Fix size of ZSTs (#7509)
Some checks failed
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
## Description

This PR will improve https://github.com/FuelLabs/sway/pull/7501 by
fixing the size of `()`, which affects enums with all variants as
`unit`.

With units occupying one byte, their runtime memory representation ends
up being different from their encoding representation, which avoids
trivial encode/decode optimisation of some types.

Another benefit of this PR is that we do not need to generate anything
for `store` of zero bytes.
Unfortunately, we cannot remove the `load` instruction, as registers
will be uninitialized on their first usage. For that, we simply emit a
`MOVI`, zeroing the register. I cannot think of a case where this change
is a problem. We never promised any specific value for ZST, so zero
seems a good candidate.

A new test was created to facilitate checking of types sizes, layouts
and whether they can be trivially encoded/decoded or not. Especially
because this PR is changing the layout of types.

<img width="1629" height="799" alt="image"
src="https://github.com/user-attachments/assets/608c8094-55d3-44e1-8827-420a3249690a"
/>

In theory, this change will affect storage. But in reality, it is highly
unlikely that `unit` was being used directly on types being stored. The
only use case would be enums, but enums were not changed, as they were
already being treated differently.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-12-12 17:09:50 +01:00
Daniel Frederico Lins Leite
c3e5ea7436
Forbid const generics log (#7510)
Some checks are pending
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
## Description

Continuation of https://github.com/FuelLabs/sway/pull/7494.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-12-11 22:38:17 +00:00
Daniel Frederico Lins Leite
dc81a4063d
Forbid types with const generics on configurables (#7494)
Some checks failed
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / build-sway-examples (push) Has been cancelled
CI / build-reference-examples (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
## Description

This PR is continuation of https://github.com/FuelLabs/sway/pull/7483.

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Blocks types with const generics in configurables and ABI method
args/returns via new `TypeId::has_const_generics`, and adds tests to
enforce errors.
> 
> - **Type system**:
> - Add `TypeId::has_const_generics(engines)` to detect const generics
in nested types (`sway-core/src/type_system/id.rs`).
> - **Compiler/semantics**:
> - Enforce no const generics in configurables via
`TyConfigurableDecl::forbid_const_generics()` and invoke during type
check (`semantic_analysis/.../configurable.rs`, `.../declaration.rs`).
> - Enforce no const generics in ABI method parameters/returns using
`TypeId::has_const_generics` and remove ad-hoc checker
(`language/ty/declaration/abi.rs`).
> - **Tests**:
> - Extend `should_fail/unsupported_const_generics` to cover
configurables and ABI cases; update snapshot (`test/.../stdout.snap`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
eb6159044d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
Co-authored-by: Igor Rončević <ironcev@hotmail.com>
2025-12-10 11:58:22 -03:00
Joshua Batty
8103f0d02f
Migrate forc-tracing and forc-crypto to forc monorepo (#7507)
Some checks are pending
CI / check-forc-manifest-version (push) Waiting to run
CI / get-fuel-core-version (push) Waiting to run
CI / build-sway-lib-std (push) Waiting to run
CI / build-sway-examples (push) Waiting to run
CI / build-reference-examples (push) Waiting to run
CI / forc-fmt-check-sway-lib-std (push) Waiting to run
CI / forc-fmt-check-sway-examples (push) Waiting to run
CI / forc-fmt-check-panic (push) Waiting to run
CI / check-sdk-harness-test-suite-compatibility (push) Waiting to run
CI / build-mdbook (push) Waiting to run
CI / build-forc-doc-sway-lib-std (push) Waiting to run
CI / build-forc-test-project (push) Waiting to run
CI / cargo-build-workspace (push) Waiting to run
CI / cargo-clippy (push) Waiting to run
CI / cargo-toml-fmt-check (push) Waiting to run
CI / cargo-fmt-check (push) Waiting to run
CI / cargo-run-e2e-test (push) Blocked by required conditions
CI / cargo-run-e2e-test-release (push) Blocked by required conditions
CI / cargo-test-lib-std (push) Waiting to run
CI / forc-run-benchmarks (push) Waiting to run
CI / forc-unit-tests (push) Waiting to run
CI / forc-pkg-fuels-deps-check (push) Waiting to run
CI / Build and test various forc tools (push) Blocked by required conditions
CI / cargo-unused-deps-check (push) Waiting to run
CI / notify-slack-on-failure (push) Blocked by required conditions
CI / pre-publish-check (push) Waiting to run
CI / publish (push) Blocked by required conditions
CI / publish-sway-lib-std (push) Blocked by required conditions
CI / Build and upload forc binaries to release (push) Blocked by required conditions
github pages / deploy (push) Waiting to run
## Summary

This PR completes the sway-side of migrating `forc-tracing` and
`forc-crypto` to the new [forc
monorepo](https://github.com/FuelLabs/forc), as outlined in [RFC
#49](https://github.com/FuelLabs/sway-rfcs/pull/49).

The corresponding forc repo PR:
https://github.com/FuelLabs/forc/pull/119

### Changes

- Remove `forc-tracing` crate from workspace (now uses crates.io
`0.71.1`)
- Remove `forc-crypto` crate from workspace
- Update CI to no longer build/package `forc-crypto` binary (it's now
built from forc repo)
- Update gh-pages workflow to install `forc-crypto` from forc repo for
documentation generation

### Distribution

Going forward, `forc-crypto` will be built and distributed from the forc
repo by:
- sway-nightly-binaries
- fuelup  
- fuel.nix

### Documentation

For now, documentation for all tooling will continue to live in this
repo. The `gh-pages` workflow now pulls `forc-crypto` from the forc repo
rather than building it locally, so docs generation continues to work as
before.
2025-12-10 08:58:01 +11:00
Igor Rončević
c73137d717
Optionally remove test gas limit in forc test (#7495)
Some checks failed
CI / check-dependency-version-formats (push) Has been cancelled
CI / check-forc-manifest-version (push) Has been cancelled
CI / get-fuel-core-version (push) Has been cancelled
CI / build-sway-lib-std (push) Has been cancelled
CI / forc-fmt-check-sway-lib-std (push) Has been cancelled
CI / forc-fmt-check-sway-examples (push) Has been cancelled
CI / forc-fmt-check-panic (push) Has been cancelled
CI / check-sdk-harness-test-suite-compatibility (push) Has been cancelled
CI / build-forc-test-project (push) Has been cancelled
CI / build-mdbook (push) Has been cancelled
CI / build-forc-doc-sway-lib-std (push) Has been cancelled
CI / cargo-build-workspace (push) Has been cancelled
CI / cargo-clippy (push) Has been cancelled
CI / cargo-toml-fmt-check (push) Has been cancelled
CI / cargo-fmt-check (push) Has been cancelled
CI / cargo-test-lib-std (push) Has been cancelled
CI / forc-run-benchmarks (push) Has been cancelled
CI / forc-unit-tests (push) Has been cancelled
CI / forc-pkg-fuels-deps-check (push) Has been cancelled
CI / cargo-unused-deps-check (push) Has been cancelled
CI / pre-publish-check (push) Has been cancelled
github pages / deploy (push) Has been cancelled
CI / verifications-complete (push) Has been cancelled
CI / cargo-run-e2e-test (push) Has been cancelled
CI / cargo-run-e2e-test-release (push) Has been cancelled
CI / notify-slack-on-failure (push) Has been cancelled
CI / Build and test various forc tools (push) Has been cancelled
CI / publish (push) Has been cancelled
CI / publish-sway-lib-std (push) Has been cancelled
CI / Build and upload forc binaries to release (push) Has been cancelled
## Description

This PR adds `--no-gas-limit` CLI option to `forc test`. The option
increases tx gas limit in `forc test` to `u64::MAX`, essentially
removing it.

The motivation for the change was the need to benchmark heavy gas
consuming algorithms. E.g., a brute force prime factorization of the
number 9223372021822390277 took 21_474_836_627 gas units.

The new `TestGasLimit` enum provides a `Limit(limit)` variant which is
currently unused, but added for future extensions, if we want to limit
the test gas to a particular value.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
2025-12-02 15:36:41 +13:00