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

fix fallback compilation on new encoding #6998

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Mar 6, 2025

Description

When running tests in contracts with the fallback function, we get an error with the __log intrinsic. The issue is that we needlessly compile the fallback function twice. And in some cases (numeric decay), the __log argument would return a TypeId that was not collected in the collect_metadata phase.

29 | 
30 |     use std::call_frames::*;
31 |     __log(3);
   |     ^^^^^^^^ Internal compiler error: Unable to determine ID for log instance.
Please file an issue on the repository and include the code that triggered this error.
32 |     __log(called_method());
33 |     __log("double_value");
   |
____

This was never caught because we only compile sdk-harness tests, we never run their unit tests in the CI. Which this PR is also doing.

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).
  • 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.
  • I have requested a review from the relevant team or maintainers.

@xunilrj xunilrj requested review from a team as code owners March 6, 2025 11:12
@xunilrj xunilrj temporarily deployed to fuel-sway-bot March 6, 2025 11:12 — with GitHub Actions Inactive
@xunilrj xunilrj self-assigned this Mar 6, 2025
Copy link

codspeed-hq bot commented Mar 6, 2025

CodSpeed Performance Report

Merging #6998 will not alter performance

Comparing xunilrj/fix-fallback-compilation (97e671e) with master (d46f08a)

Summary

✅ 22 untouched benchmarks

@xunilrj xunilrj marked this pull request as draft March 6, 2025 12:15
@xunilrj xunilrj temporarily deployed to fuel-sway-bot March 6, 2025 12:22 — with GitHub Actions Inactive
@xunilrj xunilrj marked this pull request as ready for review March 6, 2025 12:46
@IGI-111 IGI-111 requested a review from a team March 7, 2025 11:18
@IGI-111 IGI-111 temporarily deployed to fuel-sway-bot March 7, 2025 11:19 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants