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

Native VPs should account for cpu cycles spent during validation #1924

Closed
Tracked by #2019
sug0 opened this issue Sep 22, 2023 · 1 comment · Fixed by #2051
Closed
Tracked by #2019

Native VPs should account for cpu cycles spent during validation #1924

sug0 opened this issue Sep 22, 2023 · 1 comment · Fixed by #2051

Comments

@sug0
Copy link
Contributor

sug0 commented Sep 22, 2023

Just as a note, I think this pattern should be shared across all native vps given the impossibility of tracking their execution at runtime. If a native vp is computationally expensive (access to storage are already correctly tracked though host functions, so no need to care about them) we should extract the complex part out to a host function to which we can assign a gas cost

Originally posted by @grarco in #1923 (comment)

@grarco
Copy link
Contributor

grarco commented Oct 30, 2023

Actually, if the expensive part of a native vp doesn't need to be shared with a transaction or a non-native vp, there's no need to export it to a host function: we can just export it to a separate function, benchmark its execution and charge the gas before calling it

This was referenced Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants