Skip to content

Commit ee604d7

Browse files
authored
Merge pull request #1034 from ainblockchain/release/v1.0.7
Release/v1.0.7
2 parents 5fb134b + df77824 commit ee604d7

File tree

83 files changed

+3887
-2119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3887
-2119
lines changed

.github/workflows/github-actions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'develop'
7777
runs-on: ubuntu-latest
7878
steps:
79-
- uses: google-github-actions/setup-gcloud@master
79+
- uses: google-github-actions/setup-gcloud@v0
8080
with:
8181
service_account_key: ${{ secrets.PERF_TEST_PIPELINE_GCP_SA_KEY }}
8282
project_id: ${{ secrets.PERF_TEST_PIPELINE_GCP_PROJECT_ID }}

Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM node:10.14
2-
WORKDIR /app
3-
COPY package.json /app
4-
RUN npm install
5-
COPY . /app
1+
FROM node:16.14
2+
WORKDIR /app/ain-blockchain
3+
COPY . /app/ain-blockchain
4+
RUN yarn install
65
EXPOSE 8080 5000
7-
CMD node client/index.js
6+
ARG SEASON
7+
ENV SEASON=$SEASON
8+
ENTRYPOINT bash ./start_node_docker.sh

README.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ yarn install
106106
```
107107
- Run blockchain nodes
108108
```
109-
ACCOUNT_INJECTION_OPTION=keystore KEYSTORE_FILE_PATH=/path/to/keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
110-
ACCOUNT_INJECTION_OPTION=keystore KEYSTORE_FILE_PATH=/path/to/keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
111-
ACCOUNT_INJECTION_OPTION=keystore KEYSTORE_FILE_PATH=/path/to/keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
109+
ACCOUNT_INJECTION_OPTION=keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
110+
ACCOUNT_INJECTION_OPTION=keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
111+
ACCOUNT_INJECTION_OPTION=keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
112112
```
113113
You can override default port numbering system by setting `PORT` and `P2P_PORT` environment variables.
114114
Before starting node jobs, remove existing blockchain files and logs if necessary:
@@ -121,7 +121,7 @@ The default minimum size of the validator whitelist is 3. Change MIN_NUM_VALIDAT
121121
the blockchain-configs/base/genesis.json to change this value. You may also need to modify the GENESIS_WHITELIST and GENESIS_VALIDATORS accordingly.
122122
The genesis configs directory used is `blockchain-configs/base` by default and it can be altered using `BLOCKCHAIN_CONFIGS_DIR` env variable. For example, afan shard cluster can use the following command line:
123123
```
124-
BLOCKCHAIN_CONFIGS_DIR=blockchain-configs/afan-shard MIN_NUM_VALIDATORS=1 ACCOUNT_INJECTION_OPTION=keystore KEYSTORE_FILE_PATH=/path/to/keystore DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
124+
BLOCKCHAIN_CONFIGS_DIR=blockchain-configs/afan-shard MIN_NUM_VALIDATORS=1 DEBUG=false STAKE=100000 CONSOLE_LOG=true ENABLE_GAS_FEE_WORKAROUND=true node client/index.js
125125
```
126126

127127
#### On Google Cloud Platform (GCP)
@@ -148,22 +148,43 @@ source setup_node_gcp.sh
148148
bash start_node_genesis_gcp.sh {dev|spring|summer} <SHARD_INDEX> <SERVER_INDEX>
149149
```
150150

151-
<!--
152151
### Running with Docker
153152

154-
- Build Docker image
153+
- Pull Docker image from [Docker Hub](https://hub.docker.com/repository/docker/ainblockchain/ain-blockchain)
155154
```
156-
docker build -t ain-blockchain .
155+
docker pull ainblockchain/ain-blockchain:dev
156+
docker pull ainblockchain/ain-blockchain:dev-1.0.6
157+
docker pull ainblockchain/ain-blockchain:{mainnet|summer|spring|sandbox|staging|exp|dev}-<PACKAGE_VERSION>
157158
```
158-
- Pull Docker image
159+
- Or build Docker image yourself
159160
```
160-
docker pull ainblockchain/blockchain-database
161+
docker build -t ain-blockchain --build-arg SEASON={mainnet|summer|spring|sandbox|staging|exp|dev} .
161162
```
162-
- Run with Docker image
163+
- Run with Docker image example
164+
```
165+
docker run -e ACCOUNT_INJECTION_OPTION=private_key -e SYNC_MODE=peer -e STAKE=10000 --network="host" -d ainblockchain/ain-blockchain:dev
166+
docker run -e ACCOUNT_INJECTION_OPTION=keystore -e SYNC_MODE=peer -e STAKE=10000 --network="host" -d ainblockchain/ain-blockchain:mainnet
167+
```
168+
You can use some environment variables, and these have the following options.
163169
```
164-
docker run -e ACCOUNT_INJECTION_OPTION=keystore KEYSTORE_FILE_PATH=/path/to/keystore --network="host" -d ainblockchain/ain-blockchain:latest
170+
-e ACCOUNT_INJECTION_OPTION={private_key|keystore|mnemonic}
171+
-e SYNC_MODE={fast|full|peer}
172+
-e STAKE=<YOUR_TARGET_STAKE>
173+
```
174+
After the node is executed, you should inject your account into the node.
175+
```
176+
node inject_account_gcp.js <NODE_ENDPOINT_URL> --private-key
177+
node inject_account_gcp.js <NODE_ENDPOINT_URL> --keystore
178+
node inject_account_gcp.js <NODE_ENDPOINT_URL> --mnemonic
179+
```
180+
If you want to inject your account automatically, add one of these environment variables before running the node.
181+
```
182+
-e ACCOUNT_INJECTION_OPTION=private_key -e PRIVATE_KEY=<YOUR_PRIVATE_KEY>
183+
-e ACCOUNT_INJECTION_OPTION=keystore -e KEYSTORE_FILE_PATH="/path/to/keystore" -e PASSWORD=<YOUR_PASSWORD>
184+
-e ACCOUNT_INJECTION_OPTION=mnemonic -e MNEMONIC="your mnemonic"
165185
```
166186

187+
<!--
167188
#### Enter Docker container and inspect blockchain files
168189
169190
```
@@ -308,13 +329,13 @@ POST http://<ip_address>:8080/batch with json_body {"tx_list": [{"operation": {"
308329

309330
## Utility scripts
310331

311-
Four Node server with a Tracker server can be started all at once using `start_servers.sh` like:
332+
Four Node server with a Tracker server can be started all at once using `start_local_blockchain.sh` like:
312333
```
313-
bash start_servers.sh
334+
bash start_local_blockchain.sh
314335
```
315-
and can be stopped all at once using `stop_servers.sh` like:
336+
and can be stopped all at once using `stop_local_blockchain.sh` like:
316337
```
317-
bash stop_servers.sh
338+
bash stop_local_blockchain.sh
318339
```
319340

320341
## Versions

block-pool/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ class BlockPool {
591591
* @param {DB} baseDb The DB instance should be the base of where evidence votes should be executed on.
592592
* @returns { offenses, evidence }
593593
*/
594-
getOffensesAndEvidence(validators, recordedInvalidBlockHashSet, blockNumber, blockTime, baseDb) {
594+
getOffensesAndEvidence(validators, recordedInvalidBlockHashSet, blockNumber, blockTime, baseDb, eventSource) {
595595
const LOG_HEADER = 'getOffensesAndEvidence';
596596
const totalAtStake = ConsensusUtil.getTotalAtStake(validators);
597597
const baseBlockNumber = baseDb.blockNumberSnapshot;
@@ -620,7 +620,7 @@ class BlockPool {
620620
const stake = _get(validators, `${vote.address}.stake`, 0);
621621
if (stake > 0) {
622622
const res = baseDb.executeTransaction(
623-
Transaction.toExecutable(vote, chainId), true, true, blockNumber, blockTime);
623+
Transaction.toExecutable(vote, chainId), true, true, blockNumber, blockTime, eventSource);
624624
if (CommonUtil.isFailedTx(res)) {
625625
logger.debug(`[${LOG_HEADER}] Failed to execute evidence vote:\n${JSON.stringify(vote, null, 2)}\n${JSON.stringify(res, null, 2)})`);
626626
} else {

blockchain-configs/afan-shard/node_params.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"DEV_CLIENT_API_IP_WHITELIST": "*",
2121
"DEFAULT_AXIOS_REQUEST_TIMEOUT": 20000,
2222
"ENABLE_DEV_CLIENT_SET_API": true,
23+
"ENABLE_EARLY_TX_SIG_VERIF": true,
2324
"ENABLE_EVENT_HANDLER": false,
2425
"ENABLE_EXPRESS_RATE_LIMIT": true,
2526
"ENABLE_GAS_FEE_WORKAROUND": true,
@@ -29,13 +30,17 @@
2930
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
3031
"EVENT_HANDLER_PORT": 6000,
3132
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
33+
"FREE_TX_POOL_SIZE_LIMIT_RATIO": 0.1,
34+
"FREE_TX_POOL_SIZE_LIMIT_RATIO_PER_ACCOUNT": 0.1,
3235
"GET_OP_LIST_SIZE_LIMIT": 50,
3336
"GET_RESP_BYTES_LIMIT": 200000000,
3437
"GET_RESP_MAX_SIBLINGS": 50000,
3538
"HOSTING_ENV": "local",
36-
"KEYSTORE_FILE_PATH": null,
3739
"LIGHTWEIGHT": false,
3840
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
41+
"MAX_NUM_EVENT_CHANNELS": 10,
42+
"MAX_NUM_EVENT_FILTERS": 20,
43+
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
3944
"MAX_NUM_INBOUND_CONNECTION": 3,
4045
"MAX_NUM_SNAPSHOTS": 10,
4146
"OLD_CHAIN_SEGMENT_LENGTH": 20,
@@ -71,5 +76,6 @@
7176
"TX_POOL_SIZE_LIMIT_PER_ACCOUNT": 100,
7277
"TX_POOL_TIMEOUT_MS": 3600000,
7378
"TX_TRACKER_TIMEOUT_MS": 86400000,
74-
"UNSAFE_PRIVATE_KEY": null
79+
"UNSAFE_PRIVATE_KEY": null,
80+
"UPDATE_NEW_FINAL_FRONT_DB_WITH_TX_POOL": true
7581
}

blockchain-configs/base/node_params.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"DEV_CLIENT_API_IP_WHITELIST": "*",
2121
"DEFAULT_AXIOS_REQUEST_TIMEOUT": 20000,
2222
"ENABLE_DEV_CLIENT_SET_API": true,
23+
"ENABLE_EARLY_TX_SIG_VERIF": true,
2324
"ENABLE_EVENT_HANDLER": false,
2425
"ENABLE_EXPRESS_RATE_LIMIT": true,
2526
"ENABLE_GAS_FEE_WORKAROUND": true,
@@ -29,13 +30,17 @@
2930
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
3031
"EVENT_HANDLER_PORT": 6000,
3132
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
33+
"FREE_TX_POOL_SIZE_LIMIT_RATIO": 0.1,
34+
"FREE_TX_POOL_SIZE_LIMIT_RATIO_PER_ACCOUNT": 0.1,
3235
"GET_OP_LIST_SIZE_LIMIT": 50,
3336
"GET_RESP_BYTES_LIMIT": 200000000,
3437
"GET_RESP_MAX_SIBLINGS": 50000,
3538
"HOSTING_ENV": "local",
36-
"KEYSTORE_FILE_PATH": null,
3739
"LIGHTWEIGHT": false,
3840
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
41+
"MAX_NUM_EVENT_CHANNELS": 10,
42+
"MAX_NUM_EVENT_FILTERS": 20,
43+
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
3944
"MAX_NUM_INBOUND_CONNECTION": 6,
4045
"MAX_NUM_SNAPSHOTS": 10,
4146
"OLD_CHAIN_SEGMENT_LENGTH": 20,
@@ -71,5 +76,6 @@
7176
"TX_POOL_SIZE_LIMIT_PER_ACCOUNT": 100,
7277
"TX_POOL_TIMEOUT_MS": 3600000,
7378
"TX_TRACKER_TIMEOUT_MS": 86400000,
74-
"UNSAFE_PRIVATE_KEY": null
79+
"UNSAFE_PRIVATE_KEY": null,
80+
"UPDATE_NEW_FINAL_FRONT_DB_WITH_TX_POOL": true
7581
}

blockchain-configs/base/timer_flags.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,13 @@
3131
"enabled_block": 2,
3232
"has_bandage": false,
3333
"_note": "Remove this flag or set disabled_block to 2 if you need to run with the tx receipt recording feature"
34+
},
35+
"extend_account_registration_gas_amount": {
36+
"enabled_block": 2,
37+
"has_bandage": false
38+
},
39+
"add_app_creation_gas_amount": {
40+
"enabled_block": 2,
41+
"has_bandage": true
3442
}
3543
}

blockchain-configs/he-shard/node_params.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"DEV_CLIENT_API_IP_WHITELIST": "*",
2121
"DEFAULT_AXIOS_REQUEST_TIMEOUT": 20000,
2222
"ENABLE_DEV_CLIENT_SET_API": true,
23+
"ENABLE_EARLY_TX_SIG_VERIF": true,
2324
"ENABLE_EVENT_HANDLER": false,
2425
"ENABLE_EXPRESS_RATE_LIMIT": true,
2526
"ENABLE_GAS_FEE_WORKAROUND": true,
@@ -29,13 +30,17 @@
2930
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
3031
"EVENT_HANDLER_PORT": 6000,
3132
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
33+
"FREE_TX_POOL_SIZE_LIMIT_RATIO": 0.1,
34+
"FREE_TX_POOL_SIZE_LIMIT_RATIO_PER_ACCOUNT": 0.1,
3235
"GET_OP_LIST_SIZE_LIMIT": 50,
3336
"GET_RESP_BYTES_LIMIT": 200000000,
3437
"GET_RESP_MAX_SIBLINGS": 50000,
3538
"HOSTING_ENV": "local",
36-
"KEYSTORE_FILE_PATH": null,
3739
"LIGHTWEIGHT": false,
3840
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
41+
"MAX_NUM_EVENT_CHANNELS": 10,
42+
"MAX_NUM_EVENT_FILTERS": 20,
43+
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
3944
"MAX_NUM_INBOUND_CONNECTION": 6,
4045
"MAX_NUM_SNAPSHOTS": 10,
4146
"OLD_CHAIN_SEGMENT_LENGTH": 20,
@@ -71,5 +76,6 @@
7176
"TX_POOL_SIZE_LIMIT_PER_ACCOUNT": 100,
7277
"TX_POOL_TIMEOUT_MS": 3600000,
7378
"TX_TRACKER_TIMEOUT_MS": 86400000,
74-
"UNSAFE_PRIVATE_KEY": null
79+
"UNSAFE_PRIVATE_KEY": null,
80+
"UPDATE_NEW_FINAL_FRONT_DB_WITH_TX_POOL": true
7581
}

blockchain-configs/mainnet-prod/node_params.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"DEV_CLIENT_API_IP_WHITELIST": [],
2020
"DEFAULT_AXIOS_REQUEST_TIMEOUT": 20000,
2121
"ENABLE_DEV_CLIENT_SET_API": false,
22+
"ENABLE_EARLY_TX_SIG_VERIF": true,
2223
"ENABLE_EVENT_HANDLER": false,
2324
"ENABLE_EXPRESS_RATE_LIMIT": true,
2425
"ENABLE_GAS_FEE_WORKAROUND": true,
@@ -28,13 +29,17 @@
2829
"ENABLE_TX_SIG_VERIF_WORKAROUND": false,
2930
"EVENT_HANDLER_PORT": 6000,
3031
"EVENT_HANDLER_HEARTBEAT_INTERVAL_MS": 15000,
32+
"FREE_TX_POOL_SIZE_LIMIT_RATIO": 0.1,
33+
"FREE_TX_POOL_SIZE_LIMIT_RATIO_PER_ACCOUNT": 0.1,
3134
"GET_OP_LIST_SIZE_LIMIT": 50,
3235
"GET_RESP_BYTES_LIMIT": 200000000,
3336
"GET_RESP_MAX_SIBLINGS": 50000,
3437
"HOSTING_ENV": "gcp",
35-
"KEYSTORE_FILE_PATH": null,
3638
"LIGHTWEIGHT": false,
3739
"MAX_FINALIZED_BLOCK_INFO_ON_MEM": 1000,
40+
"MAX_NUM_EVENT_CHANNELS": 10,
41+
"MAX_NUM_EVENT_FILTERS": 20,
42+
"MAX_NUM_EVENT_FILTERS_PER_CHANNEL": 5,
3843
"MAX_NUM_INBOUND_CONNECTION": 6,
3944
"MAX_NUM_SNAPSHOTS": 10,
4045
"OLD_CHAIN_SEGMENT_LENGTH": 20,
@@ -70,5 +75,6 @@
7075
"TX_POOL_SIZE_LIMIT_PER_ACCOUNT": 100,
7176
"TX_POOL_TIMEOUT_MS": 3600000,
7277
"TX_TRACKER_TIMEOUT_MS": 86400000,
73-
"UNSAFE_PRIVATE_KEY": null
78+
"UNSAFE_PRIVATE_KEY": null,
79+
"UPDATE_NEW_FINAL_FRONT_DB_WITH_TX_POOL": true
7480
}

blockchain-configs/mainnet-prod/timer_flags.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,13 @@
3030
"disable_tx_receipt_recording": {
3131
"enabled_block": 352000,
3232
"has_bandage": false
33+
},
34+
"extend_account_registration_gas_amount": {
35+
"enabled_block": 584000,
36+
"has_bandage": false
37+
},
38+
"add_app_creation_gas_amount": {
39+
"enabled_block": 584000,
40+
"has_bandage": true
3341
}
3442
}

0 commit comments

Comments
 (0)