Skip to content

Commit 2f7ef63

Browse files
authored
Merge pull request #944 from ainblockchain/release/v1.0.5
Release/v1.0.5
2 parents c5d25ad + 54ed529 commit 2f7ef63

14 files changed

+621
-37
lines changed

client/protocol_versions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
},
9090
"1.0.4": {
9191
"min": "1.0.0"
92+
},
93+
"1.0.5": {
94+
"min": "1.0.0"
9295
}
9396
}

common/common-util.js

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -941,37 +941,65 @@ class CommonUtil {
941941

942942
static hasTimerFlagEnabled(timerFlags, flagName, blockNumber) {
943943
const flag = timerFlags[flagName];
944-
if (!flag) {
944+
if (!CommonUtil.isDict(flag)) {
945945
return false;
946946
}
947947
if (!CommonUtil.isNumber(blockNumber)) {
948948
return false;
949949
}
950-
const enabledBlock = flag['enabled_block'];
951-
if (enabledBlock === undefined || !CommonUtil.isNumber(enabledBlock) ||
952-
blockNumber < enabledBlock) {
950+
const enabledBlockNumber = CommonUtil.getEnabledBlockNumberFromTimerFlag(flag);
951+
if (!CommonUtil.isNumber(enabledBlockNumber) || blockNumber < enabledBlockNumber) {
953952
return false;
954953
}
955-
const disabledBlock = flag['disabled_block'];
956-
if (disabledBlock === undefined || !CommonUtil.isNumber(disabledBlock) ||
957-
blockNumber < disabledBlock) {
954+
const disabledBlockNumber = CommonUtil.getDisabledBlockNumberFromTimerFlag(flag);
955+
if (!CommonUtil.isNumber(disabledBlockNumber) || blockNumber < disabledBlockNumber) {
958956
return true;
959957
}
960958
return false;
961959
}
962960

963-
static getTimerFlagEnabledBlock(timerFlags, flagName) {
961+
static getEnabledBlockNumberFromTimerFlag(timerFlag) {
962+
const enabledBlockNumber = timerFlag['enabled_block'];
963+
if (!CommonUtil.isNumber(enabledBlockNumber)) {
964+
return null;
965+
}
966+
const earlyAppliedBlockNumber = process.env.TIMER_FLAG_EARLY_APPLIED_BLOCK_NUMBER ? Number(process.env.TIMER_FLAG_EARLY_APPLIED_BLOCK_NUMBER) : null;
967+
if (CommonUtil.isNumber(earlyAppliedBlockNumber) && enabledBlockNumber <= earlyAppliedBlockNumber) {
968+
return 2;
969+
}
970+
return enabledBlockNumber;
971+
}
972+
973+
static getDisabledBlockNumberFromTimerFlag(timerFlag) {
974+
const disabledBlockNumber = timerFlag['disabled_block'];
975+
if (!CommonUtil.isNumber(disabledBlockNumber)) {
976+
return null;
977+
}
978+
const earlyAppliedBlockNumber = process.env.TIMER_FLAG_EARLY_APPLIED_BLOCK_NUMBER ? Number(process.env.TIMER_FLAG_EARLY_APPLIED_BLOCK_NUMBER) : null;
979+
if (CommonUtil.isNumber(earlyAppliedBlockNumber) && disabledBlockNumber <= earlyAppliedBlockNumber) {
980+
return 2;
981+
}
982+
return disabledBlockNumber;
983+
}
984+
985+
static getTimerFlagEnabledBlockNumber(timerFlags, flagName) {
964986
const flag = timerFlags[flagName];
965-
if (!flag) {
987+
if (!CommonUtil.isDict(flag)) {
966988
return null;
967989
}
968-
const enabledBlock = flag['enabled_block'];
969-
if (enabledBlock === undefined || !CommonUtil.isNumber(enabledBlock)) {
990+
return CommonUtil.getEnabledBlockNumberFromTimerFlag(flag);
991+
}
992+
993+
static getTimerFlagDisabledBlockNumber(timerFlags, flagName) {
994+
const flag = timerFlags[flagName];
995+
if (!CommonUtil.isDict(flag)) {
970996
return null;
971997
}
972-
return enabledBlock;
998+
return CommonUtil.getDisabledBlockNumberFromTimerFlag(flag);
973999
}
9741000

1001+
// NOTE(platfowner): Bandage files are applied on 'enabled_block' number but not reverted on
1002+
// 'disabled_block' number.
9751003
static createTimerFlagEnabledBandageMap(timerFlags) {
9761004
const LOG_HEADER = 'createTimerFlagEnabledBandageMap';
9771005
const map = new Map();
@@ -980,7 +1008,7 @@ class CommonUtil {
9801008
for (let i = 0; i < flagNameList.length; i++) {
9811009
const flagName = flagNameList[i];
9821010
const flag = timerFlags[flagName];
983-
const enabledBlockNumber = flag['enabled_block'];
1011+
const enabledBlockNumber = CommonUtil.getEnabledBlockNumberFromTimerFlag(flag);
9841012
if (CommonUtil.isNumber(enabledBlockNumber) && flag['has_bandage'] === true) {
9851013
const bandageFilePath = path.resolve(__dirname, '../db/bandage-files', `${flagName}.js`);
9861014
console.log(`[${LOG_HEADER}] [${i}] Registering ${bandageFilePath}`);

common/constants.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ function isEnabledTimerFlag(flagName, blockNumber) {
6363
}
6464

6565
function isTimerFlagEnabledAt(flagName, blockNumber) {
66-
return CommonUtil.getTimerFlagEnabledBlock(TimerFlags, flagName) === blockNumber;
66+
return CommonUtil.getTimerFlagEnabledBlockNumber(TimerFlags, flagName) === blockNumber;
67+
}
68+
69+
function isTimerFlagDisabledAt(flagName, blockNumber) {
70+
return CommonUtil.getTimerFlagDisabledBlockNumber(TimerFlags, flagName) === blockNumber;
6771
}
6872

6973
const TimerFlagEnabledBandageMap = CommonUtil.createTimerFlagEnabledBandageMap(TimerFlags);
@@ -763,6 +767,7 @@ module.exports = {
763767
TimerFlags,
764768
isEnabledTimerFlag,
765769
isTimerFlagEnabledAt,
770+
isTimerFlagDisabledAt,
766771
TimerFlagEnabledBandageMap,
767772
BlockchainParams,
768773
NodeConfigs,

deploy_blockchain_genesis_gcp.sh

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ $# -lt 3 ]] || [[ $# -gt 8 ]]; then
44
printf "Usage: bash deploy_blockchain_genesis_gcp.sh [dev|staging|sandbox|spring|summer|mainnet] <GCP Username> <# of Shards> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync] [--kill-only|--skip-kill]\n"
5-
printf "Example: bash deploy_blockchain_genesis_gcp.sh dev lia 0 --setup --keystore --no-keep-code\n"
5+
printf "Example: bash deploy_blockchain_genesis_gcp.sh dev my_username 0 --setup --keystore --no-keep-code\n"
66
printf "\n"
77
exit
88
fi
@@ -233,6 +233,20 @@ if [[ $SETUP_OPTION = "--setup" ]]; then
233233
done
234234
fi
235235

236+
# install node modules on GCP instances
237+
if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then
238+
printf "\n* >> Installing node modules for parent tracker (${TRACKER_TARGET_ADDR}) *********************************************************\n\n"
239+
gcloud compute ssh $TRACKER_TARGET_ADDR --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone $TRACKER_ZONE
240+
241+
for node_index in `seq 0 $(( $NUM_NODES - 1 ))`; do
242+
NODE_TARGET_ADDR=NODE_${node_index}_TARGET_ADDR
243+
NODE_ZONE=NODE_${node_index}_ZONE
244+
245+
printf "\n* >> Installing node modules for parent node $node_index (${!NODE_TARGET_ADDR}) *********************************************************\n\n"
246+
gcloud compute ssh ${!NODE_TARGET_ADDR} --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone ${!NODE_ZONE}
247+
done
248+
fi
249+
236250
if [[ $KILL_OPTION = "--skip-kill" ]]; then
237251
printf "\nSkipping process kill...\n"
238252
else
@@ -309,11 +323,14 @@ for node_index in `seq 0 $(( $NUM_NODES - 1 ))`; do
309323

310324
printf "\n* >> Starting parent node $node_index (${!NODE_TARGET_ADDR}) *********************************************************\n\n"
311325

312-
if [[ $node_index -gt 4 ]]; then
326+
if [[ $node_index -ge 5 ]]; then
313327
JSON_RPC_OPTION="--json-rpc"
314-
REST_FUNC_OPTION="--rest-func"
315328
else
316329
JSON_RPC_OPTION=""
330+
fi
331+
if [[ $node_index -ge 5 ]] && [[ $node_index -lt 8 ]]; then
332+
REST_FUNC_OPTION="--rest-func"
333+
else
317334
REST_FUNC_OPTION=""
318335
fi
319336

@@ -377,6 +394,18 @@ if [[ $NUM_SHARDS -gt 0 ]]; then
377394
gcloud compute ssh $SHARD_NODE_2_TARGET_ADDR --command ". setup_blockchain_ubuntu.sh" --project $PROJECT_ID --zone $NODE_2_ZONE
378395
fi
379396

397+
# install node modules on GCP instances
398+
if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then
399+
printf "\n* >> Installing node modules for shard_$i tracker (${SHARD_TRACKER_TARGET_ADDR}) *********************************************************\n\n"
400+
gcloud compute ssh $SHARD_TRACKER_TARGET_ADDR --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone $TRACKER_ZONE
401+
printf "\n* >> Installing node modules for shard_$i node 0 (${SHARD_NODE_0_TARGET_ADDR}) *********************************************************\n\n"
402+
gcloud compute ssh $SHARD_NODE_0_TARGET_ADDR --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone $NODE_0_ZONE
403+
printf "\n* >> Installing node modules for shard_$i node 1 (${SHARD_NODE_1_TARGET_ADDR}) *********************************************************\n\n"
404+
gcloud compute ssh $SHARD_NODE_1_TARGET_ADDR --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone $NODE_1_ZONE
405+
printf "\n* >> Installing node modules for shard_$i node 2 (${SHARD_NODE_2_TARGET_ADDR}) *********************************************************\n\n"
406+
gcloud compute ssh $SHARD_NODE_2_TARGET_ADDR --command "cd ./ain-blockchain; sudo yarn install --ignore-engines" --project $PROJECT_ID --zone $NODE_2_ZONE
407+
fi
408+
380409
# ssh into each instance, install packages and start up the server
381410
printf "\n* >> Starting shard_$i tracker (${SHARD_TRACKER_TARGET_ADDR}) *********************************************************\n\n"
382411
START_TRACKER_CMD="gcloud compute ssh $SHARD_TRACKER_TARGET_ADDR --command '$START_TRACKER_CMD_BASE $KEEP_CODE_OPTION' --project $PROJECT_ID --zone $TRACKER_ZONE"

deploy_blockchain_incremental_gcp.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ $# -lt 5 ]] || [[ $# -gt 11 ]]; then
44
printf "Usage: bash deploy_blockchain_incremental_gcp.sh [dev|staging|sandbox|spring|summer|mainnet] <GCP Username> <# of Shards> <Begin Parent Node Index> <End Parent Node Index> [--setup] [--keystore|--mnemonic|--private-key] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--full-sync|--fast-sync]\n"
5-
printf "Example: bash deploy_blockchain_incremental_gcp.sh dev lia 0 -1 1 --setup --keystore --no-keep-code --full-sync\n"
5+
printf "Example: bash deploy_blockchain_incremental_gcp.sh dev my_username 0 -1 1 --setup --keystore --no-keep-code --full-sync\n"
66
printf "Note: <Begin Parent Node Index> = -1 is for tracker\n"
77
printf "Note: <End Parent Node Index> is inclusive\n"
88
printf "\n"
@@ -215,11 +215,15 @@ function deploy_node() {
215215

216216
# 3. Start node
217217
printf "\n\n<<< Starting node $node_index >>>\n\n"
218-
if [[ $node_index -gt 4 ]]; then
218+
219+
if [[ $node_index -ge 5 ]]; then
219220
JSON_RPC_OPTION="--json-rpc"
220-
REST_FUNC_OPTION="--rest-func"
221221
else
222222
JSON_RPC_OPTION=""
223+
fi
224+
if [[ $node_index -ge 5 ]] && [[ $node_index -lt 8 ]]; then
225+
REST_FUNC_OPTION="--rest-func"
226+
else
223227
REST_FUNC_OPTION=""
224228
fi
225229

deploy_blockchain_sandbox_gcp.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ $# -lt 3 ]] || [[ $# -gt 7 ]]; then
44
printf "Usage: bash deploy_blockchain_sandbox_gcp.sh <GCP Username> <# start node> <# end node> [--setup] [--keep-code|--no-keep-code] [--keep-data|--no-keep-data] [--kill-only|--skip-kill]\n"
5-
printf "Example: bash deploy_blockchain_sandbox_gcp.sh lia 10 99 --setup\n"
5+
printf "Example: bash deploy_blockchain_sandbox_gcp.sh my_username 10 99 --setup\n"
66
printf "\n"
77
exit
88
fi
@@ -411,11 +411,14 @@ printf "KEEP_DATA_OPTION=$KEEP_DATA_OPTION\n"
411411
node_index=$START_NODE_IDX
412412
while [ $node_index -le $END_NODE_IDX ]; do
413413
printf "\n\n##########################\n# Starting parent node $node_index #\n##########################\n\n"
414-
if [[ $node_index -gt 4 ]]; then
414+
if [[ $node_index -ge 5 ]]; then
415415
JSON_RPC_OPTION="--json-rpc"
416-
REST_FUNC_OPTION="--rest-func"
417416
else
418417
JSON_RPC_OPTION=""
418+
fi
419+
if [[ $node_index -ge 5 ]] && [[ $node_index -lt 8 ]]; then
420+
REST_FUNC_OPTION="--rest-func"
421+
else
419422
REST_FUNC_OPTION=""
420423
fi
421424
NODE_TARGET_ADDR=NODE_${node_index}_TARGET_ADDR

deploy_monitoring_gcp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if [[ "$#" -lt 2 ]]; then
44
printf "Usage: bash deploy_monitoring_gcp.sh [dev|staging|sandbox|spring|summer|mainnet] <GCP Username> [--setup]\n"
5-
printf "Example: bash deploy_monitoring_gcp.sh dev seo\n"
5+
printf "Example: bash deploy_monitoring_gcp.sh dev my_username\n"
66
printf "\n"
77
exit
88
fi

deploy_test_gcp.sh

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
#!/bin/bash
2+
3+
if [[ $# -lt 2 ]]; then
4+
printf "Usage: bash deploy_test_gcp.sh <GCP Username> <Instatnce Index> [--setup] [--keep-code|--no-keep-code] [--bg] [--cat-log] [--stop-only] <Testing Option>\n"
5+
printf "Example: bash deploy_test_gcp.sh my_username 0 --setup test_unit\n"
6+
printf "Example: bash deploy_test_gcp.sh my_username 0 --keep-code test_unit\n"
7+
printf "Example: bash deploy_test_gcp.sh my_username 0 --keep-code test_unit \"-g 'matchFunction NOT'\"\n"
8+
printf "Example: bash deploy_test_gcp.sh my_username 0 --keep-code --bg test_unit\n"
9+
printf "Example: bash deploy_test_gcp.sh my_username 0 --cat-log\n"
10+
printf "Example: bash deploy_test_gcp.sh my_username 0 --stop-only\n"
11+
printf "\n"
12+
exit
13+
fi
14+
printf "\n[[[[[ deploy_test_gcp.sh ]]]]]\n\n"
15+
16+
GCP_USER="$1"
17+
printf "GCP_USER=$GCP_USER\n"
18+
19+
number_re='^[0-9]+$'
20+
if ! [[ $2 =~ $number_re ]] ; then
21+
printf "Invalid <Instance Index> argument: $2\n"
22+
exit
23+
fi
24+
INSTANCE_INDEX=$2
25+
printf "INSTANCE_INDEX=$INSTANCE_INDEX\n"
26+
printf "\n"
27+
28+
function parse_options() {
29+
local option="$1"
30+
if [[ $option = '--setup' ]]; then
31+
SETUP_OPTION="$option"
32+
elif [[ $option = '--keep-code' ]]; then
33+
KEEP_CODE_OPTION="$option"
34+
elif [[ $option = '--no-keep-code' ]]; then
35+
KEEP_CODE_OPTION="$option"
36+
elif [[ $option = '--bg' ]]; then
37+
BACKGROUND_OPTION="$option"
38+
elif [[ $option = '--cat-log' ]]; then
39+
CAT_LOG_OPTION="$option"
40+
elif [[ $option = '--stop-only' ]]; then
41+
STOP_ONLY_OPTION="$option"
42+
else
43+
TESTING_OPTION="$TESTING_OPTION $option"
44+
fi
45+
}
46+
47+
# Parse options.
48+
SETUP_OPTION=""
49+
CAT_LOG_OPTION=""
50+
STOP_ONLY_OPTION=""
51+
KEEP_CODE_OPTION="--no-keep-code"
52+
BACKGROUND_OPTION=""
53+
TESTING_OPTION=""
54+
55+
ARG_INDEX=3
56+
while [ $ARG_INDEX -le $# ]; do
57+
parse_options "${!ARG_INDEX}"
58+
((ARG_INDEX++))
59+
done
60+
printf "SETUP_OPTION=$SETUP_OPTION\n"
61+
printf "CAT_LOG_OPTION=$CAT_LOG_OPTION\n"
62+
printf "STOP_ONLY_OPTION=$STOP_ONLY_OPTION\n"
63+
printf "KEEP_CODE_OPTION=$KEEP_CODE_OPTION\n"
64+
printf "BACKGROUND_OPTION=$BACKGROUND_OPTION\n"
65+
printf "TESTING_OPTION=$TESTING_OPTION\n"
66+
67+
if [[ $CAT_LOG_OPTION != "--cat-log" ]]; then
68+
# Get confirmation.
69+
printf "\n"
70+
read -p "Do you want to proceed for $SEASON? [y/N]: " -n 1 -r
71+
printf "\n\n"
72+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
73+
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
74+
fi
75+
fi
76+
77+
function stop_servers() {
78+
printf "\n* >> Stopping tests on instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
79+
STOP_CMD="cd ./ain-blockchain; . stop_servers_local.sh"
80+
printf "\nSTOP_CMD=$STOP_CMD\n\n"
81+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "$STOP_CMD" --project $PROJECT_ID --zone ${TEST_ZONE}
82+
}
83+
84+
# deploy files
85+
FILES_FOR_TEST="afan_client/ blockchain/ blockchain-configs/ block-pool/ client/ common/ consensus/ db/ event-handler/ json_rpc/ logger/ node/ p2p/ test/ tools/ tracker-server/ traffic/ tx-pool/ package.json setup_blockchain_ubuntu.sh stop_servers_local.sh"
86+
87+
printf "\n"
88+
SEASON="dev"
89+
printf "SEASON=$SEASON\n"
90+
91+
PROJECT_ID="testnet-dev-ground"
92+
printf "PROJECT_ID=$PROJECT_ID\n"
93+
94+
TEST_TARGET_ADDR="${GCP_USER}@${SEASON}-test-${INSTANCE_INDEX}"
95+
printf "TEST_TARGET_ADDR=$TEST_TARGET_ADDR\n"
96+
97+
TEST_ZONE="asia-east1-b"
98+
printf "TEST_ZONE=$TEST_ZONE\n"
99+
printf "\n"
100+
101+
# stop test servers and exit
102+
if [[ $STOP_ONLY_OPTION = "--stop-only" ]]; then
103+
stop_servers
104+
printf "\n"
105+
exit 0
106+
fi
107+
108+
# cat-log test log and exit
109+
if [[ $CAT_LOG_OPTION = "--cat-log" ]]; then
110+
printf "\n* >> Cat-logging test log from instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
111+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "cd ./ain-blockchain; cat test_log.txt" --project $PROJECT_ID --zone ${TEST_ZONE}
112+
printf "\n"
113+
exit 0
114+
fi
115+
# deploy files to GCP instances
116+
if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then
117+
printf "\n* >> Deploying files for instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
118+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "sudo rm -rf ~/ain-blockchain; mkdir ~/ain-blockchain" --project $PROJECT_ID --zone ${TEST_ZONE}
119+
gcloud compute scp --recurse $FILES_FOR_TEST ${TEST_TARGET_ADDR}:~/ain-blockchain/ --project $PROJECT_ID --zone ${TEST_ZONE}
120+
fi
121+
122+
# ssh into each instance, set up the ubuntu VM instance (ONLY NEEDED FOR THE FIRST TIME)
123+
if [[ $SETUP_OPTION = "--setup" ]]; then
124+
printf "\n* >> Setting up instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
125+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "cd ./ain-blockchain; . setup_blockchain_ubuntu.sh" --project $PROJECT_ID --zone ${TEST_ZONE}
126+
fi
127+
128+
if [[ $KEEP_CODE_OPTION = "--no-keep-code" ]]; then
129+
printf "\n* >> Installing node modules on instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
130+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "cd ./ain-blockchain; yarn install --ignore-engines" --project $PROJECT_ID --zone ${TEST_ZONE}
131+
fi
132+
133+
# stop test servers first
134+
stop_servers
135+
136+
printf "\n* >> Running tests on instance ${TEST_TARGET_ADDR} *********************************************************\n\n"
137+
if [[ $BACKGROUND_OPTION = "--bg" ]]; then
138+
TEST_CMD="cd ./ain-blockchain; nohup yarn run ${TESTING_OPTION} > test_log.txt &"
139+
else
140+
TEST_CMD="cd ./ain-blockchain; yarn run ${TESTING_OPTION}"
141+
fi
142+
printf "\nTEST_CMD=$TEST_CMD\n\n"
143+
gcloud compute ssh ${TEST_TARGET_ADDR} --command "$TEST_CMD" --project $PROJECT_ID --zone ${TEST_ZONE}

node/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,8 @@ class BlockchainNode {
496496
const availableTreeBytes = appStake > 0 ?
497497
Math.max(0, appsStateBudget * appStakeRatio - usage.tree_bytes) :
498498
Math.max(0, freeStateBudget - freeTierTreeBytes);
499-
// NOTE(platfowner): availableTreeSize is determined by availableTreeBytes.
499+
// NOTE(platfowner): availableTreeSize is just determined by availableTreeBytes
500+
// but we provide this for user's reference.
500501
const availableTreeSize = availableTreeBytes * maxStateTreeSizePerByte;
501502
const available = {
502503
tree_height: stateTreeHeightLimit,

0 commit comments

Comments
 (0)