Skip to content

Commit

Permalink
fix: fix permissions for upgrade test (#10779)
Browse files Browse the repository at this point in the history
Signed-off-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com>
Co-authored-by: Neeharika-Sompalli <neeharika.sompalli@swirldslabs.com>
  • Loading branch information
JeffreyDallas and Neeharika-Sompalli committed Jan 7, 2024
1 parent ce3ecc5 commit 596ff3f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ final HapiSpec createAccount() {
.withRecharging()
.rechargeWindow(3)
.key(DEFAULT_PAYER)
.payingWith(DEFAULT_PAYER)
.payingWith(GENESIS)
.hasRetryPrecheckFrom(NOISY_RETRY_PRECHECKS)
.via("txn")
.ensuringResolvedStatusIsntFromDuplicate();
Expand Down Expand Up @@ -120,6 +120,7 @@ final HapiSpec createAccount() {
try {
var payerAccountInfo = getAccountInfo("payerAccount")
.savingSnapshot("payerAccountInfo")
.payingWith(GENESIS)
.logged();
allRunFor(spec, payerAccountInfo);
gotPayerInfo = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.common.base.MoreObjects;
import com.hedera.services.bdd.spec.HapiPropertySource;
import java.util.Arrays;

public class PerfTestLoadSettings {
public static final int DEFAULT_TPS = 500;
Expand Down Expand Up @@ -131,8 +132,8 @@ public class PerfTestLoadSettings {
private String upgradeFilePath = DEFAULT_UPGRADE_FILE_PATH;
private String upgradeFileId = DEFAULT_UPGRADE_FILE_ID;
private int upgradeFileAppendsPerBurst = DEFAULT_APPENDS_PER_BURST;

private int nodeToStake = DEFAULT_NODE_TO_STAKE;
private int[] extraNodesToStake = {};
private HapiPropertySource ciProps = null;

public PerfTestLoadSettings() {}
Expand Down Expand Up @@ -195,6 +196,10 @@ public int getNodeToStake() {
return nodeToStake;
}

public int[] getExtraNodesToStake() {
return extraNodesToStake;
}

public int getTotalTopics() {
return totalTestTopics;
}
Expand Down Expand Up @@ -346,6 +351,11 @@ public void setFrom(HapiPropertySource ciProps) {
if (ciProps.has("nodeToStake")) {
nodeToStake = ciProps.getInteger("nodeToStake");
}
if (ciProps.has("extraNodesToStake")) {
extraNodesToStake = Arrays.stream(ciProps.get("extraNodesToStake").split("[+]"))
.mapToInt(Integer::parseInt)
.toArray();
}
}

@Override
Expand Down Expand Up @@ -379,6 +389,7 @@ public String toString() {
.add("upgradeFileId", upgradeFileId)
.add("upgradeFileAppendsPerBurst", upgradeFileAppendsPerBurst)
.add("nodeToStake", nodeToStake)
.add("extraNodesToStake", extraNodesToStake)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,16 @@ protected HapiSpec runCryptoTransfers() {
.logging(),
withOpContext((spec, opLog) -> {
List<HapiSpecOperation> ops = new ArrayList<>();
var stakedNodeId = settings.getNodeToStake();
for (int i = 0; i < STAKED_CREATIONS; i++) {
var stakedAccount = "stakedAccount" + i;
if (settings.getExtraNodesToStake().length != 0) {
stakedNodeId =
settings.getExtraNodesToStake()[i % settings.getExtraNodesToStake().length];
}
ops.add(cryptoCreate(stakedAccount)
.payingWith("sender")
.stakedNodeId(settings.getNodeToStake())
.stakedNodeId(stakedNodeId)
.fee(ONE_HBAR)
.deferStatusResolution()
.signedBy("sender", DEFAULT_PAYER));
Expand Down

0 comments on commit 596ff3f

Please sign in to comment.