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

Bugfix: more receipt generation issues with debugger #908

Merged
merged 5 commits into from
Feb 10, 2025

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Feb 7, 2025

While #889 fixed some receipt generation issues it missed regenerating receipts_root after the debugger is done. Also the in-memory outputs were updated too early.

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • If performance characteristic of an instruction change, update gas costs as well or make a follow-up PR for that
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

@Dentosal Dentosal added the bug Something isn't working label Feb 7, 2025
@Dentosal Dentosal self-assigned this Feb 7, 2025
@Dentosal Dentosal marked this pull request as ready for review February 7, 2025 20:15
@Dentosal Dentosal requested a review from a team February 7, 2025 20:15
@@ -1042,16 +1044,11 @@ where
&self.balances,
gas_price,
)?;
self.update_transaction_outputs()?;
*self.tx.as_script_mut().unwrap().receipts_root_mut() = self.receipts.root();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whiel it is true that we run only script, I still prefer to sue if let Some(script)=)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top of the function we error if as_script() cannot be used. We only access it again like this to satisfy borrow checker.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then would be nice to have expect and the comment that point to the top=D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I don't think we should unwrap anywhere in our prod code. I prefer the type-safe approach too--expect is more acceptable than unwrap but it's fragile still.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 690a381.

fuel-vm/src/interpreter/internal.rs Show resolved Hide resolved
@Dentosal Dentosal marked this pull request as draft February 7, 2025 21:31
@Dentosal Dentosal marked this pull request as ready for review February 7, 2025 21:38
@Dentosal Dentosal requested review from a team and xgreenx February 7, 2025 21:48
@Dentosal Dentosal added this pull request to the merge queue Feb 10, 2025
Merged via the queue into master with commit 2fc9c5d Feb 10, 2025
40 checks passed
@Dentosal Dentosal deleted the dento/debugger-receipts-root-fix branch February 10, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants