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

Computation parity with FVM #451

Merged

Conversation

m-Peter
Copy link
Contributor

@m-Peter m-Peter commented Jul 19, 2023

Works towards: onflow/developer-grants#178

Description

  • Bring back display of memoryEstimate metric in logs (for scripts & transactions)
  • Update computation and memory weights to achieve better parity with FVM

For contributor use:

  • Targeted PR against master branch
  • Linked to GitHub issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the GitHub PR explorer
  • Added appropriate labels

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.

Thank you for this! Looks good overall, just had some minor comments.

main()
}
`
pub fun main() {
Copy link
Contributor

Choose a reason for hiding this comment

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

mixed tabs and spaces (here and in other cadence scripts)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 82b2bd6

require.NoError(t, err)

const code = `
pub fun main() {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe store the script in a const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I restructured the tests to remove the script duplication in 82b2bd6

emulator/blockchain.go Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #451 (82b2bd6) into master (ceba8ac) will decrease coverage by 0.25%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #451      +/-   ##
==========================================
- Coverage   54.39%   54.14%   -0.25%     
==========================================
  Files          27       27              
  Lines        3519     3509      -10     
==========================================
- Hits         1914     1900      -14     
- Misses       1452     1455       +3     
- Partials      153      154       +1     
Flag Coverage Δ
unittests 54.14% <100.00%> (-0.25%) ⬇️

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

Impacted Files Coverage Δ
emulator/blockchain.go 71.16% <100.00%> (-0.29%) ⬇️

... and 1 file with indirect coverage changes

@janezpodhostnik janezpodhostnik merged commit 4f9b7e5 into onflow:master Jul 19, 2023
@turbolent turbolent added the Improvement Technical work without new features, refactoring, improving tests label Aug 1, 2023
@@ -692,6 +694,17 @@ func configureBootstrapProcedure(conf config, flowAccountKey flowgo.AccountPubli
options = append(options,
fvm.WithInitialTokenSupply(supply),
fvm.WithRestrictedAccountCreationEnabled(false),
fvm.WithTransactionFee(fvm.DefaultTransactionFees),
Copy link
Member

Choose a reason for hiding this comment

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

@m-Peter Could you please bring back the comment describing where these magic values come from, i.e. add

		// This enables variable transaction fees AND execution effort metering
		// as described in Variable Transaction Fees: Execution Effort FLIP: https://github.com/onflow/flow/pull/753)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@turbolent Sure thing 😇

@m-Peter m-Peter deleted the computation-parity-with-flow-go branch September 21, 2023 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Technical work without new features, refactoring, improving tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants