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

Add gas host call #303

Merged
merged 3 commits into from
Jan 22, 2025
Merged

Add gas host call #303

merged 3 commits into from
Jan 22, 2025

Conversation

krystian50
Copy link
Contributor

No description provided.

@krystian50 krystian50 marked this pull request as ready for review January 21, 2025 10:00
Copy link

netlify bot commented Jan 21, 2025

Deploy Preview for pvm-debugger ready!

Name Link
🔨 Latest commit 44bcb25
🔍 Latest deploy log https://app.netlify.com/sites/pvm-debugger/deploys/67910b951745ad00080f3f56
😎 Deploy Preview https://deploy-preview-303--pvm-debugger.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@krystian50 krystian50 requested a review from tomusdrw January 21, 2025 10:01
@krystian50 krystian50 marked this pull request as draft January 21, 2025 10:02
@krystian50 krystian50 removed the request for review from tomusdrw January 21, 2025 10:02
Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -165,6 +165,12 @@ const hostCall = async ({
await jamHostCall.execute(getGasCounter(pvm), getRegisters(pvm), getMemory(pvm));

return { hostCallIdentifier, storage, status: CommandStatus.SUCCESS };
} else if (hostCallIdentifier === HostCallIdentifiers.GAS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/FluffyLabs/typeberry/blob/main/packages/pvm/host-calls/host-calls-manager.ts#L10

Take a look at this code it's doing exactly the thing that you are doing here with a series of if-elses and handles a missing host call by returning some info back to the PVM.
You might consider using this instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I'll take some pieces from this when working on the import/export host calls.

@krystian50 krystian50 marked this pull request as ready for review January 22, 2025 15:15
@krystian50 krystian50 merged commit c9d0fff into main Jan 22, 2025
2 checks passed
@krystian50 krystian50 deleted the gas-host-call branch January 22, 2025 15:15
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.

2 participants