Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDC multi-chunk contract loader #6237

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Commits on Jul 6, 2024

  1. LDC multi-chunk contract

    With the target contract broken down into chunks (with
    sizes that are word aligned), we can load it in pieces
    and then execute.
    vaivaswatha committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    0b66d55 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2024

  1. Add string slices to supported types message in match expressions (#6243

    )
    
    ## Description
    
    This PR adds `string slices` to `CURRENTLY_SUPPORTED_TYPES_MESSAGE` in
    `match` expressions. The support for string slices is added in #6202.
    
    ## Checklist
    
    - [x] I have linked to any relevant issues.
    - [ ] I have commented my code, particularly in hard-to-understand
    areas.
    - [ ] I have updated the documentation where relevant (API docs, the
    reference, and the Sway book).
    - [ ] If my change requires substantial documentation changes, I have
    [requested support from the DevRel
    team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
    - [ ] I have added tests that prove my fix is effective or that my
    feature works.
    - [ ] I have added (or requested a maintainer to add) the necessary
    `Breaking*` or `New Feature` labels where relevant.
    - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
    Code Review
    Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
    - [x] I have requested a review from the relevant team or maintainers.
    ironcev committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    9db4fe7 View commit details
    Browse the repository at this point in the history
  2. fix configurable tests (#6242)

    ## Description
    
    This PR recover configurable tests that were deleted by mistake.
    
    ## Checklist
    
    - [ ] I have linked to any relevant issues.
    - [ ] I have commented my code, particularly in hard-to-understand
    areas.
    - [ ] I have updated the documentation where relevant (API docs, the
    reference, and the Sway book).
    - [ ] If my change requires substantial documentation changes, I have
    [requested support from the DevRel
    team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
    - [ ] I have added tests that prove my fix is effective or that my
    feature works.
    - [ ] I have added (or requested a maintainer to add) the necessary
    `Breaking*` or `New Feature` labels where relevant.
    - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
    Code Review
    Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
    - [ ] I have requested a review from the relevant team or maintainers.
    
    ---------
    
    Co-authored-by: Joshua Batty <joshpbatty@gmail.com>
    xunilrj and JoshuaBatty committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    d8e57f3 View commit details
    Browse the repository at this point in the history
  3. re-enable LDC test (#6240)

    ## Description
    
    This test was disabled when we introduced encoding v1. But it has been
    fixed since and we can enable it again.
    
    
    ## Checklist
    
    - [ ] I have linked to any relevant issues.
    - [ ] I have commented my code, particularly in hard-to-understand
    areas.
    - [ ] I have updated the documentation where relevant (API docs, the
    reference, and the Sway book).
    - [ ] If my change requires substantial documentation changes, I have
    [requested support from the DevRel
    team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
    - [ ] I have added tests that prove my fix is effective or that my
    feature works.
    - [ ] I have added (or requested a maintainer to add) the necessary
    `Breaking*` or `New Feature` labels where relevant.
    - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
    Code Review
    Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
    - [ ] I have requested a review from the relevant team or maintainers.
    xunilrj committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    5db41b5 View commit details
    Browse the repository at this point in the history
  4. chore: remove snapshot, as accounts are funded by default (#6235)

    ## Description
    
    Removes local snapshot we were using to fund our accounts as it is now
    done by default as of FuelLabs/fuel-core#1894.
    By default `--default-signer` is signing it with the account funded by
    fuel-core out of the box.
    kayagokalp committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    ba46821 View commit details
    Browse the repository at this point in the history
  5. Fix Bytes, Vec and String buffer ownership (#6142)

    ## Description
    
    This PR fixes a problem with `std::Bytes`, `std::Vec` and `std::String`
    buffer ownership. It also fixes a problem with buffer overflow when
    encoding huge types.
    
    ## Buffer Ownership
    
    Currently, types like `Bytes`, `Vec` and `String` do not guarantee
    ownership of their buffer. That means that we can very easily alias the
    underlying buffer and change its mutability by simply creating a new
    instance.
    
    For example:
    
    ```sway
    let some_slice = ...;
    let buffer = Bytes::from(some_slice);
    let mut buffer2 = buffer.clone();
    // Now I can change `some_slice`
    ```
    
    ## Type Inference bug
    
    I also had to fix a small problem with the type inference of method
    applications. The problem is that sometimes the type check does not
    return an error on the first pass, but the type is still not concrete.
    
    For example `x.get(0) == Some(2)`, becomes `eq(x.get(0), Some(2))`.
    
    After the first pass, `x.get(0)` is correctly inferred to be
    `Option<u8>`; but `Some(2)` is only typed as `Option<Numeric>`. This
    happens because the first pass starts with `TypeInfo::Unknown`. We can
    use the argument types here because they may still be non-concrete types
    like "Self".
    
    What the fix is doing is that it checks if the inferred type
    `is_concrete`, assuming that `Numeric` is not. This will make "Some(2)"
    be type-checked again at the second pass, after monomorphization and be
    correctly typed as "Option<u8>".
    
    ## IR Verification errors
    
    This PR also improves the error message for IR verification. Now the
    error is shown inside the printed IR.
    
    
    ![image](https://github.com/FuelLabs/sway/assets/83425/4f9eae39-0ce2-428d-be46-a215797ee8dd)
    
    ## Script to update contract-ids (optional)
    
    At `test/update-contract-ids.sh` there is a small script that
    automatically updates contract ids. Unfortunately, given the indirect
    nature of contract calls, it is impossible for the script to know which
    contract it needs to compile. So we need to specify the path to the
    contract.
    
    We also need to pass the compiler flags, because in some cases we use
    `debug` profile, and in others we use `release`.
    
    ```sway
    const FUEL_COIN_CONTRACT_ID = 0x1a88d0982d216958d18378b6784614b75868a542dc05f8cc85cf3da44268c76c; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release
    ```
    
    In the example above, the path and flags are appended in the bash
    script. I failed trying to inject commands, so I think the append is
    safe.
    
    I can remove this from the PR, if we find that this is not the solution
    we want at the moment.
    
    ## Checklist
    
    - [ ] I have linked to any relevant issues.
    - [ ] I have commented my code, particularly in hard-to-understand
    areas.
    - [ ] I have updated the documentation where relevant (API docs, the
    reference, and the Sway book).
    - [ ] If my change requires substantial documentation changes, I have
    [requested support from the DevRel
    team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
    - [ ] I have added tests that prove my fix is effective or that my
    feature works.
    - [ ] I have added (or requested a maintainer to add) the necessary
    `Breaking*` or `New Feature` labels where relevant.
    - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
    Code Review
    Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
    - [ ] I have requested a review from the relevant team or maintainers.
    xunilrj committed Jul 8, 2024
    Configuration menu
    Copy the full SHA
    090187e View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2024

  1. Configuration menu
    Copy the full SHA
    7828029 View commit details
    Browse the repository at this point in the history
  2. Correctly handle Input::Message when calling msg_sender() (#6231)

    ## Description
    
    When the input type was of `Input::Message` and the `msg_sender()`
    function was called, it would revert. It now properly handle
    `Input::Message`.
    
    ## Checklist
    
    - [x] I have linked to any relevant issues.
    - [x] I have commented my code, particularly in hard-to-understand
    areas.
    - [x] I have updated the documentation where relevant (API docs, the
    reference, and the Sway book).
    - [ ] If my change requires substantial documentation changes, I have
    [requested support from the DevRel
    team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
    - [x] I have added tests that prove my fix is effective or that my
    feature works.
    - [x] I have added (or requested a maintainer to add) the necessary
    `Breaking*` or `New Feature` labels where relevant.
    - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
    Code Review
    Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
    - [x] I have requested a review from the relevant team or maintainers.
    
    ---------
    
    Co-authored-by: Kaya Gökalp <kaya.gokalp@fuel.sh>
    Co-authored-by: SwayStar123 <46050679+SwayStar123@users.noreply.github.com>
    3 people committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    f82d9e6 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. 0.54.1 compiling

    kayagokalp committed Jul 11, 2024
    Configuration menu
    Copy the full SHA
    18f41aa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    17cbbbc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1ff43cd View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Configuration menu
    Copy the full SHA
    8bac82c View commit details
    Browse the repository at this point in the history