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

test: Added a test to submit DAB transactions for JRS test #15549

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
8 changes: 6 additions & 2 deletions hedera-node/configuration/mainnet/upgrade/throttles.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
"TokenGetNftInfos",
"CryptoApproveAllowance",
"CryptoDeleteAllowance",
"UtilPrng"
"UtilPrng",
"NodeCreate",
"NodeUpdate",
"NodeDelete"
]
},
{
Expand Down Expand Up @@ -146,7 +149,8 @@
"opsPerSec": 0,
"milliOpsPerSec": 2000,
"operations": [
"CryptoCreate"
"CryptoCreate",
"NodeCreate"
]
},
{
Expand Down
8 changes: 6 additions & 2 deletions hedera-node/configuration/testnet/upgrade/throttles.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@
"TokenGetNftInfos",
"CryptoApproveAllowance",
"CryptoDeleteAllowance",
"UtilPrng"
"UtilPrng",
"NodeCreate",
"NodeUpdate",
"NodeDelete"
]
},
{
Expand Down Expand Up @@ -146,7 +149,8 @@
"opsPerSec": 0,
"milliOpsPerSec": 2000,
"operations": [
"CryptoCreate"
"CryptoCreate",
"NodeCreate"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@
* <p>This registration is a critical side effect that must happen called before any Platform initialization
* steps that try to create or deserialize a {@link MerkleStateRoot}.
*
* @param constructableRegistry the registry to register {@link RuntimeConstructable} factories with
* @param registryFactory the factory to use for creating the services registry
* @param migrator the migrator to use with the services
* @param constructableRegistry the registry to register {@link RuntimeConstructable} factories with
* @param registryFactory the factory to use for creating the services registry
* @param migrator the migrator to use with the services
* @param tssBaseServiceSupplier the supplier for the TSS base service
*/
public Hedera(
Expand Down Expand Up @@ -531,9 +531,9 @@
* <p>If the {@code deserializedVersion} is {@code null}, then this is the first time the node has been started,
* and thus all schemas will be executed.
*
* @param state current state
* @param state current state
* @param deserializedVersion version deserialized
* @param trigger trigger that is calling migration
* @param trigger trigger that is calling migration
* @return the state changes caused by the migration
*/
private List<StateChanges.Builder> onMigrate(
Expand Down Expand Up @@ -769,6 +769,7 @@

/**
* Called to set the starting state hash after genesis or restart.
*
* @param stateHash the starting state hash
*/
public void setInitialStateHash(@NonNull final Hash stateHash) {
Expand Down Expand Up @@ -854,6 +855,10 @@
initialStateHashFuture = new CompletableFuture<>();
notifications.register(ReconnectCompleteListener.class, new ReadReconnectStartingStateHash(notifications));
}
if (initialStateHashFuture == null) {
logger.warn("Starting from Browser is deprecated. Setting initial start hash to empty hash.");
initialStateHashFuture = completedFuture(Bytes.wrap(new byte[48]));

Check warning on line 860 in hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java

View check run for this annotation

Codecov / codecov/patch

hedera-node/hedera-app/src/main/java/com/hedera/node/app/Hedera.java#L859-L860

Added lines #L859 - L860 were not covered by tests
}
// For other triggers the initial state hash must have been set already
requireNonNull(initialStateHashFuture);
final var roundNum = requireNonNull(state.getReadableStates(PlatformStateService.NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
"ContractGetRecords",
"ContractCallLocal",
"TransactionGetRecord",
"GetVersionInfo"
"GetVersionInfo",
"NodeCreate",
"NodeUpdate",
"NodeDelete"
]
},
{
Expand Down Expand Up @@ -104,7 +107,8 @@
{
"opsPerSec": 2000,
"operations": [
"CryptoCreate"
"CryptoCreate",
"NodeCreate"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
"TokenGetNftInfos",
"CryptoApproveAllowance",
"CryptoDeleteAllowance",
"UtilPrng"
"UtilPrng",
"NodeCreate",
"NodeUpdate",
"NodeDelete"
]
},
{
Expand Down Expand Up @@ -146,7 +149,8 @@
"opsPerSec": 0,
"milliOpsPerSec": 2000,
"operations": [
"CryptoCreate"
"CryptoCreate",
"NodeCreate"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.hedera.services.bdd.suites.freeze.PrepareUpgrade;
import com.hedera.services.bdd.suites.freeze.SimpleFreezeOnly;
import com.hedera.services.bdd.suites.freeze.UpdateFileForUpgrade;
import com.hedera.services.bdd.suites.jrs.NodeOpsForUpgrade;
import com.hedera.services.bdd.suites.meta.VersionInfoSpec;
import com.hedera.services.bdd.suites.perf.AdjustFeeScheduleSuite;
import com.hedera.services.bdd.suites.perf.crypto.*;
Expand Down Expand Up @@ -91,6 +92,7 @@ public class SuiteRunner {
put("CreateFilesBeforeReconnect", aof(CreateFilesBeforeReconnect::new));
put("SubmitMessageLoadTest", aof(SubmitMessageLoadTest::new));
put("AdjustFeeSchedule", aof(AdjustFeeScheduleSuite::new));
put("NodeOpsForUpgrade", aof(NodeOpsForUpgrade::new));
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* 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.services.bdd.suites.jrs;

import static com.hedera.services.bdd.spec.HapiSpec.defaultHapiSpec;
import static com.hedera.services.bdd.spec.transactions.TxnVerbs.nodeDelete;
import static com.hedera.services.bdd.spec.transactions.TxnVerbs.nodeUpdate;
import static com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed;
import static com.hedera.services.bdd.spec.utilops.UtilVerbs.overridingTwo;
import static com.hedera.services.bdd.suites.crypto.CryptoCreateSuite.ED_25519_KEY;
import static com.hedera.services.bdd.suites.freeze.CommonUpgradeResources.initializeSettings;

import com.hedera.services.bdd.spec.keys.KeyShape;
import com.hedera.services.bdd.suites.HapiSuite;
import java.util.List;
import java.util.stream.Stream;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.DynamicTest;

public class NodeOpsForUpgrade extends HapiSuite {
private static final Logger log = LogManager.getLogger(NodeOpsForUpgrade.class);

public static void main(String... args) {
new NodeOpsForUpgrade().runSuiteSync();
}

@Override
public List<Stream<DynamicTest>> getSpecsInSuite() {
return List.of(doDelete());
}

final Stream<DynamicTest> doDelete() {
return defaultHapiSpec("NodeOpsForUpgrade")
.given(initializeSettings())
.when(
overridingTwo("nodes.enableDAB", "true", "nodes.updateAccountIdAllowed", "true"),
newKeyNamed(ED_25519_KEY).shape(KeyShape.ED25519),
nodeDelete("3").payingWith(GENESIS).signedBy(GENESIS),
nodeUpdate("2")
.description("UpdatedNode0")
.accountId("0.0.100")
.payingWith(GENESIS)
.signedBy(GENESIS))
.then();
}

@Override
protected Logger getResultsLogger() {
return log;
}
}
Loading