Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9e11f87
Bump com.hedera.hashgraph:hedera-protobuf-java-api from 0.66.0 to 0.67.0
dependabot[bot] Oct 20, 2025
d315cc7
adapt blockstream fields naming changes
xin-hedera Oct 20, 2025
cc159d8
use ArrayList instead, ArrayDeque doesn't support sort
xin-hedera Oct 20, 2025
8459387
Fix GasCalculator compilation issues
IvanKavaldzhiev Oct 21, 2025
58adc04
Fix state key renaming
IvanKavaldzhiev Oct 21, 2025
5978d65
Change state keys to state ids
IvanKavaldzhiev Oct 21, 2025
4602145
Intermezzo - fix unit test and compilation issues
IvanKavaldzhiev Oct 22, 2025
12ef41a
Simplify state initialization
IvanKavaldzhiev Oct 22, 2025
52482af
Align DispatchingEvmFrameState with upstream
IvanKavaldzhiev Oct 22, 2025
6b1d9cc
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 22, 2025
1bb001f
Fix unit test inside MirrorNodeStateIntegrationTest
IvanKavaldzhiev Oct 23, 2025
745f6dc
Miscellaneous fixes
IvanKavaldzhiev Oct 23, 2025
3ce2e00
Align ConversionUtils with upstream
IvanKavaldzhiev Oct 23, 2025
c4728df
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 23, 2025
603c74b
Fix build
IvanKavaldzhiev Oct 23, 2025
44ec939
Fix build
IvanKavaldzhiev Oct 23, 2025
362e114
Fix build
IvanKavaldzhiev Oct 23, 2025
b9e70fe
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 23, 2025
b6ceb18
Apply jspecify annotations to web3 classes
IvanKavaldzhiev Oct 23, 2025
1396977
Adapt MapWritable states to use jspecify annotations
IvanKavaldzhiev Oct 24, 2025
127aed5
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 24, 2025
b7aa157
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 25, 2025
61403c0
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 27, 2025
05e0111
Resolve PR comments
IvanKavaldzhiev Oct 27, 2025
b3dae86
Redirect mono requests to modularized workflow due to breaking changes
IvanKavaldzhiev Oct 27, 2025
a5e78ef
Fix failing tests
IvanKavaldzhiev Oct 27, 2025
ca0bd3f
Disable mono workflow in CI for web3 due to breaking changes
IvanKavaldzhiev Oct 27, 2025
299f634
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 27, 2025
eae4688
Merge remote-tracking branch 'origin/main' into dependabot/gradle/com…
IvanKavaldzhiev Oct 27, 2025
6f237a5
Bump hedera-app to 0.67.1
IvanKavaldzhiev Oct 27, 2025
e037658
Resolve PR comments
IvanKavaldzhiev Oct 27, 2025
758003a
Remove unnecessary schema keys from DEFAULT_IMPLEMENTATIONS
IvanKavaldzhiev Oct 27, 2025
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
7 changes: 0 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ jobs:
if: ${{ matrix.schema == 'v1' && matrix.project != 'test' && always() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) }}
run: ./gradlew :${{ matrix.project }}:uploadCoverage

- name: Build and test web3 with monolithic code
env:
HIERO_MIRROR_WEB3_EVM_MODULARIZEDSERVICES: "false"
HIERO_MIRROR_WEB3_EVM_OVERRIDEPAYERBALANCEVALIDATION: "false"
if: ${{ matrix.project == 'web3' && matrix.schema == 'v1'}}
run: ./gradlew :${{ matrix.project }}:build

coverage:
if: github.event_name == 'push' || (github.event.pull_request.head.repo.full_name == github.repository)
name: Upload coverage
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ dependencies {
api("com.graphql-java-generator:graphql-java-client-runtime:3.0.1")
api("com.graphql-java:graphql-java-extended-scalars:24.0")
api("com.graphql-java:graphql-java-extended-validation:24.0")
api("com.hedera.hashgraph:app:0.66.0")
api("com.hedera.hashgraph:app:0.67.2")
api("com.hedera.evm:hedera-evm:0.54.2")
api("com.hedera.hashgraph:hedera-protobuf-java-api:0.66.0")
api("com.hedera.hashgraph:hedera-protobuf-java-api:0.67.2")
api("com.hedera.hashgraph:sdk:2.64.0")
api("com.ongres.scram:client:2.1")
api("com.salesforce.servicelibs:reactor-grpc-stub:$reactorGrpcVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand All @@ -42,12 +41,12 @@ public final class StateChangeContext {
private final Map<ByteString, ContractID> contractIds = new HashMap<>();
private final Map<SlotKey, BytesValue> contractStorageChanges = new HashMap<>();
private final Map<ContractID, List<SlotValue>> contractStorageChangesIndexed = new HashMap<>();
private final List<Long> nodeIds = new LinkedList<>();
private final List<FileID> fileIds = new LinkedList<>();
private final List<Long> nodeIds = new ArrayList<>();
private final List<FileID> fileIds = new ArrayList<>();
private final Map<PendingAirdropId, Long> pendingFungibleAirdrops = new HashMap<>();
private final List<TokenID> tokenIds = new LinkedList<>();
private final List<TokenID> tokenIds = new ArrayList<>();
private final Map<TokenID, Long> tokenTotalSupplies = new HashMap<>();
private final List<TopicID> topicIds = new LinkedList<>();
private final List<TopicID> topicIds = new ArrayList<>();
private final Map<TopicID, TopicMessage> topicState = new HashMap<>();

private StateChangeContext() {}
Expand All @@ -66,8 +65,8 @@ private StateChangeContext() {}
var mapUpdate = stateChange.getMapUpdate();
switch (stateChange.getStateId()) {
case StateIdentifier.STATE_ID_ACCOUNTS_VALUE -> processAccountStateChange(mapUpdate);
case StateIdentifier.STATE_ID_CONTRACT_BYTECODE_VALUE -> processContractBytecode(mapUpdate);
case StateIdentifier.STATE_ID_CONTRACT_STORAGE_VALUE -> processContractStorageChange(mapUpdate);
case StateIdentifier.STATE_ID_BYTECODE_VALUE -> processContractBytecode(mapUpdate);
case StateIdentifier.STATE_ID_STORAGE_VALUE -> processContractStorageChange(mapUpdate);
case StateIdentifier.STATE_ID_FILES_VALUE ->
fileIds.add(mapUpdate.getKey().getFileIdKey());
case StateIdentifier.STATE_ID_NODES_VALUE -> processNodeStateChange(mapUpdate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package org.hiero.mirror.common.domain.transaction;

import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_ACCOUNTS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_CONTRACT_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_FILES_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_NFTS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_NODES_VALUE;
Expand Down Expand Up @@ -121,7 +121,7 @@ void contractBytecode() {
var bytecode = bytes(128);
var stateChanges = StateChanges.newBuilder()
.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_BYTECODE_VALUE)
.setStateId(STATE_ID_BYTECODE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setKey(MapChangeKey.newBuilder().setContractIdKey(contractId))
.setValue(MapChangeValue.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package org.hiero.mirror.common.domain.transaction;

import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_CONTRACT_STORAGE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_STORAGE_VALUE;

import com.google.protobuf.ByteString;
import com.hedera.hapi.block.stream.output.protoc.MapChangeKey;
Expand Down Expand Up @@ -32,7 +32,7 @@ public static ByteString bytes(int size) {

public static StateChange contractStorageMapDeleteChange(ContractID contractId, ByteString slot) {
return StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_STORAGE_VALUE)
.setStateId(STATE_ID_STORAGE_VALUE)
.setMapDelete(MapDeleteChange.newBuilder()
.setKey(MapChangeKey.newBuilder()
.setSlotKeyKey(SlotKey.newBuilder()
Expand All @@ -43,7 +43,7 @@ public static StateChange contractStorageMapDeleteChange(ContractID contractId,

public static StateChange contractStorageMapUpdateChange(ContractID contractId, ByteString slot, ByteString value) {
return StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_STORAGE_VALUE)
.setStateId(STATE_ID_STORAGE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setKey(MapChangeKey.newBuilder()
.setSlotKeyKey(SlotKey.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package org.hiero.mirror.importer.downloader.block.transformer;

import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_ACCOUNTS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_CONTRACT_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_PENDING_AIRDROPS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_TOKENS_VALUE;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -1091,7 +1091,7 @@ private Consumer<List<StateChanges>> stateChangesFromChildContractCreate(
.setAccountId(accountId)
.setSmartContract(true)))))
.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_BYTECODE_VALUE)
.setStateId(STATE_ID_BYTECODE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setKey(MapChangeKey.newBuilder().setContractIdKey(contractId))
.setValue(MapChangeValue.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
package org.hiero.mirror.importer.parser.domain;

import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_ACCOUNTS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_CONTRACT_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_CONTRACT_STORAGE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_BYTECODE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_NFTS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_NODES_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_PENDING_AIRDROPS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_SCHEDULES_BY_ID_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_STORAGE_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.StateIdentifier.STATE_ID_TOKENS_VALUE;
import static com.hedera.hapi.block.stream.output.protoc.TransactionOutput.TransactionCase.ACCOUNT_CREATE;
import static com.hedera.hapi.block.stream.output.protoc.TransactionOutput.TransactionCase.CONTRACT_CALL;
Expand Down Expand Up @@ -738,7 +738,7 @@ private void convertContractBytecode(
sidecarRecords, TransactionSidecarRecord::hasBytecode, TransactionSidecarRecord::getBytecode)
.ifPresent(bytecode -> {
stateChangesBuilder.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_BYTECODE_VALUE)
.setStateId(STATE_ID_BYTECODE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setKey(MapChangeKey.newBuilder().setContractIdKey(bytecode.getContractId()))
.setValue(MapChangeValue.newBuilder()
Expand Down Expand Up @@ -780,7 +780,7 @@ private void convertContractStateChanges(

// add an identical MapUpdateChange
stateChangesBuilder.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_STORAGE_VALUE)
.setStateId(STATE_ID_STORAGE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setIdentical(true)
.setKey(MapChangeKey.newBuilder()
Expand Down Expand Up @@ -816,7 +816,7 @@ private void convertContractStateChanges(
.build();
if (!BytesValue.getDefaultInstance().equals(storageChange.getValueWritten())) {
stateChangesBuilder.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_STORAGE_VALUE)
.setStateId(STATE_ID_STORAGE_VALUE)
.setMapUpdate(MapUpdateChange.newBuilder()
.setKey(mapChangeKey)
.setValue(MapChangeValue.newBuilder()
Expand All @@ -826,7 +826,7 @@ private void convertContractStateChanges(
} else {
// deleted
stateChangesBuilder.addStateChanges(StateChange.newBuilder()
.setStateId(STATE_ID_CONTRACT_STORAGE_VALUE)
.setStateId(STATE_ID_STORAGE_VALUE)
.setMapDelete(MapDeleteChange.newBuilder().setKey(mapChangeKey)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,20 @@

private final HederaNativeOperations nativeOperations;
private final ContractStateStore contractStateStore;
private final CodeFactory codeFactory;

/**
* @param nativeOperations the Hedera native operation
* @param nativeOperations the Hedera native operation
* @param contractStateStore the contract store that manages the key/value states
* @param codeFactory the code factory to use
*/
public DispatchingEvmFrameState(
@NonNull final HederaNativeOperations nativeOperations,
@NonNull final ContractStateStore contractStateStore) {
@NonNull final ContractStateStore contractStateStore,
@NonNull final CodeFactory codeFactory) {
this.nativeOperations = requireNonNull(nativeOperations);
this.contractStateStore = requireNonNull(contractStateStore);
this.codeFactory = codeFactory;
}

/**
Expand Down Expand Up @@ -205,14 +209,15 @@
* {@inheritDoc}
*/
@Override
public @NonNull Hash getCodeHash(@NonNull final ContractID contractID) {
public @NonNull Hash getCodeHash(@NonNull final ContractID contractID, @NonNull final CodeFactory codeFactory) {

Check warning on line 212 in web3/src/main/java/com/hedera/node/app/service/contract/impl/state/DispatchingEvmFrameState.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

web3/src/main/java/com/hedera/node/app/service/contract/impl/state/DispatchingEvmFrameState.java#L212

'codeFactory' hides a field.
requireNonNull(contractID);

final var numberedBytecode = contractStateStore.getBytecode(contractID);
if (numberedBytecode == null) {
return Hash.EMPTY;
} else {
return CodeFactory.createCode(pbjToTuweniBytes(numberedBytecode.code()), 0, false)
return codeFactory
.createCode(pbjToTuweniBytes(numberedBytecode.code()), false)
.getCodeHash();
}
}
Expand All @@ -230,7 +235,8 @@
*/
@Override
public @NonNull Hash getTokenRedirectCodeHash(@NonNull final Address address) {
return CodeFactory.createCode(RedirectBytecodeUtils.tokenProxyBytecodeFor(address), 0, false)
return codeFactory
.createCode(RedirectBytecodeUtils.tokenProxyBytecodeFor(address), false)
.getCodeHash();
}

Expand All @@ -247,7 +253,8 @@
*/
@Override
public @NonNull Hash getAccountRedirectCodeHash(@Nullable final Address address) {
return CodeFactory.createCode(RedirectBytecodeUtils.accountProxyBytecodeFor(address), 0, false)
return codeFactory
.createCode(RedirectBytecodeUtils.accountProxyBytecodeFor(address), false)
.getCodeHash();
}

Expand All @@ -264,7 +271,8 @@
*/
@Override
public @NonNull Hash getScheduleRedirectCodeHash(@Nullable final Address address) {
return CodeFactory.createCode(RedirectBytecodeUtils.scheduleProxyBytecodeFor(address), 0, false)
return codeFactory
.createCode(RedirectBytecodeUtils.scheduleProxyBytecodeFor(address), false)
.getCodeHash();
}

Expand Down Expand Up @@ -325,15 +333,15 @@
* {@inheritDoc}
*/
@Override
public Wei getBalance(AccountID accountID) {
public Wei getBalance(final AccountID accountID) {
return Wei.of(validatedAccount(accountID).tinybarBalance());
}

/**
* {@inheritDoc}
*/
@Override
public long getIdNumber(@NonNull Address address) {
public long getIdNumber(@NonNull final Address address) {
final var number = maybeMissingNumberOf(address, nativeOperations);
if (number == MISSING_ENTITY_NUMBER) {
throw new IllegalArgumentException("Address " + address + " has no associated Hedera id");
Expand Down Expand Up @@ -463,7 +471,8 @@
}
final var number = maybeMissingNumberOf(address, nativeOperations);
if (number != MISSING_ENTITY_NUMBER) {
AccountID accountID = AccountID.newBuilder().accountNum(number).build();
final AccountID accountID =
AccountID.newBuilder().accountNum(number).build();
final var account = nativeOperations.getAccount(accountID);
if (account != null) {
if (account.expiredAndPendingRemoval()) {
Expand Down Expand Up @@ -554,7 +563,7 @@
return null;
}
if (account.smartContract()) {
return new ProxyEvmContract(account.accountId(), this);
return new ProxyEvmContract(account.accountId(), this, codeFactory);
} else {
return new ProxyEvmAccount(account.accountId(), this);
}
Expand Down
Loading
Loading