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 Cancun evm support web3 #9756

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

kselveliev
Copy link
Contributor

@kselveliev kselveliev commented Nov 14, 2024

Description:
This PR adds cancun evm version to the mirror node web3

This PR modifies:

EvmConfiguration.java - Added evm050 - bean config
Add HederaSelfDestructOperationV050 - added flag - useEIP6780Semantics - set to true only for V050

Add MirrorEvmMessageCallProcessorV50 - using populateForCancun method

MirrorNodeEvmProperties - change evmSpecVersion to CANCUN and add block number for EVM_VERSION_0_50 for mainnet block configurations.

Added unit and modified integration tests.

Related issue(s):

Fixes #8058

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Kristiyan Selveliev <[email protected]>
@kselveliev kselveliev self-assigned this Nov 14, 2024
@kselveliev kselveliev added the web3 Area: Web3 API label Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.21%. Comparing base (e179868) to head (92594a8).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
.../mirror/web3/evm/config/ServicesConfiguration.java 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9756      +/-   ##
============================================
- Coverage     92.23%   92.21%   -0.02%     
- Complexity     7628     7631       +3     
============================================
  Files           937      939       +2     
  Lines         32119    32130      +11     
  Branches       4071     4071              
============================================
+ Hits          29624    29629       +5     
- Misses         1542     1545       +3     
- Partials        953      956       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Kristiyan Selveliev <[email protected]>
Signed-off-by: Kristiyan Selveliev <[email protected]>
Signed-off-by: Kristiyan Selveliev <[email protected]>
@@ -104,6 +104,7 @@ dependencies {
api("software.amazon.awssdk:bom:2.29.9")
api("uk.org.webcompere:system-stubs-jupiter:2.1.7")
api("org.web3j:core:4.12.2")
api("tech.pegasys:jc-kzg-4844:0.8.0")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed for KZGPointEvalPrecompiledContract.init(); method during evm initialization.

@@ -54,7 +54,7 @@ public MirrorEvmMessageCallProcessor(
final EVM evm,
final PrecompileContractRegistry precompiles,
final PrecompiledContractProvider precompilesHolder,
final GasCalculatorHederaV22 gasCalculator,
final GasCalculator gasCalculator,
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use our own GasCalculator, instead of built-in from besu?

Copy link
Contributor Author

@kselveliev kselveliev Nov 14, 2024

Choose a reason for hiding this comment

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

Under the hood it will pick our GasCalculatorHederaV22 bean since it's our only bean implementing the GasCalculator interface. Just checked it locally with instance off and it picks GasCalculatorHederaV22 under the hood.

@kselveliev kselveliev changed the title feat: Add Cancun evm support Add Cancun evm support web3 Nov 15, 2024
@kselveliev kselveliev marked this pull request as ready for review November 15, 2024 09:13
@kselveliev kselveliev requested a review from a team as a code owner November 15, 2024 09:13
Copy link
Contributor

@bilyana-gospodinova bilyana-gospodinova 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 but I think it would be nice if we add some tests that the new functionalities in Cancun exist. In services there is a test class for that - Evm50ValidationSuite.

@kselveliev
Copy link
Contributor Author

Looks good but I think it would be nice if we add some tests that the new functionalities in Cancun exist. In services there is a test class for that - Evm50ValidationSuite.

Just added integration tests exactly like the ones in Evm50ValidationSuite

Copy link

sonarcloud bot commented Nov 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web3 Area: Web3 API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Cancun support from Besu to hedera-mirror-web3
3 participants