repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
### Incorrect `from_parts` count causes excessive storage writes **Medium Severity** <!-- DESCRIPTION START --> In the quads-based `store_vec`, `raw_slice::from_parts::<V>(ptr, number_of_words)` incorrectly passes `number_of_words` (which is a byte count: `size_V_bytes_padded * vec.len()`) as the `count` parameter. S...
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "### Incorrect `from_parts` count causes excessive storage writes\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nIn the quads-based `store_vec`, `raw_slice::from_parts::<V>(ptr, number_of_words)` incorrectly passes `number_of_words` (which is a byte count: `size_V_bytes_padded * vec.len()`) ...
true
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
What is the difference from the declaration above? I am only seeing a small diff on the doc-comments. I think it makes more sense to keep just one and make the difference more explicit.
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "What is the difference from the declaration above? I am only seeing a small diff on the doc-comments. I think it makes more sense to keep just one and make the difference more explicit.", "path": "sway-lib-std/src/storage/storage_vec.sw", "hunk": "@@ -10,14 +10,89 @@ use ::vec::Vec;\n use ...
true
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
```suggestion /// will remain in the storage.** ```
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "```suggestion\n /// will remain in the storage.**\n```", "path": "sway-lib-std/src/storage/storage_vec.sw", "hunk": "@@ -34,33 +109,48 @@ impl<V> StorageKey<StorageVec<V>> {\n /// use std::storage::storage_vec::*;\n ///\n /// storage {\n- /// vec: StorageVec<u64> = St...
true
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
```suggestion /// but the nested content of those removed elements will remain in the storage.** ```
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "```suggestion\n /// but the nested content of those removed elements will remain in the storage.**\n```", "path": "sway-lib-std/src/storage/storage_vec.sw", "hunk": "@@ -724,13 +854,17 @@ impl<V> StorageKey<StorageVec<V>> {\n /// # Additional Information\n ///\n /// If `new_...
true
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
```suggestion /// will remain in the storage. ```
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "```suggestion\n /// will remain in the storage.\n```", "path": "sway-lib-std/src/storage/storage_vec.sw", "hunk": "@@ -1021,10 +1152,1366 @@ impl<V> Iterator for StorageVecIter<V> {\n }\n }\n \n-// Add padding to type so it can correctly use the storage api\n+/// Calculates the offs...
true
FuelLabs/sway
7,614
comment_to_fix
Implement dynamic storage based `StorageVec`
```suggestion /// but the nested content of those removed elements will remain in the storage.** ```
514ccec75cccc818254f09e0c284db2c78b2ec2a
ecc2c92ea28c187e76d47f70d6de0024c884c202
diff --git a/sway-lib-std/src/storage/storage_vec.sw b/sway-lib-std/src/storage/storage_vec.sw index c1c2073fdd9..369b7de24dc 100644 --- a/sway-lib-std/src/storage/storage_vec.sw +++ b/sway-lib-std/src/storage/storage_vec.sw @@ -10,14 +10,89 @@ use ::vec::Vec; use ::iterator::Iterator; use ::codec::*; use ::debug::*...
[ "sway-lib-std/src/storage/storage_vec.sw" ]
[ { "comment": "```suggestion\n /// but the nested content of those removed elements will remain in the storage.**\n```", "path": "sway-lib-std/src/storage/storage_vec.sw", "hunk": "@@ -1021,10 +1152,1366 @@ impl<V> Iterator for StorageVecIter<V> {\n }\n }\n \n-// Add padding to type so it can corr...
true
FuelLabs/sway
7,622
issue_to_patch
Either support or forbid `validate_abi/storage_slots` test options in `unit_tests_pass` tests Currently, it is allowed to have these options in `unit_test_pass` tests and even set them to true, but they are not checked in the test harness. They are checked only for `compiles` and `runs` tests. We should either forbid...
Disable initialization of dynamic storage fields larger than 32 bytes
## Description This PR disables emitting of `storage_slots.json` entries for `storage` declaration fields whose size is larger than 32 bytes, when compiled with `dynamic_storage` enabled. This is a temporary solution for the currently missing possibility to create transactions that can initial dynamic storage. In...
c53e7e0cb9183f5ef09c14d4eba94ef4f7e284ce
14e106959414f2f34152f5f3a0b3626628140232
diff --git a/sway-core/src/ir_generation/storage.rs b/sway-core/src/ir_generation/storage.rs index fb0f59751c8..65a35c9a489 100644 --- a/sway-core/src/ir_generation/storage.rs +++ b/sway-core/src/ir_generation/storage.rs @@ -121,23 +121,25 @@ pub(super) fn add_to_b256(x: Bytes32, y: u64) -> Bytes32 { Bytes32::from...
[ "sway-core/src/ir_generation/storage.rs", "sway-core/src/semantic_analysis/ast_node/declaration/storage.rs", "test/src/e2e_vm_tests/harness.rs", "test/src/e2e_vm_tests/mod.rs", "test/src/e2e_vm_tests/test_programs/should_fail/storage_configurable/json_storage_slots_oracle.json", "test/src/e2e_vm_tests/tes...
[]
diff --git a/test/src/e2e_vm_tests/harness.rs b/test/src/e2e_vm_tests/harness.rs index 11316541c4f..2ddb496669c 100644 --- a/test/src/e2e_vm_tests/harness.rs +++ b/test/src/e2e_vm_tests/harness.rs @@ -384,8 +384,11 @@ pub(crate) async fn compile_and_run_unit_tests( .await } +/// `relative_test_path` is the path...
true
FuelLabs/sway
7,611
issue_to_patch
Fix tuple codec helpers to avoid LSP stack overflows
## Summary I reproduced an LSP crash where opening and incrementally editing `fuel-o2-exports/contracts/order-book/src/main.sw` could abort the server and leave stale semantic highlighting behind in the client. Daniel pointed out that the generated tuple helpers in `std::codec` are emitted as one large left-associati...
27f3d9977b5ff5fa0d77d2e3fc75f2710d4dde34
692b463220166cf7c1c070ed1866a98b7583efc5
diff --git a/sway-lib-std/generate.sh b/sway-lib-std/generate.sh index 16db557f65e..fa873c07087 100755 --- a/sway-lib-std/generate.sh +++ b/sway-lib-std/generate.sh @@ -1,12 +1,24 @@ #! /bin/bash +# Use GNU sed (`gsed` on macOS via `brew install gnu-sed`); BSD sed in-place +# semantics differ and break the substitut...
[ "sway-lib-std/generate.sh", "sway-lib-std/src/codec.sw", "test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap", "test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap", "test/src/e2e_vm_tests/test_programs/should_pass/language/cons...
[]
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap index 1a242815443..5178a69a0b8 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.sn...
true
FuelLabs/sway
7,608
issue_to_patch
Increase test coverage for `dynamic_storage`
## Description This PR increases test coverage for `dynamic_storage` experimental feature, by reusing existing E2E storage tests and running them with the `dynamic_storage` feature enabled. Tests containing `StorageVec` are not included. This will be done in the PR that brings dynamic-storage-based `StorageVec`. ...
3005dcbf538835975b217cf3b63f5183746ed1cc
78292cb6ebbad0b270ef56a98c718eee0c03d533
[ "test/src/e2e_vm_tests/test_programs/should_fail/const_eval_bad_struct/test.dynamic_storage.toml", "test/src/e2e_vm_tests/test_programs/should_fail/generics_in_contract/src/main.sw", "test/src/e2e_vm_tests/test_programs/should_fail/generics_in_contract/test.dynamic_storage.toml", "test/src/e2e_vm_tests/test_p...
[ { "comment": "### Redundant `experimental_new_encoding` field in test config\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nThe `experimental_new_encoding = true` field on line 4 is redundant because `experimental = { new_encoding = true, dynamic_storage = true }` on line 2 already enables `new_encoding`. W...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/const_eval_bad_struct/test.dynamic_storage.toml b/test/src/e2e_vm_tests/test_programs/should_fail/const_eval_bad_struct/test.dynamic_storage.toml new file mode 100644 index 00000000000..56c5b3a5516 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/shoul...
true
FuelLabs/sway
7,608
comment_to_fix
Increase test coverage for `dynamic_storage`
### Redundant `experimental_new_encoding` field in test config **Low Severity** <!-- DESCRIPTION START --> The `experimental_new_encoding = true` field on line 4 is redundant because `experimental = { new_encoding = true, dynamic_storage = true }` on line 2 already enables `new_encoding`. When the `experimental` tabl...
3005dcbf538835975b217cf3b63f5183746ed1cc
78292cb6ebbad0b270ef56a98c718eee0c03d533
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/payable_non_zero_coins/test.dynamic_storage.toml b/test/src/e2e_vm_tests/test_programs/should_pass/payable_non_zero_coins/test.dynamic_storage.toml new file mode 100644 index 00000000000..d8073b9fa6b --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/sho...
[ "test/src/e2e_vm_tests/test_programs/should_pass/payable_non_zero_coins/test.dynamic_storage.toml" ]
[ { "comment": "### Redundant `experimental_new_encoding` field in test config\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nThe `experimental_new_encoding = true` field on line 4 is redundant because `experimental = { new_encoding = true, dynamic_storage = true }` on line 2 already enables `new_encoding`. W...
true
FuelLabs/sway
7,608
comment_to_fix
Increase test coverage for `dynamic_storage`
### Missing ABI oracle files for dynamic_storage tests **Medium Severity** <!-- DESCRIPTION START --> Three `test.dynamic_storage.toml` files set `validate_abi = true` but no corresponding `json_abi_oracle.dynamic_storage.debug.json` / `json_abi_oracle.dynamic_storage.release.json` files are included. The test harnes...
3005dcbf538835975b217cf3b63f5183746ed1cc
78292cb6ebbad0b270ef56a98c718eee0c03d533
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/test.dynamic_storage.toml b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/test.dynamic_storage.toml new file mode 100644 index 00000000000..8d611f852b4 --- /dev/null +++ b/test/src/e2e_vm_tests/test_...
[ "test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/basic_storage/test.dynamic_storage.toml" ]
[ { "comment": "### Missing ABI oracle files for dynamic_storage tests\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThree `test.dynamic_storage.toml` files set `validate_abi = true` but no corresponding `json_abi_oracle.dynamic_storage.debug.json` / `json_abi_oracle.dynamic_storage.release.json` files ar...
true
FuelLabs/sway
7,601
issue_to_patch
Reassignment to const generic array emits "Type is not indexable" error E.g., this code: ```sway fn const_generic_array<const N: u64>() -> [u8; N] { let mut res = [0u8; N]; res[0] = 1; res } ``` emits: ``` error: Type is not indexable --> const-generic-array-not-an-indexable-type/sway_const_generic_arr...
Implement reassignment for arrays declared using const generics
## Description This PR implements reassignments for arrays declared using const generic arguments: ```sway fn const_generic_array<const N: u64>() -> [u8; N] { let mut res = [0u8; N]; res[0] = 1; // <<<<--- This now works. res } ``` During development and testing of this PR, several o...
fe31b4a85b3096812399fa1c319f14cf232892a5
3c8b892282de63c81d6dc24e3a0be2b13176f866
diff --git a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs b/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs index 9ab3cc6921d..c6bb40ece71 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs +++ b/sway-core/src/semantic_analysis/ast_nod...
[ "sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs", "sway-error/src/error.rs", "test/src/e2e_vm_tests/test_programs/should_fail/array_bad_index/Forc.lock", "test/src/e2e_vm_tests/test_programs/should_fail/array_invalid_index_type/Forc.lock", "test/src/e2e_vm_tests/test_programs/should...
[ { "comment": "### Swapped loop bounds in nested array test function\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nIn `simple_const_generic_nested_array_reassignment`, the loop bounds for `a` and `b` are swapped relative to the array dimensions. The type `[[u64; A]; B]` is an array of `B` elements each o...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/array_bad_index/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_fail/array_bad_index/Forc.lock deleted file mode 100644 index 50cb58e1e4c..00000000000 --- a/test/src/e2e_vm_tests/test_programs/should_fail/array_bad_index/Forc.lock +++ /dev/null @@ -1,3...
true
FuelLabs/sway
7,601
comment_to_fix
Implement reassignment for arrays declared using const generics
### Swapped loop bounds in nested array test function **Medium Severity** <!-- DESCRIPTION START --> In `simple_const_generic_nested_array_reassignment`, the loop bounds for `a` and `b` are swapped relative to the array dimensions. The type `[[u64; A]; B]` is an array of `B` elements each of type `[u64; A]`, so `arra...
fe31b4a85b3096812399fa1c319f14cf232892a5
3c8b892282de63c81d6dc24e3a0be2b13176f866
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics_array_in_reassignments/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics_array_in_reassignments/src/main.sw new file mode 100644 index 00000000000..3fa52bbd21e --- /dev/null +++ b/test/src/e2e_vm_tes...
[ "test/src/e2e_vm_tests/test_programs/should_pass/language/const_generics_array_in_reassignments/src/main.sw" ]
[ { "comment": "### Swapped loop bounds in nested array test function\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nIn `simple_const_generic_nested_array_reassignment`, the loop bounds for `a` and `b` are swapped relative to the array dimensions. The type `[[u64; A]; B]` is an array of `B` elements each o...
true
FuelLabs/sway
7,601
comment_to_fix
Implement reassignment for arrays declared using const generics
I left a comment here: https://github.com/FuelLabs/sway-rfcs/pull/51#issuecomment-4335629221 Not emitting an error now makes sense.
fe31b4a85b3096812399fa1c319f14cf232892a5
3c8b892282de63c81d6dc24e3a0be2b13176f866
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/array_oob_const_index/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_fail/array_oob_const_index/src/main.sw index a82db990b29..36c45d06f24 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/array_oob_const_index/src/main.sw +++ b/test/src/...
[ "test/src/e2e_vm_tests/test_programs/should_fail/array_oob_const_index/src/main.sw" ]
[ { "comment": "I left a comment here: https://github.com/FuelLabs/sway-rfcs/pull/51#issuecomment-4335629221\n\nNot emitting an error now makes sense.", "path": "test/src/e2e_vm_tests/test_programs/should_fail/array_oob_const_index/src/main.sw", "hunk": "@@ -5,15 +5,47 @@ fn literal_index() -> u64 {\n ...
true
FuelLabs/sway
7,598
issue_to_patch
Fix issues found during testing of the `Iterator` implementation for `StorageVec` The tests written in #6821 fails for types `()`, `[u64;0]`, and the `EmptyStruct`. Using `()` causes an ICE: ``` error --> /.../sway/sway-lib-std/src/option.sw:191:15 | 189 | /// ``` 190 | pub fn unwrap(self) -> T...
Implement dynamic storage for `storage` declaration and `std`
## Description This PR is a part of #7560 implementation and implements: - `storage` fields access compilation for dynamic storage. - dynamic storage for all the types and functions in the `std::storage` module, except the `StorageVec`. In the `storage_api`, support for dynamic storage is added as the extension...
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/sway-core/src/ir_generation/function.rs b/sway-core/src/ir_generation/function.rs index f7658966e6f..b3089c62be5 100644 --- a/sway-core/src/ir_generation/function.rs +++ b/sway-core/src/ir_generation/function.rs @@ -796,7 +796,7 @@ impl<'a> FnCompiler<'a> { self.compile_storage_access( ...
[ "sway-core/src/ir_generation/function.rs", "sway-core/src/ir_generation/purity.rs", "sway-core/src/ir_generation/storage.rs", "sway-core/src/language/parsed/expression/mod.rs", "sway-core/src/language/ty/declaration/storage.rs", "sway-core/src/language/ty/expression/storage.rs", "sway-core/src/semantic_...
[ { "comment": "### Overly broad storage purity annotation on clear_slice_slot\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`clear_slice_slot` is annotated `#[storage(read, write)]` but only calls `__state_clear_slots`, which is a write-only operation. This unnecessarily forces callers (like `StorageByte...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/purity_of_asm_instructions_and_intrinsics/test.toml b/test/src/e2e_vm_tests/test_programs/should_fail/purity_of_asm_instructions_and_intrinsics/test.toml index 635449aaeb1..c825f20cb0b 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/purity_of_asm...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
### Overly broad storage purity annotation on clear_slice_slot **Medium Severity** <!-- DESCRIPTION START --> `clear_slice_slot` is annotated `#[storage(read, write)]` but only calls `__state_clear_slots`, which is a write-only operation. This unnecessarily forces callers (like `StorageBytes::clear()` and `StorageStr...
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/sway-lib-std/src/storage/storable_slice.sw b/sway-lib-std/src/storage/storable_slice.sw index d611ce08f66..9a6d277c5f1 100644 --- a/sway-lib-std/src/storage/storable_slice.sw +++ b/sway-lib-std/src/storage/storable_slice.sw @@ -1,3 +1,14 @@ +//! This module provides: +//! - a `StorableSlice<T>` trait for s...
[ "sway-lib-std/src/storage/storable_slice.sw" ]
[ { "comment": "### Overly broad storage purity annotation on clear_slice_slot\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`clear_slice_slot` is annotated `#[storage(read, write)]` but only calls `__state_clear_slots`, which is a write-only operation. This unnecessarily forces callers (like `StorageByte...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
### Test has wrong expected values from copy-paste **Low Severity** <!-- DESCRIPTION START --> In `state_update_slot_offset_equal_slot_length`, the expected array `[42u64, 34u64, 44u64, 45u64, 46u64]` contains `34u64` at index 1, but the stored data was `[42u64, 43u64, 44u64, 45u64]`. The `34u64` was copied from `sta...
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/storage_intrinsics/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/storage_intrinsics/src/main.sw index f72a2c72f16..5bbe0e0d59c 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/intrin...
[ "test/src/e2e_vm_tests/test_programs/should_pass/language/intrinsics/storage_intrinsics/src/main.sw" ]
[ { "comment": "### Test has wrong expected values from copy-paste\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nIn `state_update_slot_offset_equal_slot_length`, the expected array `[42u64, 34u64, 44u64, 45u64, 46u64]` contains `34u64` at index 1, but the stored data was `[42u64, 43u64, 44u64, 45u64]`. The `...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
### Inconsistent storage annotations for identical read+clear pattern **Low Severity** <!-- DESCRIPTION START --> `clear_slots_existed` and `StorageKey::clear_existed` use `#[storage(write)]` while `clear_slice_slot_existed` uses `#[storage(read, write)]`, yet all three perform the same pattern: `__state_preload` (a ...
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/sway-lib-std/src/storage/storage_api.sw b/sway-lib-std/src/storage/storage_api.sw index 2a34d01e20a..e49cdc0d766 100644 --- a/sway-lib-std/src/storage/storage_api.sw +++ b/sway-lib-std/src/storage/storage_api.sw @@ -5,37 +5,54 @@ use ::option::Option::{self, *}; use ::ops::*; use ::primitive_conversions:...
[ "sway-lib-std/src/storage/storage_api.sw" ]
[ { "comment": "### Inconsistent storage annotations for identical read+clear pattern\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\n`clear_slots_existed` and `StorageKey::clear_existed` use `#[storage(write)]` while `clear_slice_slot_existed` uses `#[storage(read, write)]`, yet all three perform the same pat...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Shouldn't this be `field_id`?
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/sway-core/src/ir_generation/function.rs b/sway-core/src/ir_generation/function.rs index f7658966e6f..b3089c62be5 100644 --- a/sway-core/src/ir_generation/function.rs +++ b/sway-core/src/ir_generation/function.rs @@ -796,7 +796,7 @@ impl<'a> FnCompiler<'a> { self.compile_storage_access( ...
[ "sway-core/src/ir_generation/function.rs" ]
[ { "comment": "Shouldn't this be `field_id`?", "path": "sway-core/src/ir_generation/function.rs", "hunk": "@@ -5616,72 +5616,86 @@ impl<'a> FnCompiler<'a> {\n &mut self,\n context: &mut Context,\n md_mgr: &mut MetadataManager,\n- storage_field_names: Vec<String>,\n+ ...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
I think this collides with the previous update?
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/sway-lib-std/src/storage/storage_api.sw b/sway-lib-std/src/storage/storage_api.sw index 2a34d01e20a..e49cdc0d766 100644 --- a/sway-lib-std/src/storage/storage_api.sw +++ b/sway-lib-std/src/storage/storage_api.sw @@ -5,37 +5,54 @@ use ::option::Option::{self, *}; use ::ops::*; use ::primitive_conversions:...
[ "sway-lib-std/src/storage/storage_api.sw" ]
[ { "comment": "I think this collides with the previous update?", "path": "sway-lib-std/src/storage/storage_api.sw", "hunk": "@@ -60,23 +77,255 @@ pub fn write<T>(slot: b256, offset: u64, value: T) {\n // Copy the value to be stored to `padded_value + offset`.\n padded_value.add::<u64>(place_in_sl...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Great candidate to be migrated to snapshot tests.
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml index d61220251df..a3faf9ffa87 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_p...
[ "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml" ]
[ { "comment": "Great candidate to be migrated to snapshot tests.", "path": "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation/test.toml", "hunk": "@@ -1,4 +1,6 @@\n category = \"compile\"\n+expected_warnings = 3\n \n-# check: $()Storage write after external contract in...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Great candidate to be migrated to snapshot tests.
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_read/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_read/test.toml index 5541a6ffcdf..82200fd0bd5 100644 --- a/test/src/e2e_vm_tests/test_progra...
[ "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_read/test.toml" ]
[ { "comment": "Great candidate to be migrated to snapshot tests.", "path": "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_asm_block_read/test.toml", "hunk": "@@ -1,4 +1,4 @@\n category = \"compile\"\n \n # check: $()Storage read after external contract interacti...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Great candidate to be migrated to snapshot tests.
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml index d61220251df..c8705e39acc 100644...
[ "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml" ]
[ { "comment": "Great candidate to be migrated to snapshot tests.", "path": "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_codeblocks_other_than_in_functions/test.toml", "hunk": "@@ -1,4 +1,7 @@\n category = \"compile\"\n+expected_warnings = 3\n+\n+#unordered: $(...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Great candidate to be migrated to snapshot tests.
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml index 7105f663a21..227a04d0fcc 100644 --- a/test/src/e2e_vm_tests/test_programs/shoul...
[ "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml" ]
[ { "comment": "Great candidate to be migrated to snapshot tests.", "path": "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-1/test.toml", "hunk": "@@ -1,4 +1,7 @@\n category = \"compile\"\n-\n-# check: $()Storage write after external contract interaction ...
true
FuelLabs/sway
7,598
comment_to_fix
Implement dynamic storage for `storage` declaration and `std`
Great candidate to be migrated to snapshot tests.
e12e6118dee66417a41872ca2b743d279a28174a
4470322123dad3af6202bfe55d90ea81164eacd1
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml index 7105f663a21..c8705e39acc 100644 --- a/test/src/e2e_vm_tests/test_programs/shoul...
[ "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml" ]
[ { "comment": "Great candidate to be migrated to snapshot tests.", "path": "test/src/e2e_vm_tests/test_programs/should_pass/static_analysis/cei_pattern_violation_in_func_app-2/test.toml", "hunk": "@@ -1,4 +1,7 @@\n category = \"compile\"\n-\n-# check: $()Storage write after external contract interaction ...
true
FuelLabs/sway
7,151
issue_to_patch
Optimize `crypto` module for bytecode size and gas usage
## Description This PR optimizes the `std::crypto` module for bytecode size and gas cost by using optimization techniques similar to those used in #7087, #7092, and #7096. The optimized public functions are listed in the below code snippet. **The bytecode size of that code got reduced from 46104 bytes to 44288 by...
f9fcae93c14937700a61ec031e572d70a5ce41c0
5e898c6c00d31a811fefefc9dfe49a7dfa8e6c59
diff --git a/sway-lib-std/src/bytes.sw b/sway-lib-std/src/bytes.sw index a2fb83c2d10..04bf122f320 100644 --- a/sway-lib-std/src/bytes.sw +++ b/sway-lib-std/src/bytes.sw @@ -956,6 +956,41 @@ impl Bytes { index: 0, } } + + /// Returns true if all the bytes within the `Bytes` are zero. + /...
[ "sway-lib-std/src/bytes.sw", "sway-lib-std/src/crypto/ed25519.sw", "sway-lib-std/src/crypto/message.sw", "sway-lib-std/src/crypto/point2d.sw", "sway-lib-std/src/crypto/public_key.sw", "sway-lib-std/src/crypto/scalar.sw", "sway-lib-std/src/crypto/secp256k1.sw", "sway-lib-std/src/crypto/secp256r1.sw" ]
[]
true
FuelLabs/sway
6,853
issue_to_patch
Bump to v0.66.6
9e1c320cead802983266e5b5fd9d55d7e40234a6
6ecef9652ba1658b9c2033d91a20f81084d44221
diff --git a/Cargo.lock b/Cargo.lock index c012ee3100a..6dab0cc2304 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2662,7 +2662,7 @@ checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" [[package]] name = "forc" -version = "0.66.5" +version = "0.66.6" dependencies = [ "annotate-snippets", ...
[ "Cargo.lock", "Cargo.toml" ]
[]
true
FuelLabs/sway
7,237
issue_to_patch
fix: add forc-call to binary stripping step in ci
## Description Fixes ci to add `forc-call` to list of binaries we strip and add to the final binary pack. This should fix the issue of missing forc-call in latest (while having it in nightly as [sway-nightlies](https://github.com/FuelLabs/sway-nightly-binaries/releases) already includes `forc-call`)
cd89f62ece16b3d4ff37dbbd07d68ec056f18a6e
35e89c895bd7813bcc62d5ec76e8a96a24eceebb
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 941db16a12d..bfcdc212c66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -917,13 +917,13 @@ jobs: - name: Strip release binaries x86_64-linux-gnu if: matrix.job.target == 'x86_64-unknown-linux-gnu' ru...
[ ".github/workflows/ci.yml" ]
[]
true
FuelLabs/sway
7,310
issue_to_patch
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
## Description Adds a the fallback for forc package fetching. If IPFS fails we rely on CDN that is supplied by s3 in forc.pub side. ```console > ../dev/sway/target/debug/forc build Building /Users/kayagokalp/fuel/test_me Fetching std 0.69.1 Fetching from http://ipfs.forc.pub. Note: This can take s...
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "maybe we can improve this message, when trying from IPFS it prints \r\n\r\n``` \r\nFetching from http://ipfs.forc.pub. Note: This can take several minutes.\r\n````\r\n\r\nPerhaps for consistency we could print. \r\n\r\n```\r\nFetching from http://cdn.forc.pub. Note: This can take several minutes....
true
FuelLabs/sway
7,310
comment_to_fix
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
maybe we can improve this message, when trying from IPFS it prints ``` Fetching from http://ipfs.forc.pub. Note: This can take several minutes. ```` Perhaps for consistency we could print. ``` Fetching from http://cdn.forc.pub. Note: This can take several minutes. ```
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "maybe we can improve this message, when trying from IPFS it prints \r\n\r\n``` \r\nFetching from http://ipfs.forc.pub. Note: This can take several minutes.\r\n````\r\n\r\nPerhaps for consistency we could print. \r\n\r\n```\r\nFetching from http://cdn.forc.pub. Note: This can take several minutes....
true
FuelLabs/sway
7,310
comment_to_fix
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
Im assuming this should be `https`? ```suggestion let cdn_url = format!("https://cdn.forc.pub/{}", pinned.cid.0); ```
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "Im assuming this should be `https`?\n```suggestion\n let cdn_url = format!(\"https://cdn.forc.pub/{}\", pinned.cid.0);\n```", "path": "forc-pkg/src/source/reg/mod.rs", "hunk": "@@ -479,6 +493,61 @@ async fn fetch(fetch_id: u64, pinned: &Pinned, ipfs_node: &IPFSNode) -> anyhow::\n Ok...
true
FuelLabs/sway
7,310
comment_to_fix
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
will probably need to update this aswell; maybe reference the `cdn_url` variable here
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "will probably need to update this aswell; maybe reference the `cdn_url` variable here", "path": "forc-pkg/src/source/reg/mod.rs", "hunk": "@@ -479,6 +493,61 @@ async fn fetch(fetch_id: u64, pinned: &Pinned, ipfs_node: &IPFSNode) -> anyhow::\n Ok(path)\n }\n \n+/// Fetches package from ...
true
FuelLabs/sway
7,310
comment_to_fix
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
potential path traversal vulnerability here - since tar can unpack to parent paths. ```suggestion let mut entry = entry?; // Validate the entry path to prevent directory traversal let entry_path = entry.path()?; if entry_path .components() .any(|c| matches!(c, ...
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "potential path traversal vulnerability here - since tar can unpack to parent paths.\n\n\n```suggestion\n let mut entry = entry?;\n\n // Validate the entry path to prevent directory traversal\n let entry_path = entry.path()?;\n if entry_path\n .components()\n ...
true
FuelLabs/sway
7,310
comment_to_fix
feat: fallback into s3 cache in forc-pkg for failed ipfs fetch
might want to add explicit request timeout ```suggestion let client = reqwest::Client::builder() .timeout(std::time::Duration::from_secs(180)) // 3 minute timeout .build() .context("Failed to create HTTP client")?; ```
631f1db3bab1111dce88f2cb3f7c580648ac1316
b400478f3f91dc545650a2161aa874b508e70980
diff --git a/forc-pkg/src/source/reg/mod.rs b/forc-pkg/src/source/reg/mod.rs index 0e271307ea0..10382582a49 100644 --- a/forc-pkg/src/source/reg/mod.rs +++ b/forc-pkg/src/source/reg/mod.rs @@ -11,6 +11,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context}; use file_location::{location_from_root, Namespace}; +use ...
[ "forc-pkg/src/source/reg/mod.rs" ]
[ { "comment": "might want to add explicit request timeout\n\n```suggestion\n let client = reqwest::Client::builder()\n .timeout(std::time::Duration::from_secs(180)) // 3 minute timeout\n .build()\n .context(\"Failed to create HTTP client\")?;\n```", "path": "forc-pkg/src/source/reg/mo...
true
FuelLabs/sway
7,385
issue_to_patch
Trait coherence: disallow inherent impls on external types
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 fo...
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "sway-error/src/error.rs", "sway-error/src/warning.rs", "test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_alias_external/Forc.lock", "test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_alias_external/...
[ { "comment": "I thought that, as we discussed, this whitelisting wasn't actually necessary for licit usages of `impl StorageKey<SomeType>`", "path": "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "hunk": "@@ -526,6 +526,56 @@ impl TyImplSelfOrTrait {\n implemen...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_alias_external/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_alias_external/Forc.lock new file mode 100644 index 00000000000..5f58e2f4fec --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_fa...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
I thought that, as we discussed, this whitelisting wasn't actually necessary for licit usages of `impl StorageKey<SomeType>`
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "I thought that, as we discussed, this whitelisting wasn't actually necessary for licit usages of `impl StorageKey<SomeType>`", "path": "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "hunk": "@@ -526,6 +526,56 @@ impl TyImplSelfOrTrait {\n implemen...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
### Bug: Aliases to external types bypass coherence check <!-- **Medium Severity** --> <!-- DESCRIPTION START --> The `is_external` check only handles `TypeInfo::Struct` and `TypeInfo::Enum`, returning `false` for `TypeInfo::Alias`. Since `expect_is_supported_in_impl_blocks_self` explicitly allows `Alias` types for i...
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "### Bug: Aliases to external types bypass coherence check\n\n<!-- **Medium Severity** -->\n\n<!-- DESCRIPTION START -->\nThe `is_external` check only handles `TypeInfo::Struct` and `TypeInfo::Enum`, returning `false` for `TypeInfo::Alias`. Since `expect_is_supported_in_impl_blocks_self` explicitly...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
Nitpick. Single line looks somehow more readable to me. ```suggestion pkg_name.and_then(|name| name != current_pkg.name().as_str()).unwrap_or_default() ```
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "Nitpick. Single line looks somehow more readable to me.\n```suggestion\n pkg_name.and_then(|name| name != current_pkg.name().as_str()).unwrap_or_default()\n```", "path": "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "hunk": "@@ -527,6 +527,56 ...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
Same here. ```suggestion pkg_name.and_then(|name| name != current_pkg.name().as_str()).unwrap_or_default() ```
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "Same here.\n```suggestion\n pkg_name.and_then(|name| name != current_pkg.name().as_str()).unwrap_or_default()\n```", "path": "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "hunk": "@@ -527,6 +527,56 @@ impl TyImplSelfOrTrait {\n ...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
The below comment from the Cursor bot is an actual bug. We should use `get_unaliased` here to make sure we are checking the actual type. ```suggestion let is_external = match &*type_engine.get_unaliased(implementing_for.type_id) { ```
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "The below comment from the Cursor bot is an actual bug. We should use `get_unaliased` here to make sure we are checking the actual type.\n```suggestion\n let is_external = match &*type_engine.get_unaliased(implementing_for.type_id) {\n```", "path": "sway-core/src/semantic_analys...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
Strictly speaking, this must be exactly 2 😉 ```suggestion && s.call_path.prefixes.len() == 2 ```
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "Strictly speaking, this must be exactly 2 😉 \n```suggestion\n && s.call_path.prefixes.len() == 2\n```", "path": "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs", "hunk": "@@ -527,6 +527,56 @@ impl TyImplSelfOrTrait {\n imp...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
Also here we should handle aliases. Ideally, we could have a diagnostic saying that the declaration type is an alias for the external type. But for now we can just make sure we handle this. ```suggestion let type_definition_span = match &*type_engine.get_unaliased(implementing_for.type_id) { ```
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "Also here we should handle aliases. Ideally, we could have a diagnostic saying that the declaration type is an alias for the external type. But for now we can just make sure we handle this.\n```suggestion\n let type_definition_span = match &*type_engine.get_unaliased(implementin...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
### Bug: Missing alias resolution in StorageKey whitelist check <!-- **Medium Severity** --> <!-- DESCRIPTION START --> The `is_storage_key_in_std` check uses `type_engine.get()` while the `is_external` check uses `type_engine.get_unaliased()`. This inconsistency means that if someone creates an alias to `StorageKey`...
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs b/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs index d1e8a611791..bd66481df8c 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/i...
[ "sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs" ]
[ { "comment": "### Bug: Missing alias resolution in StorageKey whitelist check\n\n<!-- **Medium Severity** -->\n\n<!-- DESCRIPTION START -->\nThe `is_storage_key_in_std` check uses `type_engine.get()` while the `is_external` check uses `type_engine.get_unaliased()`. This inconsistency means that if someone creat...
true
FuelLabs/sway
7,385
comment_to_fix
Trait coherence: disallow inherent impls on external types
### Bug: Library inherent impls may incorrectly trigger coherence warnings <!-- **Medium Severity** --> <!-- DESCRIPTION START --> The test expectation of `expected_warnings = 2` is suspicious. Each test has only one inherent impl for an external type, which should produce exactly one coherence warning. The library `...
4a44a36718e049cca3648483c1ac0bf965a59355
770e69e537d177d1d82e7692cca913c5b621d051
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_self_overlap/test.toml b/test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_self_overlap/test.toml index 29efbacada8..599f06cac9b 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_self_ove...
[ "test/src/e2e_vm_tests/test_programs/should_fail/trait_coherence/impl_self_overlap/test.toml" ]
[ { "comment": "### Bug: Library inherent impls may incorrectly trigger coherence warnings\n\n<!-- **Medium Severity** -->\n\n<!-- DESCRIPTION START -->\nThe test expectation of `expected_warnings = 2` is suspicious. Each test has only one inherent impl for an external type, which should produce exactly one coher...
true
FuelLabs/sway
7,597
issue_to_patch
`__smo` and `__log` intrinsics not correctly compiled and can cause ICE `__smo` and `__log` intrinsics return unit `()` but the returned value is not correctly compiled in the IR. Instead of having a const `()` as their return value they just return their underlaying IR instruction that does not return a value. E.g. ...
Implement dynamic storage intrinsics
## Description This PR adds compiler intrinsics for dynamic storage opcodes. It is the second step in implementing #7560. Additionally, the PR: - fixes #7572 by properly returning unit `()` in IR generation. - partially addresses #7596 by cleaning up the type checking of existing storage intrinsics. ## Check...
fbb524c2dfc726636e321ada342060f51e17de19
b5e6a40b1fdda31e38456a3572b8f626d17539a9
diff --git a/docs/book/spell-check-custom-words.txt b/docs/book/spell-check-custom-words.txt index 733ba3f73e7..a45f2308622 100644 --- a/docs/book/spell-check-custom-words.txt +++ b/docs/book/spell-check-custom-words.txt @@ -270,3 +270,8 @@ backtrace Backtrace backtracing Backtracing +preload +Preload +preloads +Pre...
[ "docs/book/spell-check-custom-words.txt", "docs/book/src/reference/compiler_intrinsics.md", "sway-ast/src/intrinsics.rs", "sway-core/src/error.rs", "sway-core/src/ir_generation/const_eval.rs", "sway-core/src/ir_generation/function.rs", "sway-core/src/semantic_analysis/ast_node/expression/intrinsic_funct...
[ { "comment": "### `StateLoadWord` always gets two arguments breaking non-dynamic path\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`type_check_state_load_word` now always emits two arguments (`vec![key_exp, offset_exp]`) in the typed intrinsic, even when `dynamic_storage` is disabled, by synthesizing a...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/binop_intrinsics/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_fail/binop_intrinsics/Forc.lock deleted file mode 100644 index 870bf0a1975..00000000000 --- a/test/src/e2e_vm_tests/test_programs/should_fail/binop_intrinsics/Forc.lock +++ /dev/null @@ -...
true
FuelLabs/sway
7,597
comment_to_fix
Implement dynamic storage intrinsics
### `StateLoadWord` always gets two arguments breaking non-dynamic path **Medium Severity** <!-- DESCRIPTION START --> `type_check_state_load_word` now always emits two arguments (`vec![key_exp, offset_exp]`) in the typed intrinsic, even when `dynamic_storage` is disabled, by synthesizing a dummy `offset_exp` of `0`....
fbb524c2dfc726636e321ada342060f51e17de19
b5e6a40b1fdda31e38456a3572b8f626d17539a9
diff --git a/sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs b/sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs index 0dab6f365c4..012ceb4c038 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs +++ b/sway-core/src/semantic_analysis/a...
[ "sway-core/src/semantic_analysis/ast_node/expression/intrinsic_function.rs" ]
[ { "comment": "### `StateLoadWord` always gets two arguments breaking non-dynamic path\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`type_check_state_load_word` now always emits two arguments (`vec![key_exp, offset_exp]`) in the typed intrinsic, even when `dynamic_storage` is disabled, by synthesizing a...
true
FuelLabs/sway
7,597
comment_to_fix
Implement dynamic storage intrinsics
### `StateUpdateSlot` missing `StorageRead` effect in CEI analysis **High Severity** <!-- DESCRIPTION START --> `StateUpdateSlot` is assigned only `Effect::StorageWrite`, but it also reads from storage (especially for append operations where existing content must be read). The purity test at `purity_of_asm_instructio...
fbb524c2dfc726636e321ada342060f51e17de19
b5e6a40b1fdda31e38456a3572b8f626d17539a9
diff --git a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs index a23133fd4d4..e13cf98378a 100644 --- a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs +++ b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs @@ -637,8 +637,15 @@ fn effects...
[ "sway-core/src/semantic_analysis/cei_pattern_analysis.rs" ]
[ { "comment": "### `StateUpdateSlot` missing `StorageRead` effect in CEI analysis\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\n`StateUpdateSlot` is assigned only `Effect::StorageWrite`, but it also reads from storage (especially for append operations where existing content must be read). The purity test a...
true
FuelLabs/sway
7,595
issue_to_patch
Implement dynamic storage opcodes in the compiler
## Description This PR is a step in implementing #7560. It adds compiler support for [dynamic storage opcodes](https://github.com/FuelLabs/fuel-specs/pull/640) by: - supporting all opcodes in `asm` blocks. - adding IR instructions for all opcodes. Note that the `FuelVmInstruction::StatePreload` IR instruction r...
f9b815898a7db0e1cf775d62872a833fe5c87a4a
a871f09720d69cdb15106a526ac2493cbd687796
diff --git a/forc-plugins/forc-debug/src/server/handlers/handle_variables.rs b/forc-plugins/forc-debug/src/server/handlers/handle_variables.rs index d056bbeb777..36075512706 100644 --- a/forc-plugins/forc-debug/src/server/handlers/handle_variables.rs +++ b/forc-plugins/forc-debug/src/server/handlers/handle_variables.rs...
[ "forc-plugins/forc-debug/src/server/handlers/handle_variables.rs", "sway-ast/src/expr/op_code.rs", "sway-core/src/asm_generation/fuel/fuel_asm_builder.rs", "sway-core/src/asm_lang/allocated_ops.rs", "sway-core/src/asm_lang/mod.rs", "sway-core/src/asm_lang/virtual_ops.rs", "sway-core/src/ir_generation/pu...
[ { "comment": "### Inconsistent offset type check in state slot verification\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `verify_state_read_slot` method checks `offset` with `Type::is_uint` (accepts any unsigned integer width), while `verify_state_update_slot` checks the semantically identical `off...
diff --git a/sway-ir/tests/serialize/storage_clear.ir b/sway-ir/tests/serialize/storage_clear.ir new file mode 100644 index 00000000000..fca90d0c8f6 --- /dev/null +++ b/sway-ir/tests/serialize/storage_clear.ir @@ -0,0 +1,22 @@ +// regex: VAR=v\d+v\d+ + +script { +// check: fn main + fn main() -> () { + local ...
true
FuelLabs/sway
7,595
comment_to_fix
Implement dynamic storage opcodes in the compiler
### Inconsistent offset type check in state slot verification **Medium Severity** <!-- DESCRIPTION START --> The `verify_state_read_slot` method checks `offset` with `Type::is_uint` (accepts any unsigned integer width), while `verify_state_update_slot` checks the semantically identical `offset` parameter with `Type::...
f9b815898a7db0e1cf775d62872a833fe5c87a4a
a871f09720d69cdb15106a526ac2493cbd687796
diff --git a/sway-ir/src/verify.rs b/sway-ir/src/verify.rs index 98858891dcc..a6629a353f6 100644 --- a/sway-ir/src/verify.rs +++ b/sway-ir/src/verify.rs @@ -308,6 +308,10 @@ impl InstructionVerifier<'_, '_> { FuelVmInstruction::StateClear { key, num...
[ "sway-ir/src/verify.rs" ]
[ { "comment": "### Inconsistent offset type check in state slot verification\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `verify_state_read_slot` method checks `offset` with `Type::is_uint` (accepts any unsigned integer width), while `verify_state_update_slot` checks the semantically identical `off...
true
FuelLabs/sway
7,595
comment_to_fix
Implement dynamic storage opcodes in the compiler
All storage write opcodes perform an implicit read unless already cached. I tried to understand if this has any issues with `Effect` usage, and that doesn't seem to be the case currently, as the behavior is largely transparent to user code.
f9b815898a7db0e1cf775d62872a833fe5c87a4a
a871f09720d69cdb15106a526ac2493cbd687796
diff --git a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs index 0f838ef91c2..a23133fd4d4 100644 --- a/sway-core/src/semantic_analysis/cei_pattern_analysis.rs +++ b/sway-core/src/semantic_analysis/cei_pattern_analysis.rs @@ -685,8 +685,19 @@ fn effects...
[ "sway-core/src/semantic_analysis/cei_pattern_analysis.rs" ]
[ { "comment": "All storage write opcodes perform an implicit read unless already cached. I tried to understand if this has any issues with `Effect` usage, and that doesn't seem to be the case currently, as the behavior is largely transparent to user code.", "path": "sway-core/src/semantic_analysis/cei_patter...
true
FuelLabs/sway
7,595
comment_to_fix
Implement dynamic storage opcodes in the compiler
### Inconsistent `len` type check in `verify_state_read_slot` **Medium Severity** <!-- DESCRIPTION START --> The `len` parameter in `verify_state_read_slot` is checked with `Type::is_uint64`, while the analogous `len` parameter in `verify_state_write_slot` and `verify_state_update_slot` uses `Type::is_uint` (any unsi...
f9b815898a7db0e1cf775d62872a833fe5c87a4a
a871f09720d69cdb15106a526ac2493cbd687796
diff --git a/sway-ir/src/verify.rs b/sway-ir/src/verify.rs index 98858891dcc..a6629a353f6 100644 --- a/sway-ir/src/verify.rs +++ b/sway-ir/src/verify.rs @@ -308,6 +308,10 @@ impl InstructionVerifier<'_, '_> { FuelVmInstruction::StateClear { key, num...
[ "sway-ir/src/verify.rs" ]
[ { "comment": "### Inconsistent `len` type check in `verify_state_read_slot`\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `len` parameter in `verify_state_read_slot` is checked with `Type::is_uint64`, while the analogous `len` parameter in `verify_state_write_slot` and `verify_state_update_slot` use...
true
FuelLabs/sway
7,595
comment_to_fix
Implement dynamic storage opcodes in the compiler
### Printer missing `maybe_constant_to_doc` for `offset` values **Medium Severity** <!-- DESCRIPTION START --> The `StateReadSlot` and `StateUpdateSlot` printer arms call `maybe_constant_to_doc` only for `len` but not for `offset`, even though `offset` is also a `Value` that could be an inline constant. Compare with ...
f9b815898a7db0e1cf775d62872a833fe5c87a4a
a871f09720d69cdb15106a526ac2493cbd687796
diff --git a/sway-ir/src/printer.rs b/sway-ir/src/printer.rs index f4b11cef96e..85657071e97 100644 --- a/sway-ir/src/printer.rs +++ b/sway-ir/src/printer.rs @@ -895,7 +895,21 @@ fn instruction_to_doc<'a>( } => maybe_constant_to_doc(context, md_namer, namer, number_of_slots).append( ...
[ "sway-ir/src/printer.rs" ]
[ { "comment": "### Printer missing `maybe_constant_to_doc` for `offset` values\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `StateReadSlot` and `StateUpdateSlot` printer arms call `maybe_constant_to_doc` only for `len` but not for `offset`, even though `offset` is also a `Value` that could be an inl...
true
FuelLabs/sway
7,594
issue_to_patch
Bump to 0.71.0
## Description This PR bumps the `std` and the crates in `sway` repository to v0.71.0. ## 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 Swa...
011b75113331be21b5d3a1ca83f08dbf04654609
4c36f20bc9550e5cdf67efbc0326f6564cf8c33a
diff --git a/Cargo.lock b/Cargo.lock index ce852af8c96..2fb28ed7759 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2505,7 +2505,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "forc" -version = "0.70.3" +version = "0.71.0" dependencies = [ "annotate-snippets", ...
[ "Cargo.lock", "Cargo.toml", "sway-lib-std/Forc.toml" ]
[]
true
FuelLabs/sway
7,593
issue_to_patch
Fix default gas costs and add perf diff scripts to `storage_benchmarks`
## Description This PR: - fixes inconsistent gas cost values across tools. All default gas costs are now obtained via `GasCostsSource::BuiltIn.provide_gas_costs()` method. - improves analyzing `storage_benchmarks` by: - printing histograms optionally when running benchmarks. - adding the `perf_diff.sh` scrip...
4382e71f35d8b7f7deed31fdace001dcb797118e
4264490fe63b8098254a223b489cd8fe6a5be9ea
diff --git a/forc-plugins/forc-debug/src/server/mod.rs b/forc-plugins/forc-debug/src/server/mod.rs index 5b4f7faddda..e19e046c97a 100644 --- a/forc-plugins/forc-debug/src/server/mod.rs +++ b/forc-plugins/forc-debug/src/server/mod.rs @@ -20,9 +20,8 @@ use forc_pkg::{ use forc_test::{ execute::{DebugResult, TestExe...
[ "forc-plugins/forc-debug/src/server/mod.rs", "forc-test/src/lib.rs", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/.gitignore", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/RESULTS.md...
[ { "comment": "### Unnecessary `unwrap()` and repeated deserialization in closure\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`GasCostsSource::BuiltIn.provide_gas_costs().unwrap()` is called inside a `filter_map` closure, introducing a panic point where every other call site uses `?` for graceful error...
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/.gitignore b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/.gitignore new file mode 100644 index 00000000000..13bad1647e4 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/.gitignore...
true
FuelLabs/sway
7,593
comment_to_fix
Fix default gas costs and add perf diff scripts to `storage_benchmarks`
### Unnecessary `unwrap()` and repeated deserialization in closure **Medium Severity** <!-- DESCRIPTION START --> `GasCostsSource::BuiltIn.provide_gas_costs().unwrap()` is called inside a `filter_map` closure, introducing a panic point where every other call site uses `?` for graceful error propagation. Since the enc...
4382e71f35d8b7f7deed31fdace001dcb797118e
4264490fe63b8098254a223b489cd8fe6a5be9ea
diff --git a/forc-plugins/forc-debug/src/server/mod.rs b/forc-plugins/forc-debug/src/server/mod.rs index 5b4f7faddda..e19e046c97a 100644 --- a/forc-plugins/forc-debug/src/server/mod.rs +++ b/forc-plugins/forc-debug/src/server/mod.rs @@ -20,9 +20,8 @@ use forc_pkg::{ use forc_test::{ execute::{DebugResult, TestExe...
[ "forc-plugins/forc-debug/src/server/mod.rs" ]
[ { "comment": "### Unnecessary `unwrap()` and repeated deserialization in closure\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\n`GasCostsSource::BuiltIn.provide_gas_costs().unwrap()` is called inside a `filter_map` closure, introducing a panic point where every other call site uses `?` for graceful error...
true
FuelLabs/sway
7,592
issue_to_patch
Const Generics This PR is the tracking-issue for the `const_generics` feature. For more details go to: https://github.com/FuelLabs/sway-rfcs/pull/42 - [x] Feature toggle (https://github.com/FuelLabs/sway/pull/6926) - [x] Parsing (https://github.com/FuelLabs/sway/pull/6926) - [x] `impl` trait for arrays (https://gith...
Promote `const_generics` to a standard feature
## Description This PR promotes `const_generics` to a standard feature not anymore behind a feature flag. #7512 made `const_generic` experimental feature enabled by default, but still kept it as experimental, with the decision to remove the feature flag as a part of the next breaking release 0.71.0. - Closes #...
0507c2c9a65a147ef2026fda8ac52ba7223aca40
14da455eda533c4e7b7c1daeef9164a5b9f04a00
diff --git a/docs/book/src/reference/experimental_features.md b/docs/book/src/reference/experimental_features.md index d06f8b3c772..acb56e5ed05 100644 --- a/docs/book/src/reference/experimental_features.md +++ b/docs/book/src/reference/experimental_features.md @@ -12,7 +12,7 @@ The list of [currently active](https://gi...
[ "docs/book/src/reference/experimental_features.md", "docs/slides/const_generics.md", "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs", "sway-features/src/lib.rs", "sway-lib-std/generate.sh", "sway-lib-std/src/clone.sw", "sway-lib-std/src/codec.sw", "sway-lib-std/src/debug.sw", "sway-li...
[]
diff --git a/test/README.md b/test/README.md index 39523895d49..64cfe6b0d60 100644 --- a/test/README.md +++ b/test/README.md @@ -120,7 +120,8 @@ To manipulate these blocks one can: ```toml cmds = [ { repeat = "for-each-block", cmds = [ - "forc test --path {root} --release --experimental const_generics" + ...
true
FuelLabs/sway
7,565
issue_to_patch
Confusing error message when using non-const `tx_field_id` in `__gtf` E.g: ``` let x = 0xA; let _ = __gtf::<raw_ptr>(0, x); ^ Could not evaluate initializer to a const declaration. ``` We should provide a clear error message explaining that `tx_field_id` must be a `u64` constant.
Add `dynamic_storage` experimental feature and offset to `srw` opcode
## Description This PR is the first step in implementing #7560. The PR: - bumps `fuel-vm` dependencies to v0.66. - bumps `fuel-core` dependencies to v0.48. - bumps `fuels-rs` dependencies to v0.77. - adds the `dynamic_storage` experimental feature. - extends the `srw` opcode with an immediate offset. - exte...
076d4388ebb9b596949c7b802ffc83261e69597c
e3c9bf0432891f033f82e35d8fefc5927d06bf9b
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12c8140031e..65da388ac2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -437,6 +437,14 @@ jobs: run: cargo run --locked --release -p forc -- build --release --locked --path ./test/src/sdk-harness --experimental str_...
[ ".github/workflows/ci.yml", "Cargo.lock", "Cargo.toml", "docs/book/src/reference/compiler_intrinsics.md", "forc-plugins/forc-debug/src/server/handlers/handle_variables.rs", "forc-test/gas_costs_values.json", "sway-ast/src/expr/op_code.rs", "sway-core/src/asm_generation/finalized_asm.rs", "sway-core/...
[ { "comment": "### `StateLoadWord` offset not hashed in function deduplication\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `offset` field on `FuelVmInstruction::StateLoadWord` is not included in the hash computation for function deduplication. Two functions that are identical except for different `...
diff --git a/sway-ir/tests/serialize/storage_load.ir b/sway-ir/tests/serialize/storage_load.ir index 0e3b61830c1..a83c9b6f09b 100644 --- a/sway-ir/tests/serialize/storage_load.ir +++ b/sway-ir/tests/serialize/storage_load.ir @@ -15,8 +15,8 @@ script { v1 = const b256 0x7fbd1192666bfac3767b890bd4d048c940879d316...
true
FuelLabs/sway
7,565
comment_to_fix
Add `dynamic_storage` experimental feature and offset to `srw` opcode
### `StateLoadWord` offset not hashed in function deduplication **Medium Severity** <!-- DESCRIPTION START --> The `offset` field on `FuelVmInstruction::StateLoadWord` is not included in the hash computation for function deduplication. Two functions that are identical except for different `StateLoadWord` offsets (e.g...
076d4388ebb9b596949c7b802ffc83261e69597c
e3c9bf0432891f033f82e35d8fefc5927d06bf9b
diff --git a/sway-ir/src/optimize/fn_dedup.rs b/sway-ir/src/optimize/fn_dedup.rs index cc524e29de6..86729268a77 100644 --- a/sway-ir/src/optimize/fn_dedup.rs +++ b/sway-ir/src/optimize/fn_dedup.rs @@ -252,9 +252,11 @@ fn hash_fn( | crate::FuelVmInstruction::Smo { .. } |...
[ "sway-ir/src/optimize/fn_dedup.rs" ]
[ { "comment": "### `StateLoadWord` offset not hashed in function deduplication\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `offset` field on `FuelVmInstruction::StateLoadWord` is not included in the hash computation for function deduplication. Two functions that are identical except for different `...
true
FuelLabs/sway
7,565
comment_to_fix
Add `dynamic_storage` experimental feature and offset to `srw` opcode
### Git branch patches in Cargo.toml must not be merged **High Severity** <!-- DESCRIPTION START --> The `[patch.crates-io]` section pins dependencies to unreleased git branches (`fuel-core` on `dento/dynamic-storage`, `fuels-rs` on `ironcev/clonable-isuseraccountvariables`, `fuel-vm` on main). If merged, the main br...
076d4388ebb9b596949c7b802ffc83261e69597c
e3c9bf0432891f033f82e35d8fefc5927d06bf9b
diff --git a/Cargo.toml b/Cargo.toml index 5ac30c6e3da..37efa59081c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,15 +41,14 @@ iter_over_hash_type = "deny" # Internal dependencies in order to propagate `workspace.version` # +# Forc forc = { path = "forc/", version = "0.70.3" } forc-pkg = { path = "forc-pkg/", v...
[ "Cargo.toml" ]
[ { "comment": "### Git branch patches in Cargo.toml must not be merged\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\nThe `[patch.crates-io]` section pins dependencies to unreleased git branches (`fuel-core` on `dento/dynamic-storage`, `fuels-rs` on `ironcev/clonable-isuseraccountvariables`, `fuel-vm` on ma...
true
FuelLabs/sway
7,565
comment_to_fix
Add `dynamic_storage` experimental feature and offset to `srw` opcode
### Unused `poke` function in new test file **Low Severity** <!-- DESCRIPTION START --> The `poke` function is defined with `#[inline(never)]` but never called anywhere in the file. It appears to be leftover scaffolding, possibly copied from another test that needed to prevent dead-code elimination. <!-- DESCRIPTION ...
076d4388ebb9b596949c7b802ffc83261e69597c
e3c9bf0432891f033f82e35d8fefc5927d06bf9b
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/storage_instructions/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/storage_instructions/src/main.sw new file mode 100644 index 00000000000..24980b78e93 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pa...
[ "test/src/e2e_vm_tests/test_programs/should_pass/language/asm/storage_instructions/src/main.sw" ]
[ { "comment": "### Unused `poke` function in new test file\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nThe `poke` function is defined with `#[inline(never)]` but never called anywhere in the file. It appears to be leftover scaffolding, possibly copied from another test that needed to prevent dead-code eli...
true
FuelLabs/sway
7,588
issue_to_patch
Add comprehensive benchmarks for `StorageVec`
## Description This PR is a continuation of #7583. It adds additional benchmarks for benchmarking all `StorageVec` API methods for different element sizes and different number of elements stored. The `README.md` explains the benchmarks and how to use the benchmarking infrastructure. The `RESULTS.md` contains t...
551e37f20aa44e49f2520e333e2934b3d209f820
c26d6fc22d061f92aef1e6435c589918e3ac2c37
[ "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/RESULTS.md", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/bench_storage_vec.sh", "test/src/e2e_vm_tests/test_programs/should_pass/storage_b...
[]
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md index f03ee0b1165..453bbf2516b 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md +++ b/test/src/e2e_vm_tests/te...
true
FuelLabs/sway
7,587
issue_to_patch
Pin tracing-subscriber to 0.3.19
## Summary Pin `tracing-subscriber` to `0.3.19`. ## Why `forc` output regressed because newer `tracing-subscriber` releases escape ANSI sequences in normal terminal output. This was not a snapshot-test-only issue; it changed compiler and CLI output behavior in general. Pinning to `0.3.19` restores the previous behav...
31d4ea8e68762d7a6fdeb572bccd439b2e5213f9
a73428e7bf6d4cbd47bce903a89a36f156e78f1d
diff --git a/.github/workflows/scripts/check-dep-versions/src/main.rs b/.github/workflows/scripts/check-dep-versions/src/main.rs index 0015e6a8311..066d15232c6 100644 --- a/.github/workflows/scripts/check-dep-versions/src/main.rs +++ b/.github/workflows/scripts/check-dep-versions/src/main.rs @@ -7,9 +7,16 @@ use toml::...
[ ".github/workflows/scripts/check-dep-versions/src/main.rs", "Cargo.lock", "Cargo.toml" ]
[]
true
FuelLabs/sway
7,585
issue_to_patch
Remove forc-mcp from sway repo
## Summary This temporarily removes `forc-mcp` from the Sway repo so we can unblock the upcoming Sway release work and break the current release-order circular dependency. The immediate issue is that `forc-mcp` still lives in this repo while depending on `forc-client` from the `forc` repo, which makes the Sway and Fo...
cd2aa3562318186e6316edc89721084c69099f56
da43263b2d39149139144f0ff2badec8efcaea12
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e379449fce..12c8140031e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,6 +235,8 @@ jobs: run: cargo install --locked --path ./forc - name: Install Forc plugins run: | + cargo uninstall...
[ ".github/workflows/ci.yml", ".github/workflows/gh-pages.yml", "Cargo.lock", "Cargo.toml", "docs/book/src/SUMMARY.md", "docs/book/src/forc/plugins/forc_mcp/forc_call_tool/common_commands.md", "docs/book/src/forc/plugins/forc_mcp/forc_call_tool/contract_samples.md", "docs/book/src/forc/plugins/forc_mcp/...
[]
diff --git a/forc-plugins/forc-mcp/test/data/contract_with_types/Forc.toml b/forc-plugins/forc-mcp/test/data/contract_with_types/Forc.toml deleted file mode 100644 index 90dae6aa4f1..00000000000 --- a/forc-plugins/forc-mcp/test/data/contract_with_types/Forc.toml +++ /dev/null @@ -1,5 +0,0 @@ -[project] -authors = ["Fue...
true
FuelLabs/sway
7,299
issue_to_patch
Optimize initialization of array repeat when the initial value is zero
## Description Continuation of https://github.com/FuelLabs/sway/issues/6860. This PR improves performance of arrays initialized with zero like `[0u16; 5]`. Before, the compiler was initializing the array with `SW` or using a loop, depending on the array size. Now it is being initialized with just one `MCLI`. E...
f9fcb0edc308edba34d9cbf43ade15882614677d
fb2758255a53ebad95a74d269d688cf435846d45
diff --git a/sway-core/src/abi_generation/abi_str.rs b/sway-core/src/abi_generation/abi_str.rs index decaaf27b38..263122461a0 100644 --- a/sway-core/src/abi_generation/abi_str.rs +++ b/sway-core/src/abi_generation/abi_str.rs @@ -57,8 +57,11 @@ impl TypeId { } (TypeInfo::Array(_, length...
[ "sway-core/src/abi_generation/abi_str.rs", "sway-core/src/asm_generation/evm/evm_asm_builder.rs", "sway-core/src/asm_generation/fuel/fuel_asm_builder.rs", "sway-core/src/asm_lang/allocated_ops.rs", "sway-core/src/asm_lang/virtual_immediate.rs", "sway-core/src/ir_generation/function.rs", "sway-core/src/s...
[ { "comment": "Is that intended to be implemented in a later PR or what?", "path": "sway-core/src/asm_generation/evm/evm_asm_builder.rs", "hunk": "@@ -353,6 +353,9 @@ impl<'ir, 'eng> EvmAsmBuilder<'ir, 'eng> {\n dst_val_ptr,\n src_val_ptr,\n } => se...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/language/const_generics/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_fail/language/const_generics/stdout.snap index c8b0e93b214..6a84614ef2b 100644 --- a/test/src/e2e_vm_tests/test_programs/should_fail/language/const_generics/stdout.snap +++ b/tes...
true
FuelLabs/sway
7,299
comment_to_fix
Optimize initialization of array repeat when the initial value is zero
Is that intended to be implemented in a later PR or what?
f9fcb0edc308edba34d9cbf43ade15882614677d
fb2758255a53ebad95a74d269d688cf435846d45
diff --git a/sway-core/src/asm_generation/evm/evm_asm_builder.rs b/sway-core/src/asm_generation/evm/evm_asm_builder.rs index 16fd7fd2758..989258ea575 100644 --- a/sway-core/src/asm_generation/evm/evm_asm_builder.rs +++ b/sway-core/src/asm_generation/evm/evm_asm_builder.rs @@ -353,6 +353,9 @@ impl<'ir, 'eng> EvmAsmBuild...
[ "sway-core/src/asm_generation/evm/evm_asm_builder.rs" ]
[ { "comment": "Is that intended to be implemented in a later PR or what?", "path": "sway-core/src/asm_generation/evm/evm_asm_builder.rs", "hunk": "@@ -353,6 +353,9 @@ impl<'ir, 'eng> EvmAsmBuilder<'ir, 'eng> {\n dst_val_ptr,\n src_val_ptr,\n } => se...
true
FuelLabs/sway
7,299
comment_to_fix
Optimize initialization of array repeat when the initial value is zero
`VirtualImmediate18::new_unchecked` must never be used without a check if the value actually fits into 18 bits. My general issue with `new_unchecked` is that it gives us a false sense of security. It will panic, but only if the provided value is larger then the underlying type, which is `u32` for `VirtualImmediate18`....
f9fcb0edc308edba34d9cbf43ade15882614677d
fb2758255a53ebad95a74d269d688cf435846d45
diff --git a/sway-core/src/asm_generation/fuel/fuel_asm_builder.rs b/sway-core/src/asm_generation/fuel/fuel_asm_builder.rs index 08b86dcd2e2..112c912c750 100644 --- a/sway-core/src/asm_generation/fuel/fuel_asm_builder.rs +++ b/sway-core/src/asm_generation/fuel/fuel_asm_builder.rs @@ -24,7 +24,6 @@ use crate::{ Bui...
[ "sway-core/src/asm_generation/fuel/fuel_asm_builder.rs" ]
[ { "comment": "`VirtualImmediate18::new_unchecked` must never be used without a check if the value actually fits into 18 bits.\n\nMy general issue with `new_unchecked` is that it gives us a false sense of security. It will panic, but only if the provided value is larger then the underlying type, which is `u32` f...
true
FuelLabs/sway
7,410
issue_to_patch
Bump to v0.69.4
7d45f82d11a7df26ac1b868ad9a87ccb1c553ad7
e907a527f40108ae144a797b50fec08d34b18781
diff --git a/Cargo.lock b/Cargo.lock index 4e45b7420dc..d2973e9fdc0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3712,7 +3712,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "forc" -version = "0.69.3" +version = "0.69.4" dependencies = [ "annotate-snippets", ...
[ "Cargo.lock", "Cargo.toml", "sway-lib-std/Forc.toml" ]
[]
true
FuelLabs/sway
7,239
issue_to_patch
Fix forc-test dependency to include the tx feature
b9ac2a9bdb2069b1c70637be4e2d4ae93361c73f
4103313d4ff0fa69cee7493bd95c8453b929d9ff
diff --git a/forc-test/Cargo.toml b/forc-test/Cargo.toml index 5b14752cd2f..cc65b23aeb2 100644 --- a/forc-test/Cargo.toml +++ b/forc-test/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true [dependencies] anyhow.workspace = true forc-pkg.workspace = true -forc-util.workspace = true +forc-util = { workspace = tr...
[ "forc-test/Cargo.toml" ]
[]
true
FuelLabs/sway
7,583
issue_to_patch
Add comprehensive benchmarks for storage access
## Description This PR adds comprehensive benchmarks for storage fields access. We want to have the benchmark and historical values collected, in order to be able to compare them with the storage access costs after #7560 is implemented. The `README.md` explains the benchmarks and how to use the benchmarking infra...
8e643df9de76cb6dbf7972382fed15f820230cff
97f3a232bbf7ffc26f16a0f9492c4b7983a4d2e8
[ "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/RESULTS.md", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/bench.sh", "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/st...
[ { "comment": "### Wrong package name in stored_types Forc.lock\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nThe `stored_types/Forc.lock` is a verbatim copy of the `storage_slot_key_calculation/Forc.lock` from a different project. It declares `name = \"storage_slot_key_calculation\"` instead of `\"stored_t...
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md new file mode 100644 index 00000000000..f03ee0b1165 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/README.md @@...
true
FuelLabs/sway
7,583
comment_to_fix
Add comprehensive benchmarks for storage access
### Wrong package name in stored_types Forc.lock **Low Severity** <!-- DESCRIPTION START --> The `stored_types/Forc.lock` is a verbatim copy of the `storage_slot_key_calculation/Forc.lock` from a different project. It declares `name = "storage_slot_key_calculation"` instead of `"stored_types"`, and lists `std` as a d...
8e643df9de76cb6dbf7972382fed15f820230cff
97f3a232bbf7ffc26f16a0f9492c4b7983a4d2e8
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/stored_types/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/stored_types/Forc.lock new file mode 100644 index 00000000000..2105ecffce8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/stora...
[ "test/src/e2e_vm_tests/test_programs/should_pass/storage_benchmarks/stored_types/Forc.lock" ]
[ { "comment": "### Wrong package name in stored_types Forc.lock\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nThe `stored_types/Forc.lock` is a verbatim copy of the `storage_slot_key_calculation/Forc.lock` from a different project. It declares `name = \"storage_slot_key_calculation\"` instead of `\"stored_t...
true
FuelLabs/sway
7,247
issue_to_patch
bump to 0.68.9
## Description ~~waiting on #7246 which fixes a critical bug in `forc pkg`~~ ## 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). ...
b21e87e4aa0ea6a7ebf1ff24b5f0474ff71e42b7
ba4b97c051240b8678ff82d9b604dd2703b46e45
diff --git a/Cargo.lock b/Cargo.lock index c70a843a305..e149dbb7027 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2880,7 +2880,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "forc" -version = "0.68.8" +version = "0.68.9" dependencies = [ "annotate-snippets", ...
[ "Cargo.lock", "Cargo.toml", "sway-lib-std/Forc.toml", "sway-lsp/tests/lib.rs" ]
[]
diff --git a/sway-lsp/tests/lib.rs b/sway-lsp/tests/lib.rs index 284ffc7ab66..ce752d2caf0 100644 --- a/sway-lsp/tests/lib.rs +++ b/sway-lsp/tests/lib.rs @@ -294,7 +294,8 @@ fn sync_with_updates_to_manifest_in_workspace() { }); } -#[test] +#[allow(dead_code)] +// #[test] fn did_cache_test() { run_async!({ ...
true
FuelLabs/sway
7,580
issue_to_patch
`cfg` attribute not working in `impl Contract` E.g., this compiles as expected: ```sway contract; abi MyContract { fn some_contract_method(); } impl MyContract for Contract { #[cfg(experimental_new_encoding = true)] fn some_contract_method() { } #[cfg(experimental_new_encoding = false)] fn some...
Support attributes and constants in self `impl Contract`s
## Description This PR effectively re-implements self `impl Contract` implementation in order to: - properly handle attributes: - fix #7574 by `cfg_eval`ing items before adding them to the contract's interface surface and items. - add missing error-handling of invalid attributes. - take over applicable at...
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/language/parsed/declaration/impl_trait.rs b/sway-core/src/language/parsed/declaration/impl_trait.rs index b5dc4632a07..420d623008c 100644 --- a/sway-core/src/language/parsed/declaration/impl_trait.rs +++ b/sway-core/src/language/parsed/declaration/impl_trait.rs @@ -61,8 +61,11 @@ impl DebugWi...
[ "sway-core/src/language/parsed/declaration/impl_trait.rs", "sway-core/src/transform/attribute.rs", "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs", "test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_target_contract_self_impl/Forc.lock", "test/src/e2e_vm_tests/test_programs/sh...
[ { "comment": "### Wrong filter allows excluded attributes on ABI interface\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe code comment at lines 976–978 explicitly states that `#[inline]` is \"not on the ABI interface method itself,\" yet the filter calls `can_annotate_abi_or_trait_item_fn` which retu...
diff --git a/test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_target_contract_self_impl/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_fail/attributes_invalid_target_contract_self_impl/Forc.lock new file mode 100644 index 00000000000..0e3fb051ae8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_...
true
FuelLabs/sway
7,580
comment_to_fix
Support attributes and constants in self `impl Contract`s
### Wrong filter allows excluded attributes on ABI interface **Medium Severity** <!-- DESCRIPTION START --> The code comment at lines 976–978 explicitly states that `#[inline]` is "not on the ABI interface method itself," yet the filter calls `can_annotate_abi_or_trait_item_fn` which returns `true` for `Inline`, `Tra...
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs index c75ecae6cd3..e27d5275d32 100644 --- a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs +++ b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs @@ -5,7 +5,...
[ "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs" ]
[ { "comment": "### Wrong filter allows excluded attributes on ABI interface\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe code comment at lines 976–978 explicitly states that `#[inline]` is \"not on the ABI interface method itself,\" yet the filter calls `can_annotate_abi_or_trait_item_fn` which retu...
true
FuelLabs/sway
7,580
comment_to_fix
Support attributes and constants in self `impl Contract`s
### Shared constant declaration ID between ABI and impl **Medium Severity** <!-- DESCRIPTION START --> The `Const` case reuses the same `ParsedDeclId` for both `TraitItem::Constant` (ABI interface surface) and `ImplItem::Constant` (impl items). Unlike the `Fn` case — which creates separate declarations with different...
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs index c75ecae6cd3..e27d5275d32 100644 --- a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs +++ b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs @@ -5,7 +5,...
[ "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs" ]
[ { "comment": "### Shared constant declaration ID between ABI and impl\n\n**Medium Severity**\n\n<!-- DESCRIPTION START -->\nThe `Const` case reuses the same `ParsedDeclId` for both `TraitItem::Constant` (ABI interface surface) and `ImplItem::Constant` (impl items). Unlike the `Fn` case — which creates separate ...
true
FuelLabs/sway
7,580
comment_to_fix
Support attributes and constants in self `impl Contract`s
Documentation only shows this attribute on types, but it seems strange that we cannot change abi names of fns on abis....
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/transform/attribute.rs b/sway-core/src/transform/attribute.rs index 9dda56c00f8..fd144d75441 100644 --- a/sway-core/src/transform/attribute.rs +++ b/sway-core/src/transform/attribute.rs @@ -582,6 +582,29 @@ impl Attribute { } } + pub(crate) fn can_annotate_abi(&self) -> boo...
[ "sway-core/src/transform/attribute.rs" ]
[ { "comment": "Documentation only shows this attribute on types, but it seems strange that we cannot change abi names of fns on abis....", "path": "sway-core/src/transform/attribute.rs", "hunk": "@@ -699,6 +732,85 @@ impl Attribute {\n }\n }\n \n+ /// True if `self` can annotate an *interf...
true
FuelLabs/sway
7,580
comment_to_fix
Support attributes and constants in self `impl Contract`s
Same.
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/transform/attribute.rs b/sway-core/src/transform/attribute.rs index 9dda56c00f8..fd144d75441 100644 --- a/sway-core/src/transform/attribute.rs +++ b/sway-core/src/transform/attribute.rs @@ -582,6 +582,29 @@ impl Attribute { } } + pub(crate) fn can_annotate_abi(&self) -> boo...
[ "sway-core/src/transform/attribute.rs" ]
[ { "comment": "Same.", "path": "sway-core/src/transform/attribute.rs", "hunk": "@@ -699,6 +732,85 @@ impl Attribute {\n }\n }\n \n+ /// True if `self` can annotate an *interface* function of a trait or ABI.\n+ /// E.g.:\n+ /// ```ignore\n+ /// trait Trait {\n+ /// #[some_attr...
true
FuelLabs/sway
7,580
comment_to_fix
Support attributes and constants in self `impl Contract`s
Probably better to whitelist what we support, right? Just to be sure.
cf207d23df1ded1b21b0fb00a5cfb56175e0f354
a62000fc6206dad3d5136cf66f548a795663a625
diff --git a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs index c75ecae6cd3..e27d5275d32 100644 --- a/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs +++ b/sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs @@ -5,7 +5,...
[ "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs" ]
[ { "comment": "Probably better to whitelist what we support, right? Just to be sure.", "path": "sway-core/src/transform/to_parsed_lang/convert_parse_tree.rs", "hunk": "@@ -892,140 +909,177 @@ pub fn item_impl_to_declaration(\n }\n }\n \n+/// Compiler generated declarations for an `impl Contract` bloc...
true
FuelLabs/sway
7,566
issue_to_patch
Slides for trivial encoding, const generics and dbg
## Description Slides and better documentation for trivial encoding, const generics and `__dbg`. ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, a...
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/const_generics.md b/docs/slides/const_generics.md new file mode 100644 index 00000000000..8e0455d307a --- /dev/null +++ b/docs/slides/const_generics.md @@ -0,0 +1,76 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Const Generics + +`const generics` let you parameteri...
[ "docs/slides/const_generics.md", "docs/slides/dbg.md", "docs/slides/trivial_encoding.md" ]
[ { "comment": "```suggestion\nThis allowed us to implement all the `std` traits for arrays, string arrays etc.\n```", "path": "docs/slides/const_generics.md", "hunk": "@@ -0,0 +1,76 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Const Generics\n+\n+`const generics` let...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion This allowed us to implement all the `std` traits for arrays, string arrays etc. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/const_generics.md b/docs/slides/const_generics.md new file mode 100644 index 00000000000..8e0455d307a --- /dev/null +++ b/docs/slides/const_generics.md @@ -0,0 +1,76 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Const Generics + +`const generics` let you parameteri...
[ "docs/slides/const_generics.md" ]
[ { "comment": "```suggestion\nThis allowed us to implement all the `std` traits for arrays, string arrays etc.\n```", "path": "docs/slides/const_generics.md", "hunk": "@@ -0,0 +1,76 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Const Generics\n+\n+`const generics` let...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion - etc. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/const_generics.md b/docs/slides/const_generics.md new file mode 100644 index 00000000000..8e0455d307a --- /dev/null +++ b/docs/slides/const_generics.md @@ -0,0 +1,76 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Const Generics + +`const generics` let you parameteri...
[ "docs/slides/const_generics.md" ]
[ { "comment": "```suggestion\n- etc.\n```", "path": "docs/slides/const_generics.md", "hunk": "@@ -0,0 +1,76 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Const Generics\n+\n+`const generics` let you parameterize types and functions with compile‑time constant values, e...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion "const generics" can be used on structs, enums, functions, impls etc. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/const_generics.md b/docs/slides/const_generics.md new file mode 100644 index 00000000000..8e0455d307a --- /dev/null +++ b/docs/slides/const_generics.md @@ -0,0 +1,76 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Const Generics + +`const generics` let you parameteri...
[ "docs/slides/const_generics.md" ]
[ { "comment": "```suggestion\n\"const generics\" can be used on structs, enums, functions, impls etc.\n```", "path": "docs/slides/const_generics.md", "hunk": "@@ -0,0 +1,76 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Const Generics\n+\n+`const generics` let you para...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion - What it does ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\n- What it does\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Sway `__dbg`\n+\n+- What it does?", "resolving_sha": "c9e6eae53020e7a85177b2a89abecb9f52895881", "resolving_...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion All other primitive `impls` live in `sway-lib-std/src/debug.sw`. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nAll other primitive `impls` live in `sway-lib-std/src/debug.sw`.\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Sway `__dbg`\n+\n+- What it does?\n+- How it works (High Level)\n+...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion We reserved [0, 1000), for the VM, [1000, 2000) for the compiler and [2000, 3000) for the tooling purposes. This way, we can avoid a program having different behavior depending on the interpreter configuration. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nWe reserved [0, 1000), for the VM, [1000, 2000) for the compiler and [2000, 3000) for the tooling purposes. This way, we can avoid a program having different behavior depending on the interpreter configuration.\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion Real implementation in `forc-test/src/ecal.rs` ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nReal implementation in `forc-test/src/ecal.rs`\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Sway `__dbg`\n+\n+- What it does?\n+- How it works (High Level)\n+- How it works (Lo...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion Different from `AbiEncode`, `Debug` auto implementation works for any primitive data type, including `raw_ptr`, `raw_slice`, references, etc. So the compiler will generate auto implementation for any type, unless a custom implementation is found. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nDifferent from `AbiEncode`, `Debug` auto implementation works for any primitive data type, including `raw_ptr`, `raw_slice`, references, etc. So the compiler will generate auto implementation for any type, unless a custom implementation is found.\n```", "path": "docs/slides/dbg....
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion So deploying binaries with it would be wasteful. ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nSo deploying binaries with it would be wasteful.\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Sway `__dbg`\n+\n+- What it does?\n+- How it works (High Level)\n+- How it works (...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion But, if there is a troubleshooting needed in release build, one can force the compiler to emit `__dbg` by using: ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/dbg.md b/docs/slides/dbg.md new file mode 100644 index 00000000000..b7a72f6c201 --- /dev/null +++ b/docs/slides/dbg.md @@ -0,0 +1,215 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Sway `__dbg` + +- What it does +- How it works (High Level) +- How it works (Low Leve...
[ "docs/slides/dbg.md" ]
[ { "comment": "```suggestion\nBut, if there is a troubleshooting needed in release build, one can force the compiler to emit `__dbg` by using:\n```", "path": "docs/slides/dbg.md", "hunk": "@@ -0,0 +1,214 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownlint-disable -->\n+# Sway `__dbg`\n+\n+...
true
FuelLabs/sway
7,566
comment_to_fix
Slides for trivial encoding, const generics and dbg
```suggestion If developers are OK with the risks and wants to deal with invalid representation manually, they can force triviality of a type by doing: ```
0d16c93b2470d61f669dc7907d53eb20aeb444f4
c9e6eae53020e7a85177b2a89abecb9f52895881
diff --git a/docs/slides/trivial_encoding.md b/docs/slides/trivial_encoding.md new file mode 100644 index 00000000000..925df7ac951 --- /dev/null +++ b/docs/slides/trivial_encoding.md @@ -0,0 +1,176 @@ +--- +layout: cover +marp: true +--- + +<!-- markdownlint-disable --> +# Trivially Encodable/Decodable Types + +- Encod...
[ "docs/slides/trivial_encoding.md" ]
[ { "comment": "```suggestion\nIf developers are OK with the risks and wants to deal with invalid representation manually, they can force triviality of a type by doing:\n```", "path": "docs/slides/trivial_encoding.md", "hunk": "@@ -0,0 +1,176 @@\n+---\n+layout: cover\n+marp: true\n+---\n+\n+<!-- markdownl...
true
FuelLabs/sway
7,561
issue_to_patch
Optimise `pshl`
## Description Change the order of register allocation... instead of starting from "lower" registers... it starts from higher registers... that means that for functions with very few registers, there is no need to save them with `pshl`. Example: ```sway #[inline(never)] fn leaf_fn_6(a: u64, b: u64, c: u64, d: u...
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index abdfde3511e..726d4ee65e8 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/alloc...
[ "forc-plugins/forc-debug/tests/server_integration.rs", "forc/tests/cli_integration.rs", "sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs", "sway-core/src/asm_generation/fuel/compiler_constants.rs", "sway-core/src/asm_generation/fuel/programs/abstract.rs", "sway-core/src/asm_lang/al...
[ { "comment": "### Off-by-one excludes valid register 16 from allocation\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\nThe boundary check `if id <= 16` incorrectly excludes register 16, which is a valid allocatable register. `NUM_ALLOCATABLE_REGISTERS` is 37, so the register allocator creates `Allocated(0)...
diff --git a/forc-plugins/forc-debug/tests/server_integration.rs b/forc-plugins/forc-debug/tests/server_integration.rs index 30d71f0f10a..3e7d8ee9eb5 100644 --- a/forc-plugins/forc-debug/tests/server_integration.rs +++ b/forc-plugins/forc-debug/tests/server_integration.rs @@ -315,10 +315,10 @@ fn test_sourcemap_build()...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
### Off-by-one excludes valid register 16 from allocation **High Severity** <!-- DESCRIPTION START --> The boundary check `if id <= 16` incorrectly excludes register 16, which is a valid allocatable register. `NUM_ALLOCATABLE_REGISTERS` is 37, so the register allocator creates `Allocated(0)` through `Allocated(36)`. ...
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_lang/allocated_ops.rs b/sway-core/src/asm_lang/allocated_ops.rs index 435fad05fa6..9c61b8f1ca8 100644 --- a/sway-core/src/asm_lang/allocated_ops.rs +++ b/sway-core/src/asm_lang/allocated_ops.rs @@ -12,7 +12,9 @@ use super::*; use crate::{ asm_generation::fuel::{ - compiler_c...
[ "sway-core/src/asm_lang/allocated_ops.rs" ]
[ { "comment": "### Off-by-one excludes valid register 16 from allocation\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\nThe boundary check `if id <= 16` incorrectly excludes register 16, which is a valid allocatable register. `NUM_ALLOCATABLE_REGISTERS` is 37, so the register allocator creates `Allocated(0)...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
### Commented-out debug eprintln left in code **Low Severity** <!-- DESCRIPTION START --> A commented-out `eprintln!` debug statement was left in the code. This looks like a development/debugging artifact that wasn't cleaned up before committing. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: d61cff86-9b19-4db3-a0df-5...
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs b/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs index abdfde3511e..726d4ee65e8 100644 --- a/sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs +++ b/sway-core/src/asm_generation/fuel/alloc...
[ "sway-core/src/asm_generation/fuel/allocated_abstract_instruction_set.rs" ]
[ { "comment": "### Commented-out debug eprintln left in code\n\n**Low Severity**\n\n<!-- DESCRIPTION START -->\nA commented-out `eprintln!` debug statement was left in the code. This looks like a development/debugging artifact that wasn't cleaned up before committing.\n<!-- DESCRIPTION END -->\n\n<!-- BUGBOT_BUG...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
### Unresolved git merge conflict markers in snapshot files **High Severity** <!-- DESCRIPTION START --> Multiple snapshot files (`.snap`) contain unresolved git merge conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`). These appear in at least a dozen test snapshot files including `array_repeat`, `const_generics`, `...
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap index 6199f3cdf73..a4d299310c5 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.sn...
[ "test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap" ]
[ { "comment": "### Unresolved git merge conflict markers in snapshot files\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\nMultiple snapshot files (`.snap`) contain unresolved git merge conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`). These appear in at least a dozen test snapshot files including `array_r...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
```suggestion (3, 1, "main function parameters"), // Should have 1 instruction ```
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/forc-plugins/forc-debug/tests/server_integration.rs b/forc-plugins/forc-debug/tests/server_integration.rs index 30d71f0f10a..3e7d8ee9eb5 100644 --- a/forc-plugins/forc-debug/tests/server_integration.rs +++ b/forc-plugins/forc-debug/tests/server_integration.rs @@ -315,10 +315,10 @@ fn test_sourcemap_build()...
[ "forc-plugins/forc-debug/tests/server_integration.rs" ]
[ { "comment": "```suggestion\n (3, 1, \"main function parameters\"), // Should have 1 instruction\n```", "path": "forc-plugins/forc-debug/tests/server_integration.rs", "hunk": "@@ -315,10 +315,10 @@ fn test_sourcemap_build() {\n // Verify essential source locations are mapped correctly\n l...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
```suggestion (11, 1, "helper function parameters"), // Should have 1 instruction ```
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/forc-plugins/forc-debug/tests/server_integration.rs b/forc-plugins/forc-debug/tests/server_integration.rs index 30d71f0f10a..3e7d8ee9eb5 100644 --- a/forc-plugins/forc-debug/tests/server_integration.rs +++ b/forc-plugins/forc-debug/tests/server_integration.rs @@ -315,10 +315,10 @@ fn test_sourcemap_build()...
[ "forc-plugins/forc-debug/tests/server_integration.rs" ]
[ { "comment": "```suggestion\n (11, 1, \"helper function parameters\"), // Should have 1 instruction\n```", "path": "forc-plugins/forc-debug/tests/server_integration.rs", "hunk": "@@ -315,10 +315,10 @@ fn test_sourcemap_build() {\n // Verify essential source locations are mapped correctly\n ...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
The `NUM_FREE_REGISTERS` is removed. The original comment was describing that const as well, which actually should have been a regular and not a doc-comment than. The suggestion is to simply remove the comment. ```suggestion ```
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_generation/fuel/compiler_constants.rs b/sway-core/src/asm_generation/fuel/compiler_constants.rs index a8526958a8c..ba86a21b620 100644 --- a/sway-core/src/asm_generation/fuel/compiler_constants.rs +++ b/sway-core/src/asm_generation/fuel/compiler_constants.rs @@ -1,7 +1,6 @@ -/// The total ...
[ "sway-core/src/asm_generation/fuel/compiler_constants.rs" ]
[ { "comment": "The `NUM_FREE_REGISTERS` is removed. The original comment was describing that const as well, which actually should have been a regular and not a doc-comment than. The suggestion is to simply remove the comment.\n```suggestion\n```", "path": "sway-core/src/asm_generation/fuel/compiler_constants...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
The comment is quite confusing because it says "register*s*" and "as others", although it just defines the value of the flags register, which is exactly what the const name `FLAGS_REGISTER` says. IMO, we should just remove the comment. The const name is more than self descriptive. ```suggestion ```
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_generation/fuel/compiler_constants.rs b/sway-core/src/asm_generation/fuel/compiler_constants.rs index a8526958a8c..ba86a21b620 100644 --- a/sway-core/src/asm_generation/fuel/compiler_constants.rs +++ b/sway-core/src/asm_generation/fuel/compiler_constants.rs @@ -1,7 +1,6 @@ -/// The total ...
[ "sway-core/src/asm_generation/fuel/compiler_constants.rs" ]
[ { "comment": "The comment is quite confusing because it says \"register*s*\" and \"as others\", although it just defines the value of the flags register, which is exactly what the const name `FLAGS_REGISTER` says. IMO, we should just remove the comment. The const name is more than self descriptive.\n```suggesti...
true
FuelLabs/sway
7,561
comment_to_fix
Optimise `pshl`
Suggestion is to remove the actual numbers because they can change in the future. Instead, have the const names in brackets makes it possible to see the value if needed, by just hovering over in IDE. ```suggestion /// First allocated register starts at [UPPER_ALLOCATABLE_REGISTER] and goes /// down until [LOWER...
d71243f17aba2ac1a6af8d0659a573cab7517e38
91cad8715014c01bf53f49a3ec87e4812840578a
diff --git a/sway-core/src/asm_lang/allocated_ops.rs b/sway-core/src/asm_lang/allocated_ops.rs index 435fad05fa6..9c61b8f1ca8 100644 --- a/sway-core/src/asm_lang/allocated_ops.rs +++ b/sway-core/src/asm_lang/allocated_ops.rs @@ -12,7 +12,9 @@ use super::*; use crate::{ asm_generation::fuel::{ - compiler_c...
[ "sway-core/src/asm_lang/allocated_ops.rs" ]
[ { "comment": "Suggestion is to remove the actual numbers because they can change in the future. Instead, have the const names in brackets makes it possible to see the value if needed, by just hovering over in IDE.\n```suggestion\n /// First allocated register starts at [UPPER_ALLOCATABLE_REGISTER] and goes\n...
true
FuelLabs/sway
7,573
issue_to_patch
Bump quinn-proto from 0.11.12 to 0.11.14 in /test/src/sdk-harness
Bumps [quinn-proto](https://github.com/quinn-rs/quinn) from 0.11.12 to 0.11.14. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/quinn-rs/quinn/releases">quinn-proto's releases</a>.</em></p> <blockquote> <h2>quinn-proto 0.11.14</h2> <p><a href="https://github.com/jxs"><code>@​j...
645d81122780050a1f3cbf050756c1c7950d2335
9e8e9e3eb624e0a4f685c2b2fd3dbfd558b3c6fe
[ "test/src/sdk-harness/Cargo.lock" ]
[]
diff --git a/test/src/sdk-harness/Cargo.lock b/test/src/sdk-harness/Cargo.lock index d284ba23027..9769590845a 100644 --- a/test/src/sdk-harness/Cargo.lock +++ b/test/src/sdk-harness/Cargo.lock @@ -6078,9 +6078,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.12" +version = "0.11.14" source =...
true
FuelLabs/sway
7,550
issue_to_patch
`$err` register propagated from `move` to `eq` although `move` clears it Consider the following example: ```sway #[storage(read)] fn srdd_empty_slot() { let dest = [42u64; 2]; let is_err = asm(slot: B256_ZERO, res: __addr_of(dest), index: 0, len: dest.len()) { srdd res slot index len; err ...
Improve `asm` const propagation
## Description This PR optimises `ASM` const propagation. That means that it tries to use as few registers as possible, hoping that their initialisation can be removed later with DCE and others... This is particularly useful on function calls, and indexing: 1 - On function calls we normally have something like...
5cd44e7788de590177213e1b4040493b2db8b989
2765f4af57abc203a826d5890c77e4593c6095ff
diff --git a/Cargo.lock b/Cargo.lock index 2c6a09423f9..4c8b001d46e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9163,6 +9163,7 @@ dependencies = [ "clap", "dirs 5.0.1", "either", + "expect-test", "fuel-abi-types", "fuel-ethabi", "fuel-etk-asm", diff --git a/sway-core/Cargo.toml b/sway-core/Cargo.toml index...
[ "Cargo.lock", "forc/tests/cli_integration.rs", "sway-core/Cargo.toml", "sway-core/src/asm_generation/fuel/abstract_instruction_set.rs", "sway-core/src/asm_generation/fuel/optimizations/constant_propagate.rs", "sway-core/src/asm_generation/fuel/optimizations/mod.rs", "sway-core/src/asm_lang/mod.rs", "s...
[ { "comment": "### EXP optimization incorrectly folds `0^x` to zero\n\n**High Severity**\n\n<!-- DESCRIPTION START -->\nThe rule `if left is 0 assigns 0` for `EXP` assumes `0^x = 0` for all `x`, but `0^0 = 1`. When the left operand is known to be 0 and the right operand is unknown at compile time, the optimizer ...
diff --git a/forc/tests/cli_integration.rs b/forc/tests/cli_integration.rs index de22c0bf9d6..e383db3c042 100644 --- a/forc/tests/cli_integration.rs +++ b/forc/tests/cli_integration.rs @@ -51,10 +51,10 @@ fn test_forc_test_raw_logs() -> Result<(), rexpect::error::Error> { // Assert that the output is correct ...
true