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

Add verification tool for evm offchain replay #6755

Open
wants to merge 44 commits into
base: leo/add-testcase-for-offchain-evm-backward-compatibilities
Choose a base branch
from

Conversation

zhangchiqing
Copy link
Member

This PR adds a util cmd for verifying the evm offchain replay

illia-malachyn and others added 25 commits November 8, 2024 09:28
* Added websocket controller
* Added mock block provider
* Added data provider factory
* Added websocket handler
* Added websocket config
* Added a tiny POC test for websocket handler
* Use contexts as function arguments
* Move models to folder for consistency
* Change parse msg function
* Simplify mock block provider to remove dedlock
* make handle_connection blocking
* rename concurrent_map
* use type switch instead of switch
* add todos for error handling
…handler

[Access] Add new websocket handler and skeleton for its deps
@zhangchiqing zhangchiqing changed the base branch from master to leo/add-testcase-for-offchain-evm-backward-compatibilities November 22, 2024 16:22
@zhangchiqing zhangchiqing marked this pull request as ready for review November 22, 2024 16:23
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 0% with 312 lines in your changes missing coverage. Please review.

Project coverage is 41.34%. Comparing base (0cfcb7d) to head (99faac8).

Files with missing lines Patch % Lines
fvm/evm/offchain/utils/verify.go 0.00% 102 Missing ⚠️
cmd/util/cmd/verify-evm-offchain-replay/verify.go 0.00% 98 Missing ⚠️
fvm/evm/testutils/gob.go 0.00% 66 Missing ⚠️
cmd/util/cmd/verify-evm-offchain-replay/main.go 0.00% 45 Missing ⚠️
cmd/util/cmd/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                                      Coverage Diff                                       @@
##           leo/add-testcase-for-offchain-evm-backward-compatibilities    #6755      +/-   ##
==============================================================================================
+ Coverage                                                       41.23%   41.34%   +0.10%     
==============================================================================================
  Files                                                            2054     1966      -88     
  Lines                                                          182383   173879    -8504     
==============================================================================================
- Hits                                                            75212    71888    -3324     
+ Misses                                                         100869    95958    -4911     
+ Partials                                                         6302     6033     -269     
Flag Coverage Δ
unittests 41.34% <0.00%> (+0.10%) ⬆️

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.


🚨 Try these New Features:

@zhangchiqing zhangchiqing force-pushed the leo/add-verify-evm-offchain-replay branch from 103f257 to d379a68 Compare November 22, 2024 16:49
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.

Nice!

return nil
}

func parseEVMEvents(evts flow.EventsList) (*events.BlockEventPayload, []events.TransactionEventPayload, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to handle the case where there was a period that did not have blocks executed events, but did have transaction executed.

The solution is to accumulate the transaction executed events, until you hit the next block executed event.

return nil
}

func initStorages(chainID flow.ChainID, dataDir string, executionDataDir string) (
Copy link
Contributor

Choose a reason for hiding this comment

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

chain ID is not needed

@zhangchiqing zhangchiqing force-pushed the leo/add-verify-evm-offchain-replay branch from 6b36eb7 to c43fc02 Compare November 22, 2024 19:26
Add offchain block context creation method
@zhangchiqing zhangchiqing force-pushed the leo/add-testcase-for-offchain-evm-backward-compatibilities branch from 4fe749e to 27c0f3a Compare November 23, 2024 04:47
@zhangchiqing zhangchiqing force-pushed the leo/add-verify-evm-offchain-replay branch from a725780 to f564161 Compare November 23, 2024 04:48
@zhangchiqing zhangchiqing force-pushed the leo/add-testcase-for-offchain-evm-backward-compatibilities branch from 27c0f3a to 0cfcb7d Compare November 25, 2024 19:13
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.

6 participants