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

HIP-801: Implement integration tests covering new services #8344

Merged
Show file tree
Hide file tree
Changes from 161 commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
5c0c6a1
Drafts opcode logger functionality
konstantinabl May 7, 2024
c4d82a5
resolve conflicts with branch for opcodes endpoint
victor-yanev May 7, 2024
fa8d674
resolve conflicts with branch for opcodes endpoint
victor-yanev May 7, 2024
87624ba
feat: Add new opcodes endpoint
victor-yanev May 7, 2024
b7a7118
chore: refactor logic + address comments
victor-yanev May 8, 2024
3c6943f
chore: add IllegalArgumentException to ControllerExceptionHandler
victor-yanev May 8, 2024
6f4fc28
chore: add edge case to findRecordFileByBlock
victor-yanev May 8, 2024
31bdd00
chore: use openapi-generator for OpcodesResponse class
victor-yanev May 8, 2024
01583a4
chore: add edge-cases for receiver, gas, callData, value
victor-yanev May 9, 2024
40cf486
test: add WebMvcTests for OpcodesController
victor-yanev May 10, 2024
af51602
test: add WebMvcTests for OpcodesController
victor-yanev May 10, 2024
003af2a
test: add WebMvcTests for OpcodesController
victor-yanev May 10, 2024
a168e86
test: add WebMvcTests for OpcodesController
victor-yanev May 13, 2024
a257bff
chore: refactor
victor-yanev May 13, 2024
1961f22
Some draft changes
konstantinabl May 13, 2024
68e41ad
Merge remote-tracking branch 'origin/8174-add-new-opcodes-endpoint' i…
konstantinabl May 13, 2024
f5962f3
chore: refactor OpcodesController
victor-yanev May 14, 2024
a7cd0b9
chore: move constructServiceParameters to CallServiceParametersBuilder
victor-yanev May 14, 2024
823ab05
chore: improve readability of TransactionMocksProvider
victor-yanev May 14, 2024
91499c4
debugs precompile transaction
konstantinabl May 14, 2024
f423ce4
test: extend tests in OpcodesControllerTest
victor-yanev May 14, 2024
273c4f5
test: final touches
victor-yanev May 15, 2024
9f94426
chore: add docs
victor-yanev May 15, 2024
ddae789
Merge 8174
konstantinabl May 15, 2024
8fad134
chore: revert changes from PR for #8173
victor-yanev May 15, 2024
2f40d85
chore: revert changes from PR for #8173
victor-yanev May 15, 2024
742d394
chore: improve docs in openapi.yml
victor-yanev May 15, 2024
ddf2fbe
chore: improve docs in openapi.yml
victor-yanev May 15, 2024
b64271e
chore: improve readability of OpcodesControllerTest
victor-yanev May 15, 2024
7c0ad10
chore: revert changes from PR for #8173
victor-yanev May 15, 2024
6b38a5b
chore: improve readability of OpcodesControllerTest
victor-yanev May 15, 2024
ba22fd6
chore: improve readability of TransactionMocks
victor-yanev May 15, 2024
13786e2
chore: extend tests to also cover native transactions
victor-yanev May 15, 2024
0ba84cc
chore: improve readability of TransactionMocks
victor-yanev May 15, 2024
5205464
chore: fix timestamp string
victor-yanev May 15, 2024
a04dbaa
Adds main implementation for tracing non-precompile calls
konstantinabl May 16, 2024
94d1736
Changes test according to new changes in processOpcodeCall
konstantinabl May 16, 2024
4b6781e
Removes unused import from class
konstantinabl May 16, 2024
b193628
Removes unused repository
konstantinabl May 16, 2024
263d3e3
Merge remote-tracking branch 'origin/8174-add-new-opcodes-endpoint' i…
konstantinabl May 16, 2024
a2ee522
merges 8174
konstantinabl May 16, 2024
0d527cf
chore: extend test coverage
victor-yanev May 16, 2024
331a9a9
chore: extend test coverage
victor-yanev May 16, 2024
aa9298d
chore: add @ExtendWith(SpringExtension.class) to TransactionUtilsTest
victor-yanev May 16, 2024
1122db1
chore: pass tracer options to ContractCallService
victor-yanev May 17, 2024
a86f6a5
chore: handle null values for stack/memory/storage when building Opco…
victor-yanev May 17, 2024
4bcba57
chore: suppress CORS sonar warning
victor-yanev May 17, 2024
97481d5
chore: fix coverage
victor-yanev May 17, 2024
8fde98c
Adds new logic for calculating storage, memory and stack
konstantinabl May 17, 2024
3168fee
Merge remote-tracking branch 'origin/8174-add-new-opcodes-endpoint' i…
konstantinabl May 17, 2024
9361d5e
Merge branch 'refs/heads/8174-add-new-opcodes-endpoint' into 8173-imp…
victor-yanev May 17, 2024
88260ef
chore: add tests for OpcodeTracer
victor-yanev May 17, 2024
36c8277
Fixes some types
konstantinabl May 19, 2024
f87966a
Fixes merge conflicts
konstantinabl May 19, 2024
f5f0bde
Improves opcodes response format; Puts tracer options iin context
konstantinabl May 20, 2024
9a335fd
test: improve OpcodeTracerTest
victor-yanev May 20, 2024
93fcaab
Merge remote-tracking branch 'origin/8173-implement-opcode-logger-tra…
victor-yanev May 20, 2024
94fed9d
test: improve OpcodeTracerTest
victor-yanev May 20, 2024
c9b78cc
test: fix OpcodesControllerTest
victor-yanev May 20, 2024
72484ef
test: add integration tests for ContractCallService.processOpcodeCall
victor-yanev May 21, 2024
30b44ae
test: add integration tests for ContractCallService.processOpcodeCall
victor-yanev May 21, 2024
6d55b9d
fix: do not call validateResult() in processOpcodeCall()
victor-yanev May 21, 2024
0cbe6ed
fix: call validateResult() in processOpcodeCall() but do not throw ex…
victor-yanev May 21, 2024
64e7455
test: simplify tests + remove code duplication
victor-yanev May 21, 2024
2ada65c
test: revert changes to ContractCallNestedCallsTest
victor-yanev May 21, 2024
3b4f2d3
chore: simplify tests
victor-yanev May 21, 2024
82dd9cb
chore: revert formatting changes in ContractCallNestedCallsTest
victor-yanev May 21, 2024
ede3a5f
chore: move expectedOpcodeProcessingResult() to OpcodeTracerCallsTest
victor-yanev May 21, 2024
a9b49d9
chore: add scenarios with reverting transactions
victor-yanev May 21, 2024
911b2fa
Merge branch 'refs/heads/main' into 8174-add-new-opcodes-endpoint
victor-yanev May 22, 2024
457eaab
chore: resolve conflicts
victor-yanev May 22, 2024
4d7c0dd
chore: address comments
victor-yanev May 22, 2024
016131e
Merge branch 'refs/heads/8174-add-new-opcodes-endpoint' into 8173-imp…
victor-yanev May 22, 2024
1dd4a6a
chore: resolve conflicts
victor-yanev May 22, 2024
30a4cc6
chore: resolve conflicts
victor-yanev May 22, 2024
8eb6222
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 22, 2024
0a3d012
chore: address comments
victor-yanev May 22, 2024
73706b5
chore: address comments
victor-yanev May 22, 2024
fb5d4ca
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 22, 2024
e13b552
chore: resolve conflicts
victor-yanev May 22, 2024
09e671e
chore: remove redundant method
victor-yanev May 22, 2024
80efa74
chore: address comments
victor-yanev May 23, 2024
8833f82
chore: address comments
victor-yanev May 23, 2024
03030bb
chore: improve docs
victor-yanev May 23, 2024
74d8bd7
Merge branch 'refs/heads/8174-add-new-opcodes-endpoint' into 8173-imp…
victor-yanev May 23, 2024
3e4ed15
chore: use revert reason from contract actions in tracePrecompileCall
victor-yanev May 23, 2024
3153c85
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 23, 2024
81f1edc
chore: add warning and trace logs in OpcodeTracer
victor-yanev May 23, 2024
981fc9c
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 23, 2024
d06ca0b
chore: throw EntityNotFoundException error instead of IllegalArgument…
victor-yanev May 23, 2024
35d3965
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 23, 2024
aa4a9e0
test: extend OpcodeTracerTest with additional scenarios
victor-yanev May 23, 2024
a9359b0
chore: add docs + simplify logic in ContractCallService
victor-yanev May 23, 2024
2f7965e
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev May 23, 2024
cef89a8
test: TransactionUtilsTest.assertUtilityClassWellDefined
victor-yanev May 27, 2024
c7c2264
test: Improve coverage in OpcodeTracerTest
victor-yanev May 27, 2024
2052196
test: fix sonar issue in OpcodeTracerTest
victor-yanev May 27, 2024
bda5e6d
Adds entity service
konstantinabl May 29, 2024
4552e1d
Fixes wrong sender lon zero address
konstantinabl May 29, 2024
09d45a9
chore: resolve comments
victor-yanev May 29, 2024
4b47076
Merge 8174
konstantinabl May 30, 2024
8fbd81d
chore: resolve comments
victor-yanev May 30, 2024
92a2c51
Merge branch 'refs/heads/main' into 8174-add-new-opcodes-endpoint
victor-yanev May 30, 2024
826d596
chore: remove query timed out log from GenericControllerAdvice
victor-yanev May 30, 2024
192991d
chore: remove unused utility methods + primary bean annotation from c…
victor-yanev May 30, 2024
0eaa978
test: cover edge cases for all type of addresses that could be return…
victor-yanev May 30, 2024
519a4c1
test: cover edge case for unsuccessful HederaEvmTransactionProcessing…
victor-yanev May 30, 2024
ffc4ae2
Addresses comments
konstantinabl May 30, 2024
2117fde
Moves common code to base service
konstantinabl May 31, 2024
ec78b7b
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
konstantinabl May 31, 2024
8ca2d3b
test: cover edge cases for unsuccessful parsing of TransactionIdOrHas…
victor-yanev May 31, 2024
1132a24
chore: disable CORS warning in GenericControllerAdvice
victor-yanev May 31, 2024
68052d3
test: fix expected Access-Control-Allow-Methods in OpcodesControllerTest
victor-yanev May 31, 2024
e19e4f2
chore: address comments
victor-yanev Jun 3, 2024
a5aa72e
chore: move `contractCallService.processOpcodeCall` method call to `O…
victor-yanev Jun 3, 2024
5cc21bb
chore: use org.assertj.core.api.Assertions instead of junit assertions
victor-yanev Jun 3, 2024
6409af9
chore: fix expected error message for entity ID overflow in Transacti…
victor-yanev Jun 3, 2024
0ba9a42
Fixes import statements and adds repository tests
konstantinabl Jun 3, 2024
4e72391
Merge branch '8174-add-new-opcodes-endpoint' into 8173-implement-opco…
konstantinabl Jun 3, 2024
dd4849c
Merges 8174 and fixes OpcodesControllerTest
konstantinabl Jun 3, 2024
ca73bb5
Addresses PR comments
konstantinabl Jun 3, 2024
6b52c43
Drafts record file service test
konstantinabl Jun 4, 2024
0fe9ba0
Addresses PR comments
konstantinabl Jun 5, 2024
c82bd6c
Merge branch 'refs/heads/8173-implement-opcode-logger-tracing-logic' …
victor-yanev Jun 5, 2024
c9e11ea
chore: fix conflicts after merge
victor-yanev Jun 5, 2024
46cd9d7
fix: receiver in params could sometimes be a mirror address
victor-yanev Jun 5, 2024
61d8557
fixes build fail
konstantinabl Jun 5, 2024
e5540ea
Merge branch '8174-add-new-opcodes-endpoint' into 8173-implement-opco…
konstantinabl Jun 5, 2024
7b19f10
Merges 8174
konstantinabl Jun 5, 2024
2e6c872
Fixes failing test
konstantinabl Jun 5, 2024
babe5b9
Fixes warning in OpcodeTracerTest
konstantinabl Jun 5, 2024
b494d30
Removes builder tag for OpcodesProcessingResult
konstantinabl Jun 5, 2024
8f25a31
Merge branch '8173-implement-opcode-logger-tracing-logic'
victor-yanev Jun 5, 2024
edeb7d2
chore: Resolve conflicts
victor-yanev Jun 5, 2024
c74af48
chore: formatting
victor-yanev Jun 5, 2024
4aff74f
chore: formatting
victor-yanev Jun 5, 2024
e33f183
Reverts uneccessary changes to tests
konstantinabl Jun 6, 2024
23d0103
chore: resolve comments
victor-yanev Jun 6, 2024
a0379aa
Merge branch 'main' into 8174-add-new-opcodes-endpoint
victor-yanev Jun 6, 2024
d8bfd15
Remove `matcher.groupCount()` check in TransactionIdParameter
victor-yanev Jun 6, 2024
030bf3e
fix: `cacheManagerRecordFileTimestamp()`: `expireAfterWrite` -> `expi…
victor-yanev Jun 6, 2024
0d4662b
Merge branch '8174-add-new-opcodes-endpoint' into 8173-implement-opco…
victor-yanev Jun 6, 2024
a49ba6d
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
victor-yanev Jun 6, 2024
1deb6f9
Addresses PR comments
konstantinabl Jun 6, 2024
c150194
chore: remove gas throttle
victor-yanev Jun 6, 2024
7ba5396
fix: TransactionIdParameterTest
victor-yanev Jun 6, 2024
9305eb3
Merge remote-tracking branch 'origin/8173-implement-opcode-logger-tra…
victor-yanev Jun 6, 2024
8e62156
Merge branch '8174-add-new-opcodes-endpoint' into 8173-implement-opco…
victor-yanev Jun 6, 2024
8edbc60
Merge branch '8174-add-new-opcodes-endpoint' into 8173-implement-opco…
victor-yanev Jun 6, 2024
7d5393d
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
victor-yanev Jun 6, 2024
b99805a
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
victor-yanev Jun 6, 2024
ffb7001
chore: Resolve conflicts
victor-yanev Jun 6, 2024
8a8a19b
chore: Resolve conflicts
victor-yanev Jun 6, 2024
e58b3a2
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
victor-yanev Jun 6, 2024
09b5002
chore: Revert false changes after conflicts...
victor-yanev Jun 6, 2024
8770a13
chore: Revert false changes after conflicts...
victor-yanev Jun 6, 2024
679e1fc
Merge branch 'main' into 8173-implement-opcode-logger-tracing-logic
victor-yanev Jun 6, 2024
9d48ce6
Merge branch '8173-implement-opcode-logger-tracing-logic' into 7341-i…
victor-yanev Jun 6, 2024
965a85f
Merges 8173
konstantinabl Jun 7, 2024
9a39e27
Revert "Merges 8173"
konstantinabl Jun 7, 2024
cbd5de3
chore: address comments
victor-yanev Jun 9, 2024
c3ca296
Merge branch 'main' into 7341-implement-integration-and-acceptance-te…
victor-yanev Jun 26, 2024
4692448
chore: run spotlessApply
victor-yanev Jun 26, 2024
e6d19d7
chore: fix tests after merge from main
victor-yanev Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ dependencies {
api("io.swagger:swagger-annotations:1.6.14")
api("io.vertx:vertx-pg-client:$vertxVersion")
api("io.vertx:vertx-codegen:$vertxVersion")
api("io.vertx:vertx-core:$vertxVersion")
api("jakarta.inject:jakarta.inject-api:2.0.1")
api("net.devh:grpc-spring-boot-starter:3.1.0.RELEASE")
api("net.java.dev.jna:jna:5.14.0")
api("org.apache.commons:commons-collections4:4.4")
api("org.apache.commons:commons-compress:1.26.1")
api("org.apache.commons:commons-math3:3.6.1")
api("org.apache.tuweni:tuweni-bytes:2.3.1")
api("org.apache.tuweni:tuweni-units:2.3.1")
api("org.apache.velocity:velocity-engine-core:2.3")
api("org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2")
api("org.gaul:s3proxy:2.2.0")
Expand Down
1 change: 1 addition & 0 deletions hedera-mirror-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
api("commons-codec:commons-codec")
api("org.apache.commons:commons-lang3")
api("org.apache.tuweni:tuweni-bytes")
api("org.apache.tuweni:tuweni-units")
api("org.jetbrains:annotations")
api("org.springframework.boot:spring-boot-starter-data-jpa")
testImplementation("org.hyperledger.besu:evm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.hedera.mirror.common.domain.contract;

import static com.hedera.services.stream.proto.ContractAction.ResultDataCase.REVERT_REASON;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hedera.mirror.common.domain.entity.EntityId;
import com.hedera.mirror.common.domain.entity.EntityType;
Expand Down Expand Up @@ -98,6 +100,11 @@ public boolean isNew() {
return true; // Since we never update and use a natural ID, avoid Hibernate querying before insert
}

@JsonIgnore
public boolean hasRevertReason() {
return resultDataType == REVERT_REASON.getNumber();
}

@Data
@AllArgsConstructor
@NoArgsConstructor
Expand Down
1 change: 1 addition & 0 deletions hedera-mirror-web3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies {
implementation("org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-config")
runtimeOnly("org.postgresql:postgresql")
testImplementation(project(path = ":common", configuration = "testClasses"))
testImplementation("io.vertx:vertx-core")
testImplementation("org.flywaydb:flyway-database-postgresql")
testImplementation("org.mockito:mockito-inline")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@

package com.hedera.mirror.web3.common;

import com.hedera.mirror.common.domain.contract.ContractAction;
import com.hedera.mirror.common.domain.transaction.RecordFile;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.Opcode;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.OpcodeTracerOptions;
import com.hedera.mirror.web3.evm.store.CachingStateFrame;
import com.hedera.mirror.web3.evm.store.StackedStateFrames;
import java.util.EmptyStackException;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import lombok.Getter;
Expand All @@ -45,6 +49,15 @@ public class ContractCallContext {
/** Fixed "base" of stack: a R/O cache frame on top of the DB-backed cache frame */
private CachingStateFrame<Object> stackBase;

@Setter
private OpcodeTracerOptions opcodeTracerOptions;

@Setter
private List<Opcode> opcodes = List.of();

@Setter
private List<ContractAction> contractActions = List.of();

private ContractCallContext() {}

public static ContractCallContext get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import com.hedera.mirror.web3.evm.properties.MirrorNodeEvmProperties;
import com.hedera.mirror.web3.exception.InvalidParametersException;
import com.hedera.mirror.web3.exception.RateLimitException;
import com.hedera.mirror.web3.service.ContractCallService;
import com.hedera.mirror.web3.service.model.CallServiceParameters;
import com.hedera.mirror.web3.service.ContractExecutionService;
import com.hedera.mirror.web3.service.model.ContractExecutionParameters;
import com.hedera.mirror.web3.viewmodel.ContractCallRequest;
import com.hedera.mirror.web3.viewmodel.ContractCallResponse;
import com.hedera.node.app.service.evm.store.models.HederaEvmAccount;
Expand All @@ -44,7 +44,7 @@
@RequiredArgsConstructor
@RestController
class ContractController {
private final ContractCallService contractCallService;
private final ContractExecutionService contractExecutionService;
private final Bucket rateLimitBucket;
private final Bucket gasLimitBucket;
private final MirrorNodeEvmProperties evmProperties;
Expand All @@ -61,7 +61,7 @@ ContractCallResponse call(@RequestBody @Valid ContractCallRequest request) {
validateContractMaxGasLimit(request);

final var params = constructServiceParameters(request);
final var result = contractCallService.processCall(params);
final var result = contractExecutionService.processCall(params);
return new ContractCallResponse(result);
} catch (QueryTimeoutException e) {
log.error("Query timed out: {} request: {}", e.getMessage(), request);
Expand All @@ -73,7 +73,7 @@ ContractCallResponse call(@RequestBody @Valid ContractCallRequest request) {
}
}

private CallServiceParameters constructServiceParameters(ContractCallRequest request) {
private ContractExecutionParameters constructServiceParameters(ContractCallRequest request) {
final var fromAddress = request.getFrom() != null ? Address.fromHexString(request.getFrom()) : Address.ZERO;
final var sender = new HederaEvmAccount(fromAddress);

Expand All @@ -97,16 +97,16 @@ private CallServiceParameters constructServiceParameters(ContractCallRequest req
final var callType = request.isEstimate() ? ETH_ESTIMATE_GAS : ETH_CALL;
final var block = request.getBlock();

return CallServiceParameters.builder()
.sender(sender)
.receiver(receiver)
return ContractExecutionParameters.builder()
.block(block)
.callData(data)
.gas(request.getGas())
.value(request.getValue())
.isStatic(isStaticCall)
.callType(callType)
.gas(request.getGas())
.isEstimate(request.isEstimate())
.block(block)
.isStatic(isStaticCall)
.receiver(receiver)
.sender(sender)
.value(request.getValue())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import com.hedera.mirror.web3.evm.contracts.execution.MirrorEvmMessageCallProcessor;
import com.hedera.mirror.web3.evm.contracts.execution.MirrorEvmMessageCallProcessorV30;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.MirrorOperationTracer;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.OpcodeTracer;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.TracerType;
import com.hedera.mirror.web3.evm.contracts.operations.HederaBlockHashOperation;
import com.hedera.mirror.web3.evm.properties.MirrorNodeEvmProperties;
import com.hedera.mirror.web3.evm.store.contract.EntityAddressSequencer;
import com.hedera.mirror.web3.repository.properties.CacheProperties;
import com.hedera.node.app.service.evm.contracts.execution.traceability.HederaEvmOperationTracer;
import com.hedera.node.app.service.evm.contracts.operations.CreateOperationExternalizer;
import com.hedera.node.app.service.evm.contracts.operations.HederaBalanceOperation;
import com.hedera.node.app.service.evm.contracts.operations.HederaBalanceOperationV038;
Expand All @@ -45,6 +49,7 @@
import com.hedera.services.txns.crypto.AbstractAutoCreationLogic;
import com.hedera.services.txns.util.PrngLogic;
import com.swirlds.common.utility.SemanticVersion;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -211,6 +216,16 @@ CacheManager cacheManagerRecordFileEarliest() {
return caffeineCacheManager;
}

@Bean
Map<TracerType, Provider<HederaEvmOperationTracer>> tracerProvider(
final MirrorOperationTracer mirrorOperationTracer,
final OpcodeTracer opcodeTracer) {
Map<TracerType, Provider<HederaEvmOperationTracer>> tracerMap = new EnumMap<>(TracerType.class);
tracerMap.put(TracerType.OPCODE, () -> opcodeTracer);
tracerMap.put(TracerType.OPERATION, () -> mirrorOperationTracer);
return tracerMap;
}

@Bean
Map<SemanticVersion, Provider<ContractCreationProcessor>> contractCreationProcessorProvider(
final ContractCreationProcessor contractCreationProcessor30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

package com.hedera.mirror.web3.evm.contracts.execution;

import com.hedera.mirror.web3.common.ContractCallContext;
import com.hedera.mirror.web3.service.model.CallServiceParameters;
import com.hedera.node.app.service.evm.contracts.execution.HederaEvmTransactionProcessingResult;

public interface MirrorEvmTxProcessor {

HederaEvmTransactionProcessingResult execute(CallServiceParameters params, long estimatedGas);
HederaEvmTransactionProcessingResult execute(final CallServiceParameters params,
final long estimatedGas,
final ContractCallContext context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

package com.hedera.mirror.web3.evm.contracts.execution;

import com.hedera.mirror.web3.common.ContractCallContext;
import com.hedera.mirror.web3.evm.account.MirrorEvmContractAliases;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.MirrorOperationTracer;
import com.hedera.mirror.web3.evm.contracts.execution.traceability.TracerType;
import com.hedera.mirror.web3.evm.store.Store;
import com.hedera.mirror.web3.evm.store.Store.OnMissing;
import com.hedera.mirror.web3.evm.store.contract.EntityAddressSequencer;
Expand All @@ -28,6 +29,7 @@
import com.hedera.node.app.service.evm.contracts.execution.HederaEvmTransactionProcessingResult;
import com.hedera.node.app.service.evm.contracts.execution.HederaEvmTxProcessor;
import com.hedera.node.app.service.evm.contracts.execution.PricesAndFeesProvider;
import com.hedera.node.app.service.evm.contracts.execution.traceability.HederaEvmOperationTracer;
import com.hedera.node.app.service.evm.store.contracts.AbstractCodeCache;
import com.hedera.node.app.service.evm.store.contracts.HederaEvmMutableWorldState;
import com.hedera.node.app.service.evm.store.tokens.TokenAccessor;
Expand Down Expand Up @@ -69,10 +71,10 @@ public MirrorEvmTxProcessorImpl(
final BlockMetaSource blockMetaSource,
final MirrorEvmContractAliases aliasManager,
final AbstractCodeCache codeCache,
final MirrorOperationTracer operationTracer,
final Map<TracerType, Provider<HederaEvmOperationTracer>> tracerMap,
final Store store,
final EntityAddressSequencer entityAddressSequencer,
TokenAccessor tokenAccessor) {
final TokenAccessor tokenAccessor) {
super(
worldState,
pricesAndFeesProvider,
Expand All @@ -81,7 +83,7 @@ public MirrorEvmTxProcessorImpl(
mcps,
ccps,
blockMetaSource,
operationTracer);
tracerMap);

this.aliasManager = aliasManager;
this.codeCache = codeCache;
Expand All @@ -90,7 +92,9 @@ public MirrorEvmTxProcessorImpl(
this.tokenAccessor = tokenAccessor;
}

public HederaEvmTransactionProcessingResult execute(CallServiceParameters params, long estimatedGas) {
public HederaEvmTransactionProcessingResult execute(final CallServiceParameters params,
final long estimatedGas,
final ContractCallContext ctx) {
final long gasPrice = gasPriceTinyBarsGiven(Instant.now());

store.wrap();
Expand All @@ -112,7 +116,9 @@ public HederaEvmTransactionProcessingResult execute(CallServiceParameters params
params.getCallData(),
params.isStatic(),
aliasManager.resolveForEvm(params.getReceiver()),
params.getReceiver().equals(Address.ZERO));
params.getReceiver().equals(Address.ZERO),
params.getTracerType(),
ctx);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,4 @@
import java.util.List;

public record OpcodesProcessingResult(
@NotNull HederaEvmTransactionProcessingResult transactionProcessingResult,
@NotNull List<Opcode> opcodes) {
}
@NotNull HederaEvmTransactionProcessingResult transactionProcessingResult, @NotNull List<Opcode> opcodes) {}
Loading