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

[EVM] Add feature flag for deploying EVM contract only with ABI functionality #5230

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Jan 11, 2024

Adds the relevant config options and contract code, for deploying the EVM contract with only the necessary functionality for ABI encoding/decoding:

  • EVM.encodeABI
  • EVM.decodeABI
  • EVM.encodeABIWithSignature
  • EVM.decodeABIWithSignature

The EVM.EVMAddress type is also included in the minified EVM contract, as it is required for encoding/decoding to the Solidity address type.

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Nice!

fvm/bootstrap.go Outdated
@@ -77,6 +77,7 @@ type BootstrapParams struct {
storagePerFlow cadence.UFix64
restrictedAccountCreationEnabled cadence.Bool
setupEVMEnabled cadence.Bool
evmAbiOnly cadence.Bool
Copy link
Member

Choose a reason for hiding this comment

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

Given this is just a feature flag and the value is only used in Go / not passed to Cadence, this can just be a plain bool (and usages below as well)

Suggested change
evmAbiOnly cadence.Bool
evmAbiOnly bool

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I was wondering about it as well, but it seems that every config is a Cadence value. Not sure why.

fvm/bootstrap.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (f60f782) 55.60% compared to head (c73f949) 55.61%.

Files Patch % Lines
...edger/migrations/change_contract_code_migration.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5230      +/-   ##
==========================================
+ Coverage   55.60%   55.61%   +0.01%     
==========================================
  Files         995      995              
  Lines       95475    95485      +10     
==========================================
+ Hits        53088    53105      +17     
+ Misses      38413    38408       -5     
+ Partials     3974     3972       -2     
Flag Coverage Δ
unittests 55.61% <91.66%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@m-Peter m-Peter force-pushed the feature-flag-for-evm-abi-only branch from a21a51b to b2a489c Compare January 17, 2024 08:49
@m-Peter m-Peter changed the title Add feature flag for deploying EVM contract only with ABI functionality [EVM] Add feature flag for deploying EVM contract only with ABI functionality Jan 17, 2024
Copy link
Member

@ramtinms ramtinms left a comment

Choose a reason for hiding this comment

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

The code looks good to me, though I recommend waiting for the setup fixes by @janezpodhostnik to be merged first and then we merge this PR.

@m-Peter m-Peter force-pushed the feature-flag-for-evm-abi-only branch from b2a489c to 37381bf Compare January 18, 2024 18:11
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

@m-Peter m-Peter force-pushed the feature-flag-for-evm-abi-only branch from e43174f to a989313 Compare January 19, 2024 12:33
@janezpodhostnik janezpodhostnik added this pull request to the merge queue Jan 19, 2024
Merged via the queue into onflow:master with commit 2b49cb0 Jan 19, 2024
51 checks passed
@m-Peter m-Peter deleted the feature-flag-for-evm-abi-only branch January 19, 2024 14:24
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.

5 participants