feature: Re-introduce Compute Costs - #8915
Merged
Merged
Conversation
aborg-dev
force-pushed
the
compute_costs_debug
branch
from
April 17, 2023 10:07
e24f7ab to
8f9ab57
Compare
aborg-dev
marked this pull request as ready for review
April 17, 2023 12:00
This was referenced Apr 17, 2023
jakmeier
approved these changes
Apr 17, 2023
jakmeier
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me.
I'm still not quite sure how we can ensure profiles and gas match everywhere... But I gave it another round of questioning myself about cases we might have forgotten but couldn't find anything. And I would reason that we should have everything as follows:
- We use the gas profiles instead of the old counter only for function calls, which narrows down the potential problems.
- Inside function calls, we either pay for host function calls in VM logic or we account for the WASM op counter. The first case always goes through one of
pay_action_accumulated,pay_perorpay_base, which we have now covered. The second case (WASM cost) is already computed through profiles, so there shouldn't be any changes. - There is (always) one exception:
contract_loading_feeis not a host function but is still charged from the dynamic gas. Fortunately, we charge it usingpay_perandpay_basewhich covers this concern as well. - Other places have no business changing the function call gas cost.
All in all, I think we can merge this again and should be fine this time.
aborg-dev
force-pushed
the
compute_costs_debug
branch
from
April 18, 2023 08:43
e9d3fd7 to
bc9cd57
Compare
feature: Limit compute usage of a chunk The commit addresses near#8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the `assert`, so any discrepancy should be caught on canary nodes. There are two follow-ups to this work: - near#8859 - near#8860
aborg-dev
force-pushed
the
compute_costs_debug
branch
from
April 18, 2023 09:34
bc9cd57 to
11c9e27
Compare
nikurt
pushed a commit
that referenced
this pull request
Apr 18, 2023
This PR re-introduces changes from #8805 together with #8892 after fixing #8908: The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.
nikurt
pushed a commit
that referenced
this pull request
Apr 18, 2023
This PR re-introduces changes from #8805 together with #8892 after fixing #8908: The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.
nikurt
pushed a commit
that referenced
this pull request
Apr 25, 2023
This PR re-introduces changes from #8805 together with #8892 after fixing #8908: The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.
nikurt
pushed a commit
that referenced
this pull request
Apr 25, 2023
This PR re-introduces changes from #8805 together with #8892 after fixing #8908: The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.
nikurt
pushed a commit
that referenced
this pull request
Apr 28, 2023
This PR re-introduces changes from #8805 together with #8892 after fixing #8908: The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s. This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR re-introduces changes from #8805 together with #8892 after fixing #8908:
The PR addresses #8265 by introducing aggregation of compute usage across all operations performed during chunk application and limiting this compute usage to 1s.
This should not change the behavior of nodes in the short run because compute costs match gas costs which is validated by the assert, so any discrepancy should be caught on canary nodes.