-
Notifications
You must be signed in to change notification settings - Fork 136
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
Charge gas for the tipset_cid syscall #1633
Comments
Also, why does the Runtime implementation of this method in builtin-actors return an Option, and not a Result? |
Well, this is definitely broken. It should be charging the extern cost (21k gas). But yeah, we're also not charging for the walk. I thought we had a cache, but it looks like the cache doesn't actually provide O(1) lookups. The simple solution would be to:
The right solution would be to test it from the FVM itself. |
Historical reasons, IIRC. The method now takes the epoch at which to look, so it has two failure cases: "lookback limit exceeded" and "epoch beyond current". Previously, it would take the lookback distance so it only had one failure case and an option was convenient (I'm just making this up, I have no idea what the actual reason was). |
That sounds like it can / should change to being a Result :P |
Yes. |
Done #1151 |
As far as I can tell, there's no explicit gas charged for this operation, beyond the base syscall cost of 14k. That seems like a problem, because it could involve walking up 900 epochs (restricted to 256 in its only use case right now), and performing an uncharged hash (uncharged because the CID computation happens in the client).
The text was updated successfully, but these errors were encountered: