Skip to content

Commit

Permalink
feat: add support for throttle configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick committed Dec 31, 2024
1 parent e590516 commit 23a58cf
Show file tree
Hide file tree
Showing 23 changed files with 500 additions and 12 deletions.
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
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* make sure that your current kubeconfig context is pointing to the cluster that you want to deploy to
* run `task` which will do the rest and deploy the network and take care of many of the pre-requisites

NOTES:
NOTES:

* Some of these examples are for running against large clusters with a lot of resources available.
* the `env` environment variables if set in your shell will take precedence over what is in the Taskfile.yml. e.g. `export HEDERA_SERVICES_ROOT=<path-to-hedera-services-root>`
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"
]
}
]
}
]
}
4 changes: 4 additions & 0 deletions resources/templates/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ staking.periodMins=1
nodes.updateAccountIdAllowed=true
# TODO: remove once we have the uploader enabled, required for current p0 deadline
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
Loading

0 comments on commit 23a58cf

Please sign in to comment.