Skip to content

Commit 29c49c8

Browse files
author
Seulgi Kim
authored
Merge branch 'master' into fix/uncleared-memory
2 parents 134c094 + d471768 commit 29c49c8

File tree

45 files changed

+2891
-859
lines changed

Some content is hidden

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

45 files changed

+2891
-859
lines changed

.mergify.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pull_request_rules:
55
- "#review-requested=0"
66
- "#changes-requested-reviews-by=0"
77
- status-success=continuous-integration/travis-ci/pr
8-
- status-success=clahub
98
- base=master
109
- label!=do-not-merge
1110
- "- title~=\\b(wip|WIP)\\b"

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,5 @@ cargo +nightly-2019-05-17 clippy --all --all-targets
167167
168168
Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run with: `cargo test --all`. For more details, please reference [Unit Tests](https://github.com/CodeChain-io/codechain/wiki/Unit-Tests).
169169
170-
## User Manual
171-
172-
Under `docs` folder, run following command.
173-
```sh
174-
make html
175-
```
176-
User manual will be generated at `docs/_build/html`.
177-
178170
## License
179171
CodeChain is licensed under the AGPL License - see the [LICENSE](https://github.com/CodeChain-io/codechain/blob/master/LICENSE) file for details

codechain/config/chain_type.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub enum ChainType {
3434
Husky,
3535
Saluki,
3636
Corgi,
37+
Beagle,
3738
Custom(String),
3839
}
3940

@@ -57,6 +58,7 @@ impl FromStr for ChainType {
5758
"husky" => ChainType::Husky,
5859
"saluki" => ChainType::Saluki,
5960
"corgi" => ChainType::Corgi,
61+
"beagle" => ChainType::Beagle,
6062
other => ChainType::Custom(other.into()),
6163
};
6264
Ok(scheme)
@@ -75,6 +77,7 @@ impl fmt::Display for ChainType {
7577
ChainType::Husky => "husky",
7678
ChainType::Saluki => "saluki",
7779
ChainType::Corgi => "corgi",
80+
ChainType::Beagle => "beagle",
7881
ChainType::Custom(custom) => custom,
7982
})
8083
}
@@ -92,6 +95,7 @@ impl ChainType {
9295
ChainType::Husky => Ok(Scheme::new_husky()),
9396
ChainType::Saluki => Ok(Scheme::new_saluki()),
9497
ChainType::Corgi => Ok(Scheme::new_corgi()),
98+
ChainType::Beagle => Ok(Scheme::new_beagle()),
9599
ChainType::Custom(filename) => {
96100
let file = fs::File::open(filename)
97101
.map_err(|e| format!("Could not load specification file at {}: {}", filename, e))?;

codechain/run_node.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,15 @@ pub fn run_node(matches: &ArgMatches) -> Result<(), String> {
240240
);
241241
let email_alarm = if !config.email_alarm.disable.unwrap() {
242242
let config = match (&config.email_alarm.to, &config.email_alarm.sendgrid_key) {
243-
(Some(to), Some(sendgrid_key)) => Some(EmailAlarmConfig::new(to.to_string(), sendgrid_key.to_string())),
243+
(Some(to), Some(sendgrid_key)) => Some(EmailAlarmConfig::new(
244+
to.to_string(),
245+
sendgrid_key.to_string(),
246+
scheme.genesis_params().network_id().to_string(),
247+
)),
244248
(None, _) => return Err("email-alarm-to is not specified".to_string()),
245249
(_, None) => return Err("email-alarm-sendgrid-key is not specified".to_string()),
246250
};
247-
config.as_ref().map(EmailAlarm::new)
251+
config.map(EmailAlarm::new)
248252
} else {
249253
None
250254
};

core/res/beagle.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"name": "Beagle",
3+
"engine": {
4+
"tendermint": {
5+
"params": {
6+
"blockReward": "0x0",
7+
"validators": [
8+
"0x6043db3a371245b7d38fcfad955c18b73f271d83c92af4021a2a5ffd8ea338b2d3976b5951375695ad4ca856bdb3da317e8e95e694a1d184313d53545452ec80",
9+
"0xd6a39b0d5edb6fa2e0811f8b6b98d4f3c21fde32d9c2c77a46fa65c7e15ddcbae4b9452e2c3e12b6730c68582baaad4d9cea2a732651937ec60480bc4c0d70df",
10+
"0xe0531a6eb7c2f94cf11a717c705d43f2a43fdfe3ab7acafd3eba266991c9b7e0365679a344b8d9206c89f84d524252786b2dbc3d6926da9af0f4afc1fe353860",
11+
"0x6ad4289be24d86af470d7126cffbf5b6c994cad34120501488963e1b8b49956bdbab28b5e25721cf848d15a71e2bcc52fc114b628f3915d82a5d8b6ddab68b38",
12+
"0xb99840b8fc3d6dc6acf657438436ac2ecc27910979356ab7aa298e93fa0f7fda47dccd3751745ea3972b8298e3a8e87087a16c915d5bc301f1db9479e2394213",
13+
"0x7e3ef01aed8f9d0c981d695dc07db56d19b14b6bf90c7a754138c80f3aeef63e44e89525b350e0b486e549a8fd463f27caf3b9765cebb7a07cfd13ef3abef6b4",
14+
"0x0f4c1b6c01f398e09d714850b0da5a4ad962af4fcce5068bc78501c0552c063774d839b50beb259cc63c86320c09199a9e6360661356d5836790c2db2943b821",
15+
"0x2bfe6a3a371f3db8ff0f3c112820348e2440ca93e3c7b95a1aaac321fd55e45db6eaca3c4e88b32c35a6858fb43f74d1f193f5c28b65ef81d02d94370dee23a6"
16+
],
17+
"timeoutPropose": 10000,
18+
"timeoutProposeDelta": 5000,
19+
"timeoutPrevote": 10000,
20+
"timeoutPrevoteDelta": 5000,
21+
"timeoutPrecommit": 10000,
22+
"timeoutPrecommitDelta": 5000,
23+
"timeoutCommit": 10000,
24+
"genesisStakes": {
25+
"bccqypclxxrlr8f9n75dt6ayasvkdkxx6k3qgedauzj": 3000000,
26+
"bccqy204w0m6stuahxlx3p58kc0hsgd42npqcrx8lce": 2000000,
27+
"bccqxkppqfqwwl6vwge62qq22eh3xkmzqwvschr8thm": 1000000,
28+
"bccq8mjrws63vw27na5t6nxjf5yvjhpac5nyga4psjx": 500000,
29+
"bccq9apfpuhwe5m62ejpfyxtmad2536xj9sfqpdt76p": 500000,
30+
"bccq8yrcc4tlwlfrtmuaewv9u9fv9xjfj9czsfeyra7": 500000,
31+
"bccqy9tavttkl87gscjmkpmc56evz3m42ugxclxwp2h": 500000,
32+
"bccq8ah0efv5ckpx6wy5mwva2aklzwsdw027s4t6vux": 500000,
33+
"bccqyfrwupcdmj85gzam90yua50qz3mkgskgudmg7df": 500000,
34+
"bccqyczcz3lgeun43tujs5fkygfg4phvuk2gcs2sny0": 500000
35+
}
36+
}
37+
}
38+
},
39+
"params": {
40+
"maxExtraDataSize": "0x20",
41+
"maxAssetSchemeMetadataSize": "0x0400",
42+
"maxTransferMetadataSize": "0x0100",
43+
"maxTextContentSize": "0x0200",
44+
"networkID": "bc",
45+
"minPayCost" : 100,
46+
"minSetRegularKeyCost" : 10000,
47+
"minCreateShardCost" : 1000000,
48+
"minSetShardOwnersCost" : 100000,
49+
"minSetShardUsersCost" : 10000,
50+
"minWrapCccCost" : 100000,
51+
"minCustomCost" : 0,
52+
"minStoreCost" : 5000,
53+
"minRemoveCost" : 5000,
54+
"minMintAssetCost" : 100000,
55+
"minTransferAssetCost" : 100,
56+
"minChangeAssetSchemeCost" : 100000,
57+
"minIncreaseAssetSupplyCost" : 100000,
58+
"minComposeAssetCost" : 100000,
59+
"minDecomposeAssetCost" : 100000,
60+
"minUnwrapCccCost" : 100,
61+
"maxBodySize": 4194304,
62+
"snapshotPeriod": 16384
63+
},
64+
"genesis": {
65+
"seal": {
66+
"tendermint": {
67+
"prev_view": "0x0",
68+
"cur_view": "0x0",
69+
"precommits": [
70+
"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
71+
]
72+
}
73+
},
74+
"score": "0x20000",
75+
"author": "bccq8m5rgjw60rcxvsruydafsze6tdhkm8hsu7rpm56",
76+
"timestamp": "0x00",
77+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
78+
"extraData": "0x"
79+
},
80+
"accounts": {
81+
"bccqypclxxrlr8f9n75dt6ayasvkdkxx6k3qgedauzj": {
82+
"balance": "10000000000"
83+
},
84+
"bccqy204w0m6stuahxlx3p58kc0hsgd42npqcrx8lce": {
85+
"balance": "10000000000"
86+
},
87+
"bccqxkppqfqwwl6vwge62qq22eh3xkmzqwvschr8thm": {
88+
"balance": "10000000000"
89+
},
90+
"bccq8mjrws63vw27na5t6nxjf5yvjhpac5nyga4psjx": {
91+
"balance": "10000000000"
92+
},
93+
"bccq9apfpuhwe5m62ejpfyxtmad2536xj9sfqpdt76p": {
94+
"balance": "10000000000"
95+
},
96+
"bccq8yrcc4tlwlfrtmuaewv9u9fv9xjfj9czsfeyra7": {
97+
"balance": "10000000000"
98+
},
99+
"bccqy9tavttkl87gscjmkpmc56evz3m42ugxclxwp2h": {
100+
"balance": "10000000000"
101+
},
102+
"bccq8ah0efv5ckpx6wy5mwva2aklzwsdw027s4t6vux": {
103+
"balance": "10000000000"
104+
},
105+
"bccqyfrwupcdmj85gzam90yua50qz3mkgskgudmg7df": {
106+
"balance": "10000000000"
107+
},
108+
"bccqyczcz3lgeun43tujs5fkygfg4phvuk2gcs2sny0": {
109+
"balance": "10000000000"
110+
}
111+
},
112+
"shards": {
113+
"0": {
114+
"seq": 0,
115+
"owners": [
116+
"bccqypclxxrlr8f9n75dt6ayasvkdkxx6k3qgedauzj",
117+
"bccqy204w0m6stuahxlx3p58kc0hsgd42npqcrx8lce",
118+
"bccqxkppqfqwwl6vwge62qq22eh3xkmzqwvschr8thm",
119+
"bccq8mjrws63vw27na5t6nxjf5yvjhpac5nyga4psjx",
120+
"bccq9apfpuhwe5m62ejpfyxtmad2536xj9sfqpdt76p",
121+
"bccq8yrcc4tlwlfrtmuaewv9u9fv9xjfj9czsfeyra7",
122+
"bccqy9tavttkl87gscjmkpmc56evz3m42ugxclxwp2h",
123+
"bccq8ah0efv5ckpx6wy5mwva2aklzwsdw027s4t6vux",
124+
"bccqyfrwupcdmj85gzam90yua50qz3mkgskgudmg7df",
125+
"bccqyczcz3lgeun43tujs5fkygfg4phvuk2gcs2sny0"
126+
],
127+
"users": []
128+
}
129+
}
130+
}

core/src/codechain_machine.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,8 @@ impl CodeChainMachine {
251251
Ok(())
252252
}
253253

254-
pub fn change_term_id(
255-
&self,
256-
live: &mut ExecutedBlock,
257-
last_term_finished_block_num: u64,
258-
current_term_id: u64,
259-
) -> Result<(), Error> {
260-
live.state_mut().change_term_id(last_term_finished_block_num, current_term_id)?;
254+
pub fn increase_term_id(&self, live: &mut ExecutedBlock, last_term_finished_block_num: u64) -> Result<(), Error> {
255+
live.state_mut().increase_term_id(last_term_finished_block_num)?;
261256
Ok(())
262257
}
263258
}

0 commit comments

Comments
 (0)