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

Return correct PanicReason on memory-related panics #511

Merged
merged 19 commits into from
Aug 6, 2023

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Jul 14, 2023

Closes #38. Refactors the error handling code of multiple functions to leverage MemoryRange even more. Changes multiple panic reasons to be more accurate.

@Dentosal Dentosal added bug Something isn't working breaking A breaking api change labels Jul 14, 2023
@Dentosal Dentosal requested a review from a team July 14, 2023 19:23
@Dentosal Dentosal self-assigned this Jul 14, 2023
@Dentosal Dentosal marked this pull request as draft July 14, 2023 19:46
@Dentosal Dentosal removed the request for review from a team July 14, 2023 21:24
@Dentosal Dentosal changed the title Return correct PanicReason on write_bytes without ownership Return correct PanicReason on memory-related panics Jul 14, 2023
@Dentosal Dentosal marked this pull request as ready for review July 14, 2023 23:52
@Dentosal Dentosal requested a review from a team July 14, 2023 23:52
@Dentosal Dentosal requested review from xgreenx and Voxelot July 31, 2023 08:38
let contract_id = ContractId::from_bytes_ref(contract_id);

self.input_contracts.check(contract_id)?;
self.input_contracts.check(&contract_id)?;
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should perform this validation before filling the memory with zeros? It gives us a way to bail out of execution earlier before performing a potentially large memset.

Dentosal added a commit to FuelLabs/fuel-specs that referenced this pull request Aug 3, 2023
The configuration value for it was fixed to `MEM_MAX_ACCESS_SIZE =
VM_MAX_RAM`. The rule against exceeding `VM_MAX_RAM` always triggers
first. See
FuelLabs/fuel-vm#511 (comment) and
the PR in general for the removal from `fuel-vm`.
Voxelot
Voxelot previously approved these changes Aug 5, 2023
@xgreenx xgreenx enabled auto-merge August 6, 2023 11:55
@xgreenx xgreenx added this pull request to the merge queue Aug 6, 2023
Merged via the queue into master with commit e24f188 Aug 6, 2023
33 checks passed
@xgreenx xgreenx deleted the dento/memory-ownership-error-usage branch August 6, 2023 12:04
@xgreenx xgreenx mentioned this pull request Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking api change bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test memory boundaries for opcode execution
3 participants