Skip to content

Commit

Permalink
Merge pull request #866 from ainblockchain/release/v1.0.1
Browse files Browse the repository at this point in the history
Release/v1.0.1
  • Loading branch information
minsulee2 committed Jan 2, 2022
2 parents ad872a6 + 58e8264 commit 0671e98
Show file tree
Hide file tree
Showing 59 changed files with 1,550 additions and 262 deletions.
6 changes: 4 additions & 2 deletions blockchain-configs/1-node/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 1000,
"chain_id": 0,
Expand Down Expand Up @@ -78,7 +78,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 1500,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/1-node/genesis_block.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions blockchain-configs/2-nodes/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 1000,
"chain_id": 0,
Expand Down Expand Up @@ -84,7 +84,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/2-nodes/genesis_block.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions blockchain-configs/3-nodes/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 1000,
"chain_id": 0,
Expand Down Expand Up @@ -92,7 +92,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/3-nodes/genesis_block.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions blockchain-configs/afan-shard/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"genesis": {
"genesis_addr": "0xBBB2219cD5eACc54Ce95deF7a67dDe71C8241891",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 3000,
"chain_id": 0,
Expand Down Expand Up @@ -90,7 +90,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/afan-shard/genesis_block.json.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions blockchain-configs/base/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 20000,
"chain_id": 0,
Expand Down Expand Up @@ -90,7 +90,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/base/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/base/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/he-shard/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"genesis": {
"genesis_addr": "0xBBB2219cD5eACc54Ce95deF7a67dDe71C8241891",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 3000,
"chain_id": 0,
Expand Down Expand Up @@ -90,7 +90,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/he-shard/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/he-shard/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/mainnet-prod/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"genesis": {
"genesis_addr": "0xCCCC7809e28DE89BE2AfeFbaa25f1Cee04C4f7a2",
"genesis_timestamp": 1640736000000,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 20000,
"chain_id": 1,
Expand Down Expand Up @@ -106,7 +106,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/mainnet-prod/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/mainnet-prod/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/sim-shard/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"genesis": {
"genesis_addr": "0xB0B0d133E6a82A982396Fa7E4B4F9eC85d1DFBF4",
"genesis_timestamp": 1603090467225,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 3000,
"chain_id": 0,
Expand Down Expand Up @@ -90,7 +90,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 1
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/sim-shard/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/sim-shard/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/testnet-dev/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 20000,
"chain_id": 0,
Expand Down Expand Up @@ -107,7 +107,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/testnet-dev/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/testnet-dev/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/testnet-prod/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"genesis": {
"genesis_addr": "0xAAAAeEDFf1d2cD909465182165ccc267549554Fc",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 20000,
"chain_id": 0,
Expand Down Expand Up @@ -107,7 +107,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/testnet-prod/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/testnet-prod/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/testnet-sandbox/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 100,
"epoch_ms": 20000,
"chain_id": 0,
Expand Down Expand Up @@ -117,7 +117,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/testnet-sandbox/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/testnet-sandbox/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
6 changes: 4 additions & 2 deletions blockchain-configs/testnet-staging/blockchain_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"genesis": {
"genesis_addr": "0xAAAf6f50A0304F12119D218b94bea8082642515B",
"genesis_timestamp": 1571819318272,
"genesis_timestamp": 1640995199999,
"num_genesis_accounts": 10,
"epoch_ms": 20000,
"chain_id": 0,
Expand Down Expand Up @@ -107,7 +107,9 @@
"tx_bytes_limit": 10000,
"batch_tx_list_size_limit": 50,
"set_op_list_size_limit": 50,
"min_gc_num_siblings_deleted": 100
"min_gc_num_siblings_deleted": 100,
"snapshot_chunk_size": 1000000,
"min_gas_price": 500
},
"reward": {
"type": "FIXED",
Expand Down
Binary file modified blockchain-configs/testnet-staging/genesis_block.json.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion blockchain-configs/testnet-staging/node_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"KEYSTORE_FILE_PATH": null,
"LIGHTWEIGHT": false,
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
"MAX_NUM_INBOUND_CONNECTION": 5,
"MAX_NUM_INBOUND_CONNECTION": 6,
"MAX_NUM_SNAPSHOTS": 10,
"ON_MEMORY_CHAIN_LENGTH": 10,
"P2P_HEARTBEAT_INTERVAL_MS": 15000,
Expand Down
15 changes: 7 additions & 8 deletions blockchain/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const {
NodeConfigs,
BlockchainSnapshotProperties,
} = require('../common/constants');
const { ConsensusConsts } = require('../consensus/constants');
const CommonUtil = require('../common/common-util');

class Blockchain {
Expand All @@ -24,7 +23,7 @@ class Blockchain {

setGenesisBlock() {
const genesisBlockPath = path.join(NodeConfigs.GENESIS_BLOCK_DIR, 'genesis_block.json.gz');
const block = Block.parse(FileUtil.readCompressedJson(genesisBlockPath));
const block = Block.parse(FileUtil.readCompressedJsonSync(genesisBlockPath));
if (!block) {
throw Error(`Missing genesis block at ${genesisBlockPath}`);
}
Expand Down Expand Up @@ -96,7 +95,7 @@ class Blockchain {
if (!blockPath) {
return this.chain.find((block) => block.hash === hash);
} else {
return Block.parse(FileUtil.readCompressedJson(blockPath));
return Block.parse(FileUtil.readCompressedJsonSync(blockPath));
}
}

Expand All @@ -115,7 +114,7 @@ class Blockchain {
if (!blockPath || blockNumber > this.lastBlockNumber() - NodeConfigs.ON_MEMORY_CHAIN_LENGTH) {
return this.chain.find((block) => block.number === blockNumber);
} else {
return Block.parse(FileUtil.readCompressedJson(blockPath));
return Block.parse(FileUtil.readCompressedJsonSync(blockPath));
}
}

Expand Down Expand Up @@ -278,7 +277,7 @@ class Blockchain {
if (!fs.existsSync(blockPath)) {
return null;
}
return Block.parse(FileUtil.readCompressedJson(blockPath));
return Block.parse(FileUtil.readCompressedJsonSync(blockPath));
}

/**
Expand Down Expand Up @@ -310,9 +309,9 @@ class Blockchain {
to = from + NodeConfigs.CHAIN_SEGMENT_LENGTH;
}
const blockPaths = FileUtil.getBlockPathList(this.blockchainPath, from, to - from);
blockPaths.forEach((blockPath) => {
blockList.push(Block.parse(FileUtil.readCompressedJson(blockPath)));
});
for (const blockPath of blockPaths) {
blockList.push(Block.parse(FileUtil.readCompressedJsonSync(blockPath)));
}
return blockList;
}
}
Expand Down
3 changes: 3 additions & 0 deletions client/protocol_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,8 @@
},
"1.0.0": {
"min": "1.0.0"
},
"1.0.1": {
"min": "1.0.0"
}
}
Loading

0 comments on commit 0671e98

Please sign in to comment.