-
Notifications
You must be signed in to change notification settings - Fork 112
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
base: main
Are you sure you want to change the base?
Changes from all commits
aab850f
778102f
f8dfb1f
7abd4ea
1e63d6e
92594a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
import com.hedera.mirror.web3.evm.config.PrecompiledContractProvider; | ||
import com.hedera.mirror.web3.evm.store.contract.EntityAddressSequencer; | ||
import com.hedera.mirror.web3.evm.store.contract.HederaEvmStackedWorldStateUpdater; | ||
import com.hedera.services.contracts.gascalculator.GasCalculatorHederaV22; | ||
import com.hedera.services.ledger.BalanceChange; | ||
import com.hedera.services.txns.crypto.AbstractAutoCreationLogic; | ||
import com.hedera.services.utils.EntityIdUtils; | ||
|
@@ -40,6 +39,7 @@ | |
import org.hyperledger.besu.evm.EVM; | ||
import org.hyperledger.besu.evm.frame.ExceptionalHaltReason; | ||
import org.hyperledger.besu.evm.frame.MessageFrame; | ||
import org.hyperledger.besu.evm.gascalculator.GasCalculator; | ||
import org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts; | ||
import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry; | ||
import org.hyperledger.besu.evm.tracing.OperationTracer; | ||
|
@@ -54,7 +54,7 @@ public MirrorEvmMessageCallProcessor( | |
final EVM evm, | ||
final PrecompileContractRegistry precompiles, | ||
final PrecompiledContractProvider precompilesHolder, | ||
final GasCalculatorHederaV22 gasCalculator, | ||
final GasCalculator gasCalculator, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
final Predicate<Address> systemAccountDetector) { | ||
super(evm, precompiles, precompilesHolder.getHederaPrecompiles(), systemAccountDetector); | ||
this.autoCreationLogic = autoCreationLogic; | ||
|
@@ -65,6 +65,7 @@ public MirrorEvmMessageCallProcessor( | |
|
||
/** | ||
* This logic is copied from hedera-services HederaMessageCallProcessor. | ||
* | ||
* @param frame | ||
* @param operationTracer | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2024 Hedera Hashgraph, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.hedera.mirror.web3.evm.contracts.execution; | ||
|
||
import com.hedera.mirror.web3.evm.config.PrecompiledContractProvider; | ||
import com.hedera.mirror.web3.evm.store.contract.EntityAddressSequencer; | ||
import com.hedera.services.txns.crypto.AbstractAutoCreationLogic; | ||
import jakarta.inject.Named; | ||
import java.util.function.Predicate; | ||
import org.hyperledger.besu.datatypes.Address; | ||
import org.hyperledger.besu.evm.EVM; | ||
import org.hyperledger.besu.evm.gascalculator.GasCalculator; | ||
import org.hyperledger.besu.evm.precompile.MainnetPrecompiledContracts; | ||
import org.hyperledger.besu.evm.precompile.PrecompileContractRegistry; | ||
|
||
@Named | ||
@SuppressWarnings("java:S110") | ||
public class MirrorEvmMessageCallProcessorV50 extends MirrorEvmMessageCallProcessor { | ||
public MirrorEvmMessageCallProcessorV50( | ||
final AbstractAutoCreationLogic autoCreationLogic, | ||
final EntityAddressSequencer entityAddressSequencer, | ||
@Named("evm050") EVM v50, | ||
final PrecompileContractRegistry precompiles, | ||
final PrecompiledContractProvider precompilesHolder, | ||
final GasCalculator gasCalculator, | ||
final Predicate<Address> systemAccountDetector) { | ||
super( | ||
autoCreationLogic, | ||
entityAddressSequencer, | ||
v50, | ||
precompiles, | ||
precompilesHolder, | ||
gasCalculator, | ||
systemAccountDetector); | ||
|
||
MainnetPrecompiledContracts.populateForCancun(precompiles, gasCalculator); | ||
} | ||
} |
There was a problem hiding this comment.
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.