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] Make chain config concurrency safe #6578

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

ramtinms
Copy link
Contributor

@ramtinms ramtinms commented Oct 18, 2024

We don't need this for the on-chain and live operations but for concurrent use of the emulator we need it (e.g. GW nodes)

Since these chain configs are read-only during execution and identical when on specific chain, I created a global instances to be reused to reduce memory allocation.

@ramtinms ramtinms marked this pull request as ready for review October 18, 2024 18:20
Comment on lines +13 to +16

FlowEVMPreviewNetChainIDInUInt64 = FlowEVMPreviewNetChainID.Uint64()
FlowEVMTestNetChainIDInUInt64 = FlowEVMTestNetChainID.Uint64()
FlowEVMMainNetChainIDInUInt64 = FlowEVMMainNetChainID.Uint64()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

conversion to uuid is not cheap, so I made it global vars to also save computation per evm tx

@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 41.16%. Comparing base (56dcac7) to head (aef8c04).

Files with missing lines Patch % Lines
fvm/evm/emulator/config.go 87.50% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6578   +/-   ##
=======================================
  Coverage   41.15%   41.16%           
=======================================
  Files        2020     2020           
  Lines      178778   178808   +30     
=======================================
+ Hits        73575    73602   +27     
- Misses      99043    99048    +5     
+ Partials     6160     6158    -2     
Flag Coverage Δ
unittests 41.16% <87.50%> (+<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.

@ramtinms ramtinms added this pull request to the merge queue Oct 21, 2024
Merged via the queue into master with commit a3a1295 Oct 21, 2024
55 checks passed
@ramtinms ramtinms deleted the ramtin/evm-make-config-concurrency-safe branch October 21, 2024 19:15
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