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

Report transaction computation usage #667

Merged
merged 16 commits into from Jun 11, 2021
Merged

Conversation

ramtinms
Copy link
Member

@ramtinms ramtinms commented Apr 27, 2021

This PR make sure the actual computation used by a transaction is captured by the transaction result.

fvm/transactionInvocator.go Outdated Show resolved Hide resolved
@@ -163,6 +163,9 @@ func (i *TransactionInvocator) Process(
txError = NewTransactionStorageLimiter().Process(vm, ctx, proc, sth, programs)
}

proc.Logs = append(proc.Logs, env.getLogs()...)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we want to drop logs if tx fails? Aren't they useful for debugging?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought the same thing, that's why I moved it to the above error check step. for transactions, this will be disabled anyway.

@ramtinms ramtinms changed the title [WIP] Report tx computation usage Report transaction computation usage Apr 27, 2021
@ramtinms
Copy link
Member Author

The broken test is actually due to this (onflow/cadence#895)

Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

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

LGTM!

@ramtinms ramtinms requested a review from m4ksio June 10, 2021 21:59
@codecov-commenter
Copy link

Codecov Report

Merging #667 (512aa0b) into master (3619e5c) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #667      +/-   ##
==========================================
+ Coverage   56.42%   56.45%   +0.02%     
==========================================
  Files         427      427              
  Lines       24975    24976       +1     
==========================================
+ Hits        14092    14099       +7     
+ Misses       8977     8974       -3     
+ Partials     1906     1903       -3     
Flag Coverage Δ
unittests 56.45% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fvm/transaction.go 71.42% <ø> (ø)
model/flow/transaction_result.go 0.00% <ø> (ø)
engine/execution/computation/computer/computer.go 86.51% <100.00%> (+0.07%) ⬆️
engine/execution/ingestion/engine.go 53.72% <100.00%> (+1.52%) ⬆️
engine/execution/messages.go 100.00% <100.00%> (ø)
fvm/transactionInvocator.go 80.00% <100.00%> (ø)
module/mempool/epochs/transactions.go 94.73% <0.00%> (-5.27%) ⬇️
cmd/util/ledger/migrations/storage_v4.go 41.56% <0.00%> (-0.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3619e5c...512aa0b. Read the comment docs.

@ramtinms ramtinms requested a review from turbolent June 11, 2021 00:12
@turbolent
Copy link
Member

Sorry for my super late review, I didn't see this before

@ramtinms ramtinms merged commit 4f8e62d into master Jun 11, 2021
@ramtinms ramtinms deleted the ramtin/4139-report-gas-usage branch June 11, 2021 02:47
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.

None yet

5 participants