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 storage limit check exception for EVM address #5106

Merged
merged 7 commits into from
Jan 8, 2024

Conversation

janezpodhostnik
Copy link
Contributor

@janezpodhostnik janezpodhostnik commented Dec 4, 2023

closes: #5105

Add an exception to storage limiting for the account that holds the EVM state.

This is a temporary solution until we decide how we are going to properly handle it.

ctx Context,
address flow.Address,
) bool {
sc := systemcontracts.SystemContractsForChain(ctx.Chain.ChainID())
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should use the evm.RootAccountAddress() to get the address, since now if the implementation there changes this might not work.

@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (38484eb) 56.49% compared to head (a98f4c2) 56.66%.
Report is 85 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5106      +/-   ##
==========================================
+ Coverage   56.49%   56.66%   +0.17%     
==========================================
  Files         980      984       +4     
  Lines       93192    93998     +806     
==========================================
+ Hits        52649    53265     +616     
- Misses      36640    36777     +137     
- Partials     3903     3956      +53     
Flag Coverage Δ
unittests 56.66% <100.00%> (+0.17%) ⬆️

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.

for id := range snapshot.WriteSet {
address, ok := addressFromRegisterId(id)
if !ok {
continue
}

if limiter.shouldSkipSpecialAddress(ctx, address, sc) {
Copy link
Member

Choose a reason for hiding this comment

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

what about setting a very high limit instead of skipping it?

Since the returned list is supposed to be updated registers, skipping it would look like as if the EVM address is not updated. I'm not sure if it would break any assumptions elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic is only to control which accounts get their storage capacity checked.

Having a special price/limit for storage capacity of this account might be a good solution for the future, but we have not decided what to do with the storage pricing of this account yet. Implementing that also takes more effort.

This is a temporary solution so that testing is easier in the meantime.

@janezpodhostnik janezpodhostnik added this pull request to the merge queue Jan 8, 2024
Merged via the queue into master with commit d06de96 Jan 8, 2024
51 checks passed
@janezpodhostnik janezpodhostnik deleted the janez/evm-addres-storage-limit-exception branch January 8, 2024 20:46
@janezpodhostnik janezpodhostnik mentioned this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EVM] Storage account Flow reserve
4 participants