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] Offchain package - part 3 #6546

Merged
merged 17 commits into from
Oct 21, 2024
Merged

[EVM] Offchain package - part 3 #6546

merged 17 commits into from
Oct 21, 2024

Conversation

ramtinms
Copy link
Contributor

@ramtinms ramtinms commented Oct 7, 2024

depends on #6545
Context:
the Offchain package allows off-chain software like (GW) to follow the EVM chain and be able to replay all transactions. It also facilitates running queries (e.g. eth_Call), making the complex internal details hidden from the user.

This PR provides the query functionality that can be used to query account meta (e.g. Balance, ...) and make eth_call supporting passing optional tracer and overriding values.

@ramtinms ramtinms marked this pull request as ready for review October 8, 2024 17:55
if err != nil {
return err
}
return baseView.Commit()
Copy link
Member

Choose a reason for hiding this comment

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

I must miss something here.

Does the Commit call persist the balance update into database?

If we want to override the balance for making a dry call, do we also need to revert the balance update after the dry call? Because otherwise, the dry call isn't "dry" since the database is updated, it will affect the next dry call. No?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storage that is passed to the baseView is of type storage.EphemeralStorage. so all the changes would be discarded.

Copy link
Collaborator

@m-Peter m-Peter left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

lg2m

Base automatically changed from ramtin/evm-offchain-part2 to master October 21, 2024 20:33
@ramtinms ramtinms requested a review from zhangchiqing October 21, 2024 20:42
@ramtinms ramtinms enabled auto-merge October 21, 2024 20:44
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 26.41509% with 195 lines in your changes missing coverage. Please review.

Project coverage is 41.12%. Comparing base (a4773d7) to head (fa94833).

Files with missing lines Patch % Lines
fvm/evm/offchain/query/view.go 31.52% 124 Missing and 15 partials ⚠️
fvm/evm/offchain/query/viewProvider.go 0.00% 26 Missing ⚠️
fvm/evm/emulator/state/base.go 0.00% 24 Missing ⚠️
fvm/evm/testutils/handler.go 50.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6546      +/-   ##
==========================================
- Coverage   41.13%   41.12%   -0.02%     
==========================================
  Files        2029     2031       +2     
  Lines      179324   179589     +265     
==========================================
+ Hits        73765    73856      +91     
- Misses      99366    99525     +159     
- Partials     6193     6208      +15     
Flag Coverage Δ
unittests 41.12% <26.41%> (-0.02%) ⬇️

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.

@ramtinms ramtinms added this pull request to the merge queue Oct 21, 2024
Merged via the queue into master with commit ce74abc Oct 21, 2024
55 checks passed
@ramtinms ramtinms deleted the ramtin/evm-offchain-part3 branch October 21, 2024 21:31
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