Skip to content

Commit

Permalink
feat: add support for genesis throttle configuration (#1026)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick authored Jan 4, 2025
1 parent 5edb9c9 commit d8903a8
Show file tree
Hide file tree
Showing 21 changed files with 293 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zxc-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ jobs:
if: ${{ runner.os == 'linux' && (inputs.npm-test-script == 'test-e2e-node-local-hedera' || inputs.npm-test-script == 'test-e2e-node-local-ptt' || inputs.npm-test-script == 'test-e2e-node-add-local') && !cancelled() && !failure() }}
run: |
cd ..
git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.0
git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.1
cd hedera-services
ls -ltr
${{ env.CG_EXEC }} ./gradlew assemble --stacktrace --info
Expand Down
2 changes: 1 addition & 1 deletion HelperTasks.yml → Taskfile.helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ tasks:
if [[ "${SOLO_CHART_VERSION}" != "" ]]; then
export SOLO_CHART_FLAG='--solo-chart-version ${SOLO_CHART_VERSION}'
fi
SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- network deploy --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${RELEASE_FLAG} ${SOLO_CHART_FLAG} ${VALUES_FLAG} ${SETTINGS_FLAG} ${LOG4J2_FLAG} ${APPLICATION_PROPERTIES_FLAG} -q
SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- network deploy --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${RELEASE_FLAG} ${SOLO_CHART_FLAG} ${VALUES_FLAG} ${SETTINGS_FLAG} ${LOG4J2_FLAG} ${APPLICATION_PROPERTIES_FLAG} ${GENESIS_THROTTLES_FLAG} -q
- |
if [[ "${CONSENSUS_NODE_VERSION}" != "" ]]; then
export CONSENSUS_NODE_FLAG='--release-tag ${CONSENSUS_NODE_VERSION}'
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
helper:
taskfile: ./HelperTasks.yml
taskfile: ./Taskfile.helper.yml
flatten: true
env:
SOLO_NETWORK_SIZE: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
helper:
taskfile: ../HelperTasks.yml
taskfile: ../Taskfile.helper.yml
flatten: true

tasks:
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-network-config/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
main:
taskfile: ../ExamplesTasks.yml
taskfile: ../Taskfile.examples.yml
flatten: true
env:
SOLO_NETWORK_SIZE: 10
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
main:
taskfile: ../../ExamplesTasks.yml
taskfile: ../../Taskfile.examples.yml
flatten: true
vars:
solo_home_override_dir: "%HOME%/.solo"
Expand Down
2 changes: 1 addition & 1 deletion examples/performance-tuning/solo-perf-test/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
main:
taskfile: ../../ExamplesTasks.yml
taskfile: ../../Taskfile.examples.yml
flatten: true
env:
SOLO_NETWORK_SIZE: 7
Expand Down
3 changes: 2 additions & 1 deletion examples/solo-gke-test/Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 3
includes:
main:
taskfile: ../ExamplesTasks.yml
taskfile: ../Taskfile.examples.yml
flatten: true
vars:
solo_home_override_dir: "/Users/user/.solo-gke-test"
Expand All @@ -17,3 +17,4 @@ env:
APPLICATION_PROPERTIES_FLAG: "--application-properties {{.USER_WORKING_DIR}}/application.properties"
HEDERA_SERVICES_ROOT: "/Users/user/source/hedera-services"
LOCAL_BUILD_FLAG: "--local-build-path {{.HEDERA_SERVICES_ROOT}}/hedera-node/data"
GENESIS_THROTTLES_FLAG: "--genesis-throttles-file {{.USER_WORKING_DIR}}/throttles.json"
4 changes: 4 additions & 0 deletions examples/solo-gke-test/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ hedera.profiles.active=TEST
staking.periodMins=1
nodes.updateAccountIdAllowed=true
blockStream.streamMode=RECORDS

# Override the throttle definitions to be used during genesis.
# This override is required because release <= 0.58.x use a different default path.
bootstrap.throttleDefsJson.resource=data/config/genesis-throttles.json
204 changes: 204 additions & 0 deletions examples/solo-gke-test/throttles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
{
"buckets": [
{
"burstPeriod": 0,
"burstPeriodMs": 15000,
"name": "ThroughputLimits",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 150000,
"operations": [
"ScheduleCreate",
"CryptoCreate",
"CryptoTransfer",
"CryptoUpdate",
"CryptoDelete",
"CryptoGetInfo",
"CryptoGetAccountRecords",
"ConsensusCreateTopic",
"ConsensusSubmitMessage",
"ConsensusUpdateTopic",
"ConsensusDeleteTopic",
"ConsensusGetTopicInfo",
"TokenGetNftInfo",
"TokenGetInfo",
"ScheduleDelete",
"ScheduleGetInfo",
"FileGetContents",
"FileGetInfo",
"ContractUpdate",
"ContractDelete",
"ContractGetInfo",
"ContractGetBytecode",
"ContractGetRecords",
"ContractCallLocal",
"TransactionGetRecord",
"GetVersionInfo",
"TokenGetAccountNftInfos",
"TokenGetNftInfos",
"CryptoApproveAllowance",
"CryptoDeleteAllowance",
"UtilPrng",
"NodeCreate",
"NodeUpdate",
"NodeDelete"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 40000,
"operations": [
"FileCreate",
"FileUpdate",
"FileAppend",
"FileDelete"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 100000,
"operations": [
"ScheduleSign"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 125000,
"operations": [
"TokenMint"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 35000,
"operations": [
"ContractCall",
"ContractCreate",
"EthereumTransaction"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 100000,
"operations": [
"TokenCreate",
"TokenDelete",
"TokenBurn",
"TokenUpdate",
"TokenFeeScheduleUpdate",
"TokenAssociateToAccount",
"TokenAccountWipe",
"TokenDissociateFromAccount",
"TokenFreezeAccount",
"TokenUnfreezeAccount",
"TokenGrantKycToAccount",
"TokenRevokeKycFromAccount",
"TokenPause",
"TokenUnpause",
"TokenUpdateNfts",
"TokenReject",
"TokenAirdrop",
"TokenClaimAirdrop",
"TokenCancelAirdrop"
]
}
]
},
{
"burstPeriod": 0,
"burstPeriodMs": 1000,
"name": "OffHeapQueryLimits",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 100000,
"operations": [
"FileGetContents",
"FileGetInfo",
"ContractGetInfo",
"ContractGetBytecode",
"ContractCallLocal"
]
}
]
},
{
"burstPeriod": 0,
"burstPeriodMs": 3000,
"name": "PriorityReservations",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 40000,
"operations": [
"FileCreate",
"FileUpdate",
"FileAppend",
"FileDelete"
]
}
]
},
{
"burstPeriod": 0,
"burstPeriodMs": 15000,
"name": "CreationLimits",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 40000,
"operations": [
"CryptoCreate",
"NodeCreate"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 5000,
"operations": [
"ConsensusCreateTopic"
]
},
{
"opsPerSec": 0,
"milliOpsPerSec": 100000,
"operations": [
"TokenCreate",
"TokenAssociateToAccount",
"ScheduleCreate",
"TokenAirdrop"
]
}
]
},
{
"burstPeriod": 0,
"burstPeriodMs": 1000,
"name": "FreeQueryLimits",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 1000000000,
"operations": [
"TransactionGetReceipt"
]
}
]
},
{
"burstPeriod": 0,
"burstPeriodMs": 1000,
"name": "BalanceQueryLimits",
"throttleGroups": [
{
"opsPerSec": 0,
"milliOpsPerSec": 1000000,
"operations": [
"CryptoGetAccountBalance"
]
}
]
}
]
}
12 changes: 12 additions & 0 deletions src/commands/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,17 @@ export class Flags {
prompt: undefined,
};

static readonly genesisThrottlesFile: CommandFlag = {
constName: 'genesisThrottlesFile',
name: 'genesis-throttles-file',
definition: {
describe: 'throttles.json file used during network genesis',
defaultValue: '',
type: 'string',
},
prompt: undefined,
};

static readonly settingTxt: CommandFlag = {
constName: 'settingTxt',
name: 'settings-txt',
Expand Down Expand Up @@ -1646,6 +1657,7 @@ export class Flags {
Flags.generateEcdsaKey,
Flags.generateGossipKeys,
Flags.generateTlsKeys,
Flags.genesisThrottlesFile,
Flags.gossipEndpoints,
Flags.gossipPrivateKey,
Flags.gossipPublicKey,
Expand Down
Loading

0 comments on commit d8903a8

Please sign in to comment.