Skip to content

Commit 0638959

Browse files
author
platfowner
authored
Merge pull request #1193 from ainblockchain/release/v1.1.0
Release/v1.1.0
2 parents 6ec7f92 + 9b33b82 commit 0638959

35 files changed

+1208
-235
lines changed

blockchain-configs/base/timer_flags.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,13 @@
4747
"update_min_gc_num_siblings_deleted": {
4848
"enabled_block": 2,
4949
"has_bandage": true
50+
},
51+
"update_min_gc_num_siblings_deleted2": {
52+
"enabled_block": 2,
53+
"has_bandage": true
54+
},
55+
"tweak_transfer_gc_rule": {
56+
"enabled_block": 2,
57+
"has_bandage": true
5058
}
5159
}

blockchain-configs/mainnet-prod/timer_flags.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@
4646
"update_min_gc_num_siblings_deleted": {
4747
"enabled_block": 1414800,
4848
"has_bandage": true
49+
},
50+
"update_min_gc_num_siblings_deleted2": {
51+
"enabled_block": 2430100,
52+
"has_bandage": true
53+
},
54+
"tweak_transfer_gc_rule": {
55+
"enabled_block": 2430100,
56+
"has_bandage": true
4957
}
5058
}

blockchain-configs/testnet-dev/timer_flags.json

Lines changed: 0 additions & 50 deletions
This file was deleted.

blockchain-configs/testnet-prod/timer_flags.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,13 @@
5050
"update_min_gc_num_siblings_deleted": {
5151
"enabled_block": 1411300,
5252
"has_bandage": true
53+
},
54+
"update_min_gc_num_siblings_deleted2": {
55+
"enabled_block": 2429500,
56+
"has_bandage": true
57+
},
58+
"tweak_transfer_gc_rule": {
59+
"enabled_block": 2429500,
60+
"has_bandage": true
5361
}
5462
}

client/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ app.get('/get_config', (req, res) => {
673673
/**
674674
* Dev Client SET APIs (available to whitelisted IPs, if ENABLE_DEV_CLIENT_SET_API == true)
675675
*/
676-
676+
// TODO(platfowner): Deprecate Dev Client SET APIs once the related test cases are migrated to
677+
// json rpc APIs.
677678
if (NodeConfigs.ENABLE_DEV_CLIENT_SET_API) {
678679
app.post('/set_value', (req, res, next) => {
679680
const beginTime = Date.now();

client/protocol_versions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,8 @@
122122
},
123123
"1.0.15": {
124124
"min": "1.0.0"
125+
},
126+
"1.1.0": {
127+
"min": "1.0.0"
125128
}
126129
}

common/common-util.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ class CommonUtil {
551551
// TODO(platfowner): Consider some code (e.g. IN_LOCKUP_PERIOD, INSUFFICIENT_BALANCE) no failure
552552
// so that their transactions are not reverted.
553553
static isFailedFuncResultCode(code) {
554-
return code !== FunctionResultCode.SUCCESS;
554+
return code !== FunctionResultCode.SUCCESS && code !== FunctionResultCode.SKIP;
555555
}
556556

557557
static isAppPath(parsedPath) {
@@ -1057,15 +1057,19 @@ class CommonUtil {
10571057
static createTimerFlagEnabledBandageMap(timerFlags) {
10581058
const LOG_HEADER = 'createTimerFlagEnabledBandageMap';
10591059
const map = new Map();
1060-
console.log(`[${LOG_HEADER}] Registering bandage files:`);
1060+
if (process.env.LOG_BANDAGE_INFO) {
1061+
console.log(`[${LOG_HEADER}] Registering bandage files:`);
1062+
}
10611063
const flagNameList = Object.keys(timerFlags);
10621064
for (let i = 0; i < flagNameList.length; i++) {
10631065
const flagName = flagNameList[i];
10641066
const flag = timerFlags[flagName];
10651067
const enabledBlockNumber = CommonUtil.getEnabledBlockNumberFromTimerFlag(flag);
10661068
if (CommonUtil.isNumber(enabledBlockNumber) && flag['has_bandage'] === true) {
10671069
const bandageFilePath = path.resolve(__dirname, '../db/bandage-files', `${flagName}.js`);
1068-
console.log(`[${LOG_HEADER}] [${i}] Registering ${bandageFilePath}`);
1070+
if (process.env.LOG_BANDAGE_INFO) {
1071+
console.log(`[${LOG_HEADER}] [${i}] Registering ${bandageFilePath}`);
1072+
}
10691073
if (!fs.existsSync(bandageFilePath)) {
10701074
throw Error(`Missing bandage file: ${bandageFilePath}`);
10711075
}
@@ -1074,7 +1078,9 @@ class CommonUtil {
10741078
}
10751079
map.get(enabledBlockNumber).push(flagName);
10761080
} else {
1077-
console.log(`[${LOG_HEADER}] [${i}] Skipping for timer flag: ${flagName}`);
1081+
if (process.env.LOG_BANDAGE_INFO) {
1082+
console.log(`[${LOG_HEADER}] [${i}] Skipping for timer flag: ${flagName}`);
1083+
}
10781084
}
10791085
}
10801086
return map;

common/constants.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,18 @@ function setNodeConfigs() {
116116
NodeConfigs[param] = valFromNodeParams;
117117
}
118118
}
119-
if (!fs.existsSync(NodeConfigs.BLOCKCHAIN_DATA_DIR)) {
119+
const blockchainDataDirPath = path.resolve(__dirname, '..', NodeConfigs.BLOCKCHAIN_DATA_DIR);
120+
if (!fs.existsSync(blockchainDataDirPath)) {
120121
try {
121-
fs.mkdirSync(NodeConfigs.BLOCKCHAIN_DATA_DIR, { recursive: true });
122+
fs.mkdirSync(blockchainDataDirPath, { recursive: true });
122123
} catch (e) {
123124
console.log(e)
124125
}
125126
}
126-
NodeConfigs.LOGS_DIR = path.resolve(NodeConfigs.BLOCKCHAIN_DATA_DIR, 'logs');
127-
NodeConfigs.CHAINS_DIR = path.resolve(NodeConfigs.BLOCKCHAIN_DATA_DIR, 'chains');
128-
NodeConfigs.SNAPSHOTS_ROOT_DIR = path.resolve(NodeConfigs.BLOCKCHAIN_DATA_DIR, 'snapshots');
129-
NodeConfigs.KEYS_ROOT_DIR = path.resolve(NodeConfigs.BLOCKCHAIN_DATA_DIR, 'keys');
127+
NodeConfigs.LOGS_DIR = path.resolve(blockchainDataDirPath, 'logs');
128+
NodeConfigs.CHAINS_DIR = path.resolve(blockchainDataDirPath, 'chains');
129+
NodeConfigs.SNAPSHOTS_ROOT_DIR = path.resolve(blockchainDataDirPath, 'snapshots');
130+
NodeConfigs.KEYS_ROOT_DIR = path.resolve(blockchainDataDirPath, 'keys');
130131
}
131132
setNodeConfigs();
132133

common/result-code.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const FailedTxPrecheckCodeSet = new Set([
126126
// If they are altered and deployed, the full sync of the blockchain nodes can fail.
127127
const FunctionResultCode = {
128128
SUCCESS: 0,
129+
SKIP: 20000, // Normal skip
129130
FAILURE: 20001, // Normal failure
130131
INTERNAL_ERROR: 20002, // Something went wrong but don't know why
131132
// Transfer

db/bandage-files/allow_non_negative_transfer_value_only.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
"write": "(auth.addr === $from || auth.fid === '_stake' || auth.fid === '_unstake' || auth.fid === '_pay' || auth.fid === '_claim' || auth.fid === '_hold' || auth.fid === '_release' || auth.fid === '_collectFee' || auth.fid === '_claimReward' || auth.fid === '_openCheckout' || auth.fid === '_closeCheckout' || auth.fid === '_closeCheckin') && !getValue('transfer/' + $from + '/' + $to + '/' + $key) && (util.isServAcntName($from, blockNumber) || util.isCksumAddr($from)) && (util.isServAcntName($to, blockNumber) || util.isCksumAddr($to)) && $from !== $to && util.isNumber(newData) && newData > 0 && util.getBalance($from, getValue) >= newData"
88
}
99
},
10-
// From allow_lower_case_app_names_only bandage file.
10+
// From allow_lower_case_app_names_only.js bandage file.
1111
prevValue: {
1212
".rule": {
1313
"write": "(auth.addr === $from || auth.fid === '_stake' || auth.fid === '_unstake' || auth.fid === '_pay' || auth.fid === '_claim' || auth.fid === '_hold' || auth.fid === '_release' || auth.fid === '_collectFee' || auth.fid === '_claimReward' || auth.fid === '_openCheckout' || auth.fid === '_closeCheckout' || auth.fid === '_closeCheckin') && !getValue('transfer/' + $from + '/' + $to + '/' + $key) && (util.isServAcntName($from, blockNumber) || util.isCksumAddr($from)) && (util.isServAcntName($to, blockNumber) || util.isCksumAddr($to)) && $from !== $to && util.isNumber(newData) && util.getBalance($from, getValue) >= newData"

0 commit comments

Comments
 (0)