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

Make compute_usage a first-class citizen in ExecutionOutcome #8860

Open
2 tasks
aborg-dev opened this issue Mar 31, 2023 · 0 comments
Open
2 tasks

Make compute_usage a first-class citizen in ExecutionOutcome #8860

aborg-dev opened this issue Mar 31, 2023 · 0 comments
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc C-housekeeping Category: Refactoring, cleanups, code quality

Comments

@aborg-dev
Copy link
Contributor

In #8805, we introduce compute_usage field in ExecutionOutcome.
Ideally, it would be treated similarly to gas_burnt field for consistency, but that requires more work due to two reasons:

  • ExecutionOutcome is stored in the RocksDB in Borsh-serialized format that would become incompatible if we introduce a new field
  • gas_burnt is used in the Merkle proofs constructed from some of the fields of ExecutionOutcome which are also stored in the database and would break if include new field into the proof

See #8805 (comment) for the full discussion of the challenges.

To resolve this inconsistency, we need to answer the following questions:

  • Should compute_usage be a part of the Merkle proofs? And in general, what are the criteria for including fields in the proof?
  • Do we expect any other types of resource usage data to be introduced in the future into ExecutionOutcome? In this case, we should make it more future-proof by introducing a versioned struct
@aborg-dev aborg-dev added the C-housekeeping Category: Refactoring, cleanups, code quality label Mar 31, 2023
aborg-dev added a commit to aborg-dev/nearcore that referenced this issue Apr 3, 2023
author Andrei Kashin <kashin.andrej@gmail.com> 1679569548 +0000
committer Andrei Kashin <kashin.andrej@gmail.com> 1680514373 +0100

feature: Limit compute usage of a chunk

The commit introduces aggregation of compute usage across all operations
performed during chunk application and limiting of this compute usage
to 1s.

This should not change the behavior of nodes in the short run because
compute costs match gas costs and this is validated by the
`debug_assert`.

There are two follow ups to this work:
- near#8859
- near#8860
aborg-dev added a commit to aborg-dev/nearcore that referenced this issue Apr 3, 2023
The commit introduces aggregation of compute usage across all operations
performed during chunk application and limiting of this compute usage
to 1s.

This should not change the behavior of nodes in the short run because
compute costs match gas costs and this is validated by the
`debug_assert`.

There are two follow ups to this work:
- near#8859
- near#8860
aborg-dev added a commit to aborg-dev/nearcore that referenced this issue Apr 3, 2023
The commit introduces aggregation of compute usage across all operations
performed during chunk application and limiting of this compute usage
to 1s.

This should not change the behavior of nodes in the short run because
compute costs match gas costs and this is validated by the
`debug_assert`.

There are two follow ups to this work:
- near#8859
- near#8860
aborg-dev added a commit to aborg-dev/nearcore that referenced this issue Apr 4, 2023
The commit introduces aggregation of compute usage across all operations
performed during chunk application and limiting of this compute usage
to 1s.

This should not change the behavior of nodes in the short run because
compute costs match gas costs and this is validated by the
`debug_assert`.

There are two follow ups to this work:
- near#8859
- near#8860
aborg-dev added a commit to aborg-dev/nearcore that referenced this issue Apr 4, 2023
The commit introduces aggregation of compute usage across all operations
performed during chunk application and limiting of this compute usage
to 1s.

This should not change the behavior of nodes in the short run because
compute costs match gas costs and this is validated by the
`debug_assert`.

There are two follow ups to this work:
- near#8859
- near#8860
near-bulldozer bot pushed a commit that referenced this issue Apr 4, 2023
feature: Limit compute usage of a chunk

The commit 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.

There are two follow-ups to this work:
- #8859
- #8860
nikurt pushed a commit to nikurt/nearcore that referenced this issue Apr 5, 2023
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 added a commit to aborg-dev/nearcore that referenced this issue Apr 11, 2023
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 added a commit to aborg-dev/nearcore that referenced this issue Apr 14, 2023
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 added a commit to aborg-dev/nearcore that referenced this issue Apr 17, 2023
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 added a commit to aborg-dev/nearcore that referenced this issue Apr 18, 2023
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 added a commit to aborg-dev/nearcore that referenced this issue Apr 18, 2023
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
nikurt pushed a commit that referenced this issue Apr 28, 2023
feature: Limit compute usage of a chunk

The commit 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.

There are two follow-ups to this work:
- #8859
- #8860
@aborg-dev aborg-dev added the A-contract-runtime Area: contract compilation and execution, virtual machines, etc label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

No branches or pull requests

1 participant