-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add a new mode 2
to the LDC that allows to use the memory as a source for code
#849
Conversation
This reverts commit bba89e4.
Added one simple test to check that we can call blobs and they are executed correctly.
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
let len = len.to_addr()?; | ||
owner.verify_ownership(&dst_range)?; | ||
|
||
if src_range.end() <= self.stack.len() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all the following validation logic new?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the logic from self.read(src, len)
and self.write_noownerchecks(dst, len)?
here to avoid to_vec
for tmp
slice
# Conflicts: # fuel-vm/src/predicate.rs
# Conflicts: # CHANGELOG.md # fuel-vm/src/predicate.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not enough familiar with the VM to review the logic of the memcpy but the code that has been moved to this function has been well moved :)
fuel-vm/src/predicate.rs
Outdated
op::ret(0x0), | ||
// Good return opcode that we want to use for the `LDC`. | ||
op::ret(0x1), | ||
// This will be our zeroed blob id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blob id?
fuel-vm/src/predicate.rs
Outdated
op::move_(0x10, IS), | ||
// We don't need to copy `jmpf` and bad `ret` opcodes via `LDC`. | ||
op::addi(0x10, 0x10, 2 * Instruction::SIZE as u16), | ||
// Store start of the code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Store start of the code | |
// Store end of the code |
## Linked Issues/PRs FuelLabs/fuel-vm#848 FuelLabs/fuel-vm#849 ## Description <!-- List of detailed changes --> ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself --------- Co-authored-by: AurelienFT <aurelien.foucault@epitech.eu> Co-authored-by: green <xgreenx9999@gmail.com> Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com>
TODO: Add specification link
Checklist
Before requesting review
After merging, notify other teams
[Add or remove entries as needed]