Stabilize encoding v1
Now that #4769 has been implemented we should take the necessary steps to turn the experimental encoding into the default:
- Update documentation
- Improve error messages:
- https://github.com/FuelLabs/sway/pull/5915 improves messages for types that
AbiEncode/AbiDecodeimpl is not in scope; it can be because the type does not have one, orcoreis not accessible. - https://github.com/FuelLabs/sway/pull/6121 improves messages when the necessary decode function is not in scope for configuirables.
- https://github.com/FuelLabs/sway/pull/5915 improves messages for types that
- #6016
- Resolve any known bugs (notably with SDKs)
- https://github.com/FuelLabs/sway/pull/5703
- https://github.com/FuelLabs/sway/pull/5721
- https://github.com/FuelLabs/sway/pull/5723
- https://github.com/FuelLabs/sway/pull/5733
- Contract with
implicit_stdset tofalseand nocoreas dependency. - Certify all cli commands allows --experimental-new-encoding flag
- https://github.com/FuelLabs/sway/issues/5906
- Remove raw_slice, str and others limitations of inputs and outputs.
- Encode buffer size. Do we want limits? This https://github.com/FuelLabs/sway/pull/5915 makes the Buffer to be dynamic.
- call_with_function_selector
- Improve performance
- https://github.com/FuelLabs/sway/pull/5782
- Performance stats
Actions that needs to be undone after https://github.com/FuelLabs/sway/pull/5915 is merged:
Enable these tests again:
- should_pass/language/name_resolution_after_monomorphization (https://github.com/FuelLabs/sway/pull/5996)
- should_pass/language/shadowing/shadowed_glob_imports
- should_pass/language/name_resolution_inside_intrinsics
These seems to be a bug related with shadows and glob imports. These issues seem to point to similar issues: https://github.com/FuelLabs/sway/issues/5500, https://github.com/FuelLabs/sway/issues/5700
- sdk-harness/run_external_proxy https://github.com/FuelLabs/sway/pull/6240
Fix warnings of these tests
should_pass/dca/contract/superabi_contract_calls What happens here is that when we implement a trait for Contract, we actually generate two functions: one prefixed __contract_entry that is called by the method selector; and another one normal, that can be called freely. So, if the trait method is never called manually, it is marked as dead.
should_pass/dca/unused_fields auto-impl is making all fields being used. so no dead code warnings are being generated. We need to fix this. https://github.com/FuelLabs/sway/pull/6006
Nice to do for future versions:
1 - Contract method selector using match on string slices, ideally desugaring into radix matching;
2 - CEI analysis running normally on "__entry". We need CEI analysis to know about Never or be smart about control flow;
Improve the implementation to increase
Buffersize dynamically. Done by https://github.com/FuelLabs/sway/pull/6142, because the buffer intrinsic increase buffer correctly now.Bufferused by AbiEncode needs a push_bytes so we can be more efficient when encoding Bytes and others. This should decrease significantlygasusage in some cases. Done https://github.com/FuelLabs/sway/pull/5942, because we can encode slices directly now.
Encoding v1 for Configurables
- Avoid decoding configurable on each reference. Done by https://github.com/FuelLabs/sway/pull/6058.
- Small issue where
impl AbiEncode/Decodeis not in scope when calling contracts: https://github.com/FuelLabs/sway/issues/5936
From https://github.com/FuelLabs/sway/pull/5942
- Enable sdk-harness tests that were ignore. SDK needs to update configurable encoding.
- Correctly error when a type with custom impl for AbiEncode is used in configurables
- abi_encode_size_hint and numeric: Today we decay
Numericintou64. This should be fixed. - improve const_eval loops with time-based limit/warnings.
- https://github.com/FuelLabs/sway/issues/4352
Source: FuelLabs/sway