diff --git a/.github/workflows/flow-pull-request-checks.yaml b/.github/workflows/flow-pull-request-checks.yaml index bf2b38add..3fc8c15b5 100644 --- a/.github/workflows/flow-pull-request-checks.yaml +++ b/.github/workflows/flow-pull-request-checks.yaml @@ -81,9 +81,11 @@ jobs: - { name: "Node PEM Kill", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-pem-kill-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-pem-kill-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-pem-kill-coverage-report }}" } - { name: "Node Local Hedera", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-local-hedera-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-local-hedera-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-local-hedera-coverage-report }}" } - { name: "Node Local PTT", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-local-ptt-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-local-ptt-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-local-ptt-coverage-report }}" } - - { name: "Node Add", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}" } - - { name: "Node Add Local", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-local-coverage-report }}" } - - { name: "Node Add - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}" } + # Node Add tests are disabled and are not viable for the amount of memory available. The teacher crashes during + # the reconnect attempt. + #- { name: "Node Add", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-coverage-report }}" } + #- { name: "Node Add Local", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-local-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-local-coverage-report }}" } + #- { name: "Node Add - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-add-separate-commands-coverage-report }}" } - { name: "Node Update", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-update-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-update-coverage-report }}" } - { name: "Node Update - Separate commands", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-update-separate-commands-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-update-separate-commands-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-update-separate-commands-coverage-report }}" } - { name: "Node Delete", npm-test-script: "test-${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-subdirectory: "${{ needs.env-vars.outputs.e2e-node-delete-test-subdir }}", coverage-report-name: "${{ needs.env-vars.outputs.e2e-node-delete-coverage-report }}" } diff --git a/resources/profiles/custom-spec.yaml b/resources/profiles/custom-spec.yaml index 8ab246ec8..193e082d3 100644 --- a/resources/profiles/custom-spec.yaml +++ b/resources/profiles/custom-spec.yaml @@ -5,9 +5,9 @@ local: # 3 nodes, ~850 TPS (Docker Desktop 8 cores, 16 GB RAM) - name: JAVA_HEAP_MIN value: 1g - name: JAVA_HEAP_MAX - value: 3g + value: 6g - name: JAVA_OPTS - value: "-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ZAllocationSpikeTolerance=2 -XX:ConcGCThreads=2 -XX:ZMarkStackSpaceLimit=1g -XX:MaxDirectMemorySize=1g -XX:MetaspaceSize=100M -Xlog:gc*:gc.log --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true" + value: "-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:ZAllocationSpikeTolerance=2 -XX:ConcGCThreads=2 -XX:ZMarkStackSpaceLimit=1g -XX:MaxDirectMemorySize=2g -XX:MetaspaceSize=100M -Xlog:gc*:gc.log --add-opens java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true" haproxy: # use chart defaults envoyProxy: # use chart defaults rpcRelay: diff --git a/src/commands/node/tasks.ts b/src/commands/node/tasks.ts index f0c8b0381..c002afd81 100644 --- a/src/commands/node/tasks.ts +++ b/src/commands/node/tasks.ts @@ -453,6 +453,12 @@ export class NodeCommandTasks { const treasuryPrivateKey = PrivateKey.fromStringED25519(treasuryKey.privateKey) client.setOperator(TREASURY_ACCOUNT_ID, treasuryPrivateKey) + // check balance + const treasuryBalance = await new AccountBalanceQuery() + .setAccountId(TREASURY_ACCOUNT_ID) + .execute(client) + this.logger.debug(`Account ${TREASURY_ACCOUNT_ID} balance: ${treasuryBalance.hbars}`) + // get some initial balance await this.accountManager.transferAmount(constants.TREASURY_ACCOUNT_ID, accountId, HEDERA_NODE_DEFAULT_STAKE_AMOUNT + 1) @@ -518,15 +524,15 @@ export class NodeCommandTasks { const { upgradeZipHash } = ctx const { nodeClient, freezeAdminPrivateKey } = ctx.config try { - // transfer some tiny amount to the freeze admin account - await this.accountManager.transferAmount(constants.TREASURY_ACCOUNT_ID, FREEZE_ADMIN_ACCOUNT, 100000) - // query the balance const balance = await new AccountBalanceQuery() .setAccountId(FREEZE_ADMIN_ACCOUNT) .execute(nodeClient) this.logger.debug(`Freeze admin account balance: ${balance.hbars}`) + // transfer some tiny amount to the freeze admin account + await this.accountManager.transferAmount(constants.TREASURY_ACCOUNT_ID, FREEZE_ADMIN_ACCOUNT, 100000) + // set operator of freeze transaction as freeze admin account nodeClient.setOperator(FREEZE_ADMIN_ACCOUNT, freezeAdminPrivateKey) @@ -561,6 +567,12 @@ export class NodeCommandTasks { futureDate.setTime(futureDate.getTime() + 5000) // 5 seconds in the future this.logger.debug(`Freeze time: ${futureDate}`) + // query the balance + const balance = await new AccountBalanceQuery() + .setAccountId(FREEZE_ADMIN_ACCOUNT) + .execute(nodeClient) + this.logger.debug(`Freeze admin account balance: ${balance.hbars}`) + nodeClient.setOperator(FREEZE_ADMIN_ACCOUNT, freezeAdminPrivateKey) const freezeUpgradeTx = await new FreezeTransaction() .setFreezeType(FreezeType.FreezeUpgrade) diff --git a/src/core/account_manager.ts b/src/core/account_manager.ts index f09eeaeef..0c855dfe9 100644 --- a/src/core/account_manager.ts +++ b/src/core/account_manager.ts @@ -214,25 +214,19 @@ export class AccountManager { * @returns a node client that can be used to call transactions */ async _getNodeClient (namespace: string, networkNodeServicesMap: Map, operatorId: string, - operatorKey: string) { - const nodes = {} + operatorKey: string, useFirstNodeOnly = true) { + let nodes = {} try { let localPort = constants.LOCAL_NODE_START_PORT for (const networkNodeService of networkNodeServicesMap.values()) { - const usePortForward = this.shouldUseLocalHostPortForward(networkNodeService) - const host = usePortForward ? '127.0.0.1' : networkNodeService.haProxyLoadBalancerIp as string - const port = +networkNodeService.haProxyGrpcPort - const targetPort = usePortForward ? localPort : port + const addlNode = await this.configureNodeAccess(networkNodeService, localPort, networkNodeServicesMap.size) + nodes = { ...nodes, ...addlNode } + localPort++ - if (usePortForward && this._portForwards.length < networkNodeServicesMap.size) { - this._portForwards.push(await this.k8.portForward(networkNodeService.haProxyPodName, localPort, port)) + if (useFirstNodeOnly) { + break } - - // @ts-ignore - nodes[`${host}:${targetPort}`] = AccountId.fromString((networkNodeService.accountId as string)) - await this.k8.testConnection(host, targetPort) - localPort++ } this.logger.debug(`creating client from network configuration: ${JSON.stringify(nodes)}`) @@ -250,6 +244,23 @@ export class AccountManager { } } + private async configureNodeAccess (networkNodeService: NetworkNodeServices, localPort: number, totalNodes: number) { + const obj = {} + const usePortForward = this.shouldUseLocalHostPortForward(networkNodeService) + const host = usePortForward ? '127.0.0.1' : networkNodeService.haProxyLoadBalancerIp as string + const port = +networkNodeService.haProxyGrpcPort + const targetPort = usePortForward ? localPort : port + + if (usePortForward && this._portForwards.length < totalNodes) { + this._portForwards.push(await this.k8.portForward(networkNodeService.haProxyPodName, localPort, port)) + } + + await this.k8.testConnection(host, targetPort) + obj[`${host}:${targetPort}`] = AccountId.fromString((networkNodeService.accountId as string)) + + return obj + } + /** * Gets a Map of the Hedera node services and the attributes needed * @param namespace - the namespace of the solo network deployment diff --git a/version.ts b/version.ts index 4d8d1e365..4d17eb1b5 100644 --- a/version.ts +++ b/version.ts @@ -22,6 +22,6 @@ export const JAVA_VERSION = '21.0.1+12' export const HELM_VERSION = 'v3.14.2' export const SOLO_CHART_VERSION = '0.34.1' -export const HEDERA_PLATFORM_VERSION = 'v0.56.0' +export const HEDERA_PLATFORM_VERSION = 'v0.56.5' export const MIRROR_NODE_VERSION = '0.116.0' export const HEDERA_EXPLORER_VERSION = '0.2.1'