Skip to content

Commit e24e8d9

Browse files
committed
Automatic project update
1 parent c4e2037 commit e24e8d9

Some content is hidden

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

46 files changed

+591
-495
lines changed

CHANGELOG.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# Changelog
1+
# Release Notes
22

33
All notable changes to this project will be documented in this file.
44

5-
## Version: 0.50.21
5+
## Version: 0.50.23
66

77
### New
88

99

10+
## Version: 0.50.23
1011

12+
### New
13+
14+
- Bumped block version to 31
15+
- Removed unused code
16+
17+
## Version: 0.50.22
18+
19+
### New
20+
21+
- Fixed build warnings
22+
- `crc32c` crate changed to common `crc`
23+
- Added rust version to node info

Cargo.toml

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
2-
edition = '2018'
2+
edition = '2021'
33
name = 'ton_node'
4-
version = '0.50.21'
4+
version = '0.50.23'
5+
build = 'common/build/build.rs'
56

67

78
[workspace]
@@ -42,25 +43,25 @@ sha2 = '0.9'
4243
spin = '0.7.1'
4344
stream-cancel = '0.8.0'
4445
string-builder = '^0.2.0'
45-
adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/tonlabs/ton-labs-adnl', tag = '0.7.74' }
46+
adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/tonlabs/ton-labs-adnl', tag = '0.7.75' }
4647
catchain = { path = 'catchain' }
47-
dht = { git = 'https://github.com/tonlabs/ton-labs-dht', tag = '0.5.68' }
48-
ever-crypto = { git = 'https://github.com/tonlabs/ever-labs-crypto', tag = '0.1.25' }
48+
dht = { git = 'https://github.com/tonlabs/ton-labs-dht', tag = '0.5.72' }
49+
ever-crypto = { git = 'https://github.com/tonlabs/ever-labs-crypto', tag = '0.1.29' }
4950
lockfree = { git = 'https://github.com/tonlabs/lockfree.git' }
50-
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.58' }
51-
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.68' }
51+
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.59' }
52+
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.69' }
5253
rustracing = { optional = true, version = '0.4.0' }
5354
rustracing_jaeger = { optional = true, version = '0.4.1' }
5455
statsd = { optional = true, version = '0.14.0' }
5556
storage = { path = 'storage' }
5657
tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
57-
ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.2.9' }
58-
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.128' }
59-
ton_block = { git = 'https://github.com/tonlabs/ton-labs-block', tag = '1.7.51' }
60-
ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.19' }
61-
ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor', tag = '1.15.74' }
62-
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.11.2' }
63-
ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm', tag = '1.8.39' }
58+
ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.1' }
59+
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.129' }
60+
ton_block = { git = 'https://github.com/tonlabs/ton-labs-block', tag = '1.8.0' }
61+
ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.24' }
62+
ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor', tag = '1.15.78' }
63+
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.11.3' }
64+
ton_vm = { git = 'https://github.com/tonlabs/ton-labs-vm', tag = '1.8.40' }
6465
validator_session = { path = 'validator-session' }
6566

6667
[target.'cfg(unix)'.dependencies.rdkafka]
@@ -88,3 +89,4 @@ telemetry = [
8889
]
8990
trace_alloc_detail = [ 'trace_alloc' ]
9091
trace_alloc = [ ]
92+
workchains = [ ]

catchain/Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = '2018'
2+
edition = '2021'
33
build = '../common/build/build.rs'
44
name = 'catchain'
55
version = '0.1.0'
@@ -22,13 +22,13 @@ regex = '1.3.1'
2222
sha2 = '0.9'
2323
tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
2424

25-
adnl = { features = [ 'node' ], git = 'https://github.com/tonlabs/ton-labs-adnl', tag = '0.7.74' }
26-
ever-crypto = { git = 'https://github.com/tonlabs/ever-labs-crypto', tag = '0.1.25' }
27-
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.58' }
28-
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.68' }
25+
adnl = { features = [ 'node' ], git = 'https://github.com/tonlabs/ton-labs-adnl', tag = '0.7.75' }
26+
ever-crypto = { git = 'https://github.com/tonlabs/ever-labs-crypto', tag = '0.1.29' }
27+
overlay = { git = 'https://github.com/tonlabs/ton-labs-overlay', tag = '0.6.59' }
28+
rldp = { git = 'https://github.com/tonlabs/ton-labs-rldp', tag = '0.7.69' }
2929
storage = { path = '../storage' }
30-
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.128' }
31-
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.11.2' }
30+
ton_api = { git = 'https://github.com/tonlabs/ton-labs-tl', package = 'ton_api', tag = '0.2.129' }
31+
ton_types = { git = 'https://github.com/tonlabs/ton-labs-types', tag = '1.11.3' }
3232

3333
[features]
3434
default = [ ]

catchain/src/receiver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ impl ReceiverImpl {
977977
let incarnation = &self.incarnation;
978978
let source_hash = self.get_source_public_key_hash(dep.src as usize);
979979
let height = dep.height;
980-
let data_hash = dep.data_hash;
980+
let data_hash = dep.data_hash.clone();
981981
::ton_api::ton::catchain::block::id::Id {
982982
incarnation: incarnation.clone(),
983983
src: public_key_hash_to_int256(source_hash),
@@ -1913,7 +1913,7 @@ impl ReceiverImpl {
19131913

19141914
trace!("Got GetBlockQuery: {:?}", query);
19151915

1916-
let block_hash = query.block;
1916+
let block_hash = query.block.clone();
19171917
let block_result = self.get_block_by_hash(&block_hash);
19181918

19191919
if let Some(block_ptr) = block_result {

catchain/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub fn get_block_dependency_id(block: &ton::BlockDep, receiver: &dyn Receiver) -
199199
incarnation: receiver.get_incarnation().clone().into(),
200200
src: public_key_hash_to_int256(receiver.get_source_public_key_hash(block.src as usize)),
201201
height: block.height,
202-
data_hash: block.data_hash,
202+
data_hash: block.data_hash.clone(),
203203
}
204204
.into_boxed()
205205
}

commit_hash.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cb8db8ea29a0892fa687c0fa38aa68b6ccbb104b
1+
f44cd2c64fa4876d9f785f691c9ca1c7e076fd45

common

deps_map.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"adnl":"7990b983666db36418391e6d1794b7a1616cf445","dht":"936b00f0831073258eef99257ada358d5cec92cf","ever-crypto":"d49d218ffd4854597e5bbc61ecbd65d2af8b5e0e","overlay":"f3addfc7200b691be23606baba346819bdddb9b7","rldp":"220c43de2887cc8cfdb91a6c86e7308ce3349ecf","ton-labs-abi":"87620862896790292c459f1f1ce73e18d9dfb7d4","ton-tl":"933ca241c710504621e93e0a514ae5045fea3a5f","ton-block":"2cc40984dd97bd72d56a53cc4d44b5868c40f8a6","ton-block-json":"eab6b7b1a3907533e350744365d8ba27be362542","ton-executor":"10ebcf0f3d40a3a7960abb7962e6b111813c3198","ton-types":"f254c3062585938012fab693eb8375ebfd69bfee","ton-vm":"732839957130feb1c2eabc7d7caaf18ded1e30e2"}
1+
{"adnl":"429fde6f0d5d0b0f445c4a7a8b32fd05de3f2daa","dht":"ae70dc4f635efb3d04ffe29ae361d6367bb8e0a4","ever-crypto":"4a9cefdfca1f20906c1c940cbca0af4b17e4b100","overlay":"9c6b0652d2b07b65a6245036cb4974175adeb46e","rldp":"fdec766db7f08c56665e360e04397055176f71a5","ton-labs-abi":"038e5c5ce85ca9a660780065a26e3520af5ad485","ton-tl":"99156ea96968bd86bc2d28814940253597fa2c2b","ton-block":"44683365a549ac28b1516b081621fa91c356d741","ton-block-json":"2f3766e2dcfad3aae8d3f190a66b47be7158f388","ton-executor":"aad4e507c4ec982aa57bc117691232147cecc79e","ton-types":"d04d4938a776665c7c276bff6bd860b0a6a1f45e","ton-vm":"8448a4627dd9d957cf4f187602582027b29c6b77"}

src/block.rs

+30-30
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
use std::{io::Cursor, collections::HashMap, cmp::max, sync::Arc};
1515
use std::io::Write;
1616
use ton_block::{
17-
Block, BlockIdExt, BlkPrevInfo, CatchainConfig, ConfigParams, Deserializable,
18-
ShardIdent, ShardDescr, ShardHashes, ValidatorSet, HashmapAugType,
17+
Block, BlockIdExt, BlkPrevInfo, Deserializable, ExtBlkRef, ShardDescr, ShardIdent,
18+
ShardHashes, HashmapAugType
1919
};
2020
use ton_types::{Cell, Result, types::UInt256, deserialize_tree_of_cells, error, fail, HashmapType};
2121

22-
use crate::{error::NodeError, shard_state::ShardHashesStuff};
22+
use crate::shard_state::ShardHashesStuff;
2323

2424

2525
pub struct BlockPrevStuff {
@@ -95,9 +95,10 @@ impl BlockStuff {
9595

9696
pub fn id(&self) -> &BlockIdExt { &self.id }
9797

98-
pub fn shard(&self) -> &ShardIdent {
99-
self.id.shard()
100-
}
98+
// Unused
99+
// pub fn shard(&self) -> &ShardIdent {
100+
// self.id.shard()
101+
// }
101102

102103
pub fn root_cell(&self) -> &Cell { &self.root }
103104

@@ -109,7 +110,7 @@ impl BlockStuff {
109110
// }
110111

111112
pub fn gen_utime(&self) -> Result<u32> {
112-
Ok(self.block.read_info()?.gen_utime().0)
113+
Ok(self.block.read_info()?.gen_utime().as_u32())
113114
}
114115

115116
// Unused
@@ -157,20 +158,17 @@ impl BlockStuff {
157158
}
158159

159160
pub fn construct_master_id(&self) -> Result<BlockIdExt> {
160-
let mc_id = self
161+
let mc_id = self.get_master_id()?;
162+
Ok(BlockIdExt::from_ext_blk(mc_id))
163+
}
164+
165+
pub fn get_master_id(&self) -> Result<ExtBlkRef> {
166+
Ok(self
161167
.block
162168
.read_info()?
163169
.read_master_ref()?
164170
.ok_or_else(|| error!("Can't get master ref: given block is a master block"))?
165-
.master;
166-
Ok(
167-
BlockIdExt {
168-
shard_id: ShardIdent::masterchain(),
169-
seq_no: mc_id.seq_no,
170-
root_hash: mc_id.root_hash,
171-
file_hash: mc_id.file_hash
172-
}
173-
)
171+
.master)
174172
}
175173

176174
pub fn write_to<T: Write>(&self, dst: &mut T) -> Result<()> {
@@ -222,20 +220,22 @@ impl BlockStuff {
222220
Ok(shards)
223221
}
224222

225-
pub fn config(&self) -> Result<ConfigParams> {
226-
self
227-
.block()
228-
.read_extra()?
229-
.read_custom()?
230-
.and_then(|custom| custom.config().cloned())
231-
.ok_or_else(|| error!(NodeError::InvalidArg(
232-
"State doesn't contain `custom` field".to_string()
233-
)))
234-
}
223+
// Unused
224+
// pub fn config(&self) -> Result<ConfigParams> {
225+
// self
226+
// .block()
227+
// .read_extra()?
228+
// .read_custom()?
229+
// .and_then(|custom| custom.config().cloned())
230+
// .ok_or_else(|| error!(NodeError::InvalidArg(
231+
// "State doesn't contain `custom` field".to_string()
232+
// )))
233+
// }
235234

236-
pub fn read_cur_validator_set_and_cc_conf(&self) -> Result<(ValidatorSet, CatchainConfig)> {
237-
self.block().read_cur_validator_set_and_cc_conf()
238-
}
235+
// Unused
236+
// pub fn read_cur_validator_set_and_cc_conf(&self) -> Result<(ValidatorSet, CatchainConfig)> {
237+
// self.block().read_cur_validator_set_and_cc_conf()
238+
// }
239239

240240
pub fn calculate_tr_count(&self) -> Result<usize> {
241241
let now = std::time::Instant::now();

src/block_proof.rs

+28-26
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*/
1313

1414
use ton_block::{
15-
Block, BlockProof, BlockIdExt, Deserializable, MerkleProof, BlockInfo,
16-
ValidatorDescr, ValidatorSet, CatchainConfig, Serializable
15+
Block, BlockIdExt, BlockInfo, BlockProof, Deserializable, MerkleProof, Serializable,
16+
ValidatorDescr
1717
};
1818
use ton_types::{
1919
Cell, Result, fail, error, HashmapType, deserialize_tree_of_cells, serialize_tree_of_cells,
@@ -113,6 +113,7 @@ impl BlockProofStuff {
113113
&self.id
114114
}
115115

116+
#[cfg(feature="external_db")]
116117
pub fn proof(&self) -> &BlockProof {
117118
&self.proof
118119
}
@@ -204,26 +205,24 @@ impl BlockProofStuff {
204205
Ok(())
205206
}
206207

207-
pub fn get_cur_validators_set(&self) -> Result<(ValidatorSet, CatchainConfig)> {
208-
let (virt_key_block, prev_key_block_info) = self.pre_check_block_proof()?;
209-
210-
if !prev_key_block_info.key_block() {
211-
fail!(NodeError::InvalidData(format!(
212-
"proof for key block {} contains a Merkle proof which declares non key block",
213-
self.id(),
214-
)))
215-
}
216-
217-
let (cur_validator_set, cc_config) = virt_key_block.read_cur_validator_set_and_cc_conf()
218-
.map_err(|err| {
219-
NodeError::InvalidData(format!(
220-
"Сan't extract config params from key block's proof {}: {}",
221-
self.id, err
222-
))
223-
})?;
224-
225-
Ok((cur_validator_set, cc_config))
226-
}
208+
// Unused
209+
// pub fn get_cur_validators_set(&self) -> Result<(ValidatorSet, CatchainConfig)> {
210+
// let (virt_key_block, prev_key_block_info) = self.pre_check_block_proof()?;
211+
// if !prev_key_block_info.key_block() {
212+
// fail!(NodeError::InvalidData(format!(
213+
// "proof for key block {} contains a Merkle proof which declares non key block",
214+
// self.id(),
215+
// )))
216+
// }
217+
// let (cur_validator_set, cc_config) = virt_key_block.read_cur_validator_set_and_cc_conf()
218+
// .map_err(|err| {
219+
// NodeError::InvalidData(format!(
220+
// "Сan't extract config params from key block's proof {}: {}",
221+
// self.id, err
222+
// ))
223+
// })?;
224+
// Ok((cur_validator_set, cc_config))
225+
// }
227226

228227
pub fn check_with_prev_key_block_proof_(
229228
&self,
@@ -257,7 +256,7 @@ impl BlockProofStuff {
257256
)))
258257
}
259258
let (validators, validators_hash_short) =
260-
self.process_prev_key_block_proof(prev_key_block_proof, virt_block_info.gen_utime().0)?;
259+
self.process_prev_key_block_proof(prev_key_block_proof, virt_block_info.gen_utime().as_u32())?;
261260

262261
if virt_block_info.key_block() {
263262
self.pre_check_key_block_proof(virt_block)?;
@@ -396,14 +395,17 @@ impl BlockProofStuff {
396395
}
397396
let _catchain_config = config.config(28)?;
398397
if let Err(e) = config.workchains() {
399-
log::warn!("{}", e);
398+
log::trace!("{}", e);
400399
}
401400

402401
Ok(())
403402
}
404403

405-
fn process_prev_key_block_proof(&self, prev_key_block_proof: &BlockProofStuff, gen_utime: u32)
406-
-> Result<(Vec<ValidatorDescr>, u32)> {
404+
fn process_prev_key_block_proof(
405+
&self,
406+
prev_key_block_proof: &BlockProofStuff,
407+
gen_utime: u32
408+
) -> Result<(Vec<ValidatorDescr>, u32)> {
407409
let (virt_key_block, prev_key_block_info) = prev_key_block_proof.pre_check_block_proof()?;
408410

409411
if !prev_key_block_info.key_block() {

src/collator_test_bundle.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ impl CollatorTestBundle {
838838
prev_blocks: prev_blocks_ids,
839839
created_by: candidate.created_by.clone(),
840840
rand_seed: None,
841-
now: b.block().read_info()?.gen_utime().0,
841+
now: b.block().read_info()?.gen_utime().as_u32(),
842842
fake: true,
843843
contains_ethalon: false,
844844
contains_candidate: true,
@@ -1045,7 +1045,7 @@ impl CollatorTestBundle {
10451045
prev_blocks: prev_blocks_ids,
10461046
created_by: extra.created_by().clone(),
10471047
rand_seed: Some(extra.rand_seed().clone()),
1048-
now: info.gen_utime().0,
1048+
now: info.gen_utime().as_u32(),
10491049
fake: true,
10501050
contains_ethalon: true,
10511051
contains_candidate: false,

0 commit comments

Comments
 (0)