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

[Cadence 1.0 migration] Add migration to setup EVM heartbeat resource #6251

Merged
merged 9 commits into from
Jul 24, 2024

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Jul 23, 2024

Depends on #6249

When the EVM contract is updated from minimal to full contract, the EVM.Heartbeat resource must be set up.

@turbolent turbolent requested a review from a team July 23, 2024 21:47
@turbolent turbolent force-pushed the bastian/evm-setup-heartbeat branch from 3a96cb9 to 62208db Compare July 23, 2024 22:28
@turbolent turbolent marked this pull request as ready for review July 23, 2024 22:28
Base automatically changed from bastian/improve-evm-contract-migration to master July 23, 2024 22:56
cmd/util/ledger/migrations/burner.go Show resolved Hide resolved
cmd/util/ledger/migrations/cadence.go Show resolved Hide resolved
cmd/util/ledger/migrations/evm.go Show resolved Hide resolved
cmd/util/ledger/migrations/evm.go Show resolved Hide resolved
cmd/util/ledger/util/programs.go Outdated Show resolved Hide resolved
fvm/evm/stdlib/contract.cdc Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 20.77922% with 61 lines in your changes missing coverage. Please review.

Project coverage is 41.41%. Comparing base (bb0874e) to head (9ad5f9c).

Files Patch % Lines
cmd/util/ledger/migrations/evm.go 0.00% 46 Missing ⚠️
cmd/util/ledger/migrations/cadence.go 20.00% 8 Missing ⚠️
cmd/util/ledger/util/registers/registers.go 0.00% 5 Missing ⚠️
utils/unittest/execution_state.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6251   +/-   ##
=======================================
  Coverage   41.41%   41.41%           
=======================================
  Files        1990     1992    +2     
  Lines      141871   141907   +36     
=======================================
+ Hits        58750    58767   +17     
- Misses      77005    77024   +19     
  Partials     6116     6116           
Flag Coverage Δ
unittests 41.41% <20.77%> (+<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.

the EVM contract changed
@turbolent turbolent force-pushed the bastian/evm-setup-heartbeat branch from 36b14bf to 99a86b2 Compare July 24, 2024 00:04
@turbolent turbolent requested a review from sideninja July 24, 2024 03:51
Copy link
Contributor

@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.

Looks good to me! the only part that I don't have that much context is the util/programs.go

@turbolent
Copy link
Member Author

@ramtinms reverted the changes in util/programs.go. They were just refactoring some code into a function to make it re-usable. But it is not needed currently

@turbolent turbolent requested a review from ramtinms July 24, 2024 18:42
@turbolent
Copy link
Member Author

@ramtinms @janezpodhostnik PTAL: I replaced the implementation with a simple transaction. We can just make the setupHeartbeat function publicly accessible. Even if it gets called by anyone else, the resource is just saved to the EVM contract's account storage, so not accessible to anyone else (e.g. caller of the function). If the resource exists, it won't be overwritten either. The transaction that is run in the migration can be taken and run as-is to set up PreviewNet

@turbolent turbolent enabled auto-merge July 24, 2024 18:47
@turbolent turbolent requested review from a team July 24, 2024 18:48
@turbolent turbolent added this pull request to the merge queue Jul 24, 2024
Merged via the queue into master with commit beb1c14 Jul 24, 2024
55 checks passed
@turbolent turbolent deleted the bastian/evm-setup-heartbeat branch July 24, 2024 19: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.

4 participants