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

Implement SMO instruction #159

Merged
merged 4 commits into from
Jul 4, 2022
Merged

Implement SMO instruction #159

merged 4 commits into from
Jul 4, 2022

Conversation

vlopes11
Copy link
Contributor

No description provided.

@vlopes11 vlopes11 self-assigned this Jun 28, 2022
@adlerjohn adlerjohn added the enhancement New feature or request label Jun 28, 2022
Cargo.toml Outdated Show resolved Hide resolved
@vlopes11
Copy link
Contributor Author

vlopes11 commented Jul 1, 2022

Blocked by #158

@vlopes11 vlopes11 force-pushed the vlopes11/smo branch 2 times, most recently from 8687140 to 1cbeb96 Compare July 2, 2022 10:33

let fp = self.registers[REG_FP] as usize;
let txid = self.tx_id();
let data = a as usize + Address::LEN;

Choose a reason for hiding this comment

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

Maybe this should use Bytes32::LEN like on line 316 for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, they should be the same. The concrete type is in fact Address, instead of raw bytes. Better to use that so its clear what is expected of this register:

7bd5789

@vlopes11 vlopes11 requested a review from pixelcircuits July 3, 2022 05:19
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

minor comments

@@ -88,20 +88,25 @@ impl<S> Interpreter<S> {

// compute the initial free balances for each asset type
pub(crate) fn initial_free_balances(&self) -> Result<HashMap<AssetId, Word>, InterpreterError> {
let base_asset = AssetId::default();
Copy link
Contributor

Choose a reason for hiding this comment

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

Orthogonal to this PR, but I'm thinking the base asset's ID should be a parameter in the VM. It's not necessarily guaranteed to be AssetId::default() always. Both the specs and the implementation should be modular in this regard. Can you file an issue to track changing?

src/interpreter/initialization.rs Show resolved Hide resolved
@@ -52,7 +52,7 @@ impl<S> Interpreter<S> {
.tx
.witnesses()
.get(b as usize)
.ok_or(PanicReason::OutputNotFound)
.ok_or(PanicReason::WitnessNotFound)
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like an orthogonal bugfix. Ideally make a separate PR for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats true, I just spotted this nit while debugging

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Looks fine to me, would like @pixelcircuits and @Voxelot to give a review as well.

@adlerjohn adlerjohn merged commit 987a3a4 into master Jul 4, 2022
@adlerjohn adlerjohn deleted the vlopes11/smo branch July 4, 2022 22:40
ControlCplusControlV pushed a commit that referenced this pull request Nov 24, 2022
ControlCplusControlV pushed a commit that referenced this pull request Dec 1, 2022
@mitchmindtree mitchmindtree added the fuel-vm Related to the `fuel-vm` crate. label Dec 9, 2022
xgreenx pushed a commit that referenced this pull request Dec 20, 2022
xgreenx pushed a commit that referenced this pull request Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fuel-vm Related to the `fuel-vm` crate.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants