Skip to content

Commit 73751cd

Browse files
authored
Fix compilation error and test-db (ton-blockchain#1609)
* Fix compilation error * Fix error processing in load_cell * Decrease verbosity of certain ADNL logs
1 parent 80ecebd commit 73751cd

File tree

5 files changed

+17
-10
lines changed

5 files changed

+17
-10
lines changed

adnl/adnl-ext-server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ td::Status AdnlInboundConnection::process_packet(td::BufferSlice data) {
3131
td::PromiseCreator::lambda([SelfId = actor_id(this), query_id = f->query_id_](td::Result<td::BufferSlice> R) {
3232
if (R.is_error()) {
3333
auto S = R.move_as_error();
34-
LOG(WARNING) << "failed ext query: " << S;
34+
LOG(INFO) << "failed ext query: " << S;
3535
} else {
3636
auto B = create_tl_object<ton_api::adnl_message_answer>(query_id, R.move_as_ok());
3737
td::actor::send_closure(SelfId, &AdnlInboundConnection::send, serialize_tl_object(B, true));

adnl/adnl-peer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ void AdnlPeerPairImpl::process_message(const adnlmessage::AdnlMessagePart &messa
598598
respond_with_nop();
599599
auto size = message.total_size();
600600
if (size > huge_packet_max_size()) {
601-
VLOG(ADNL_WARNING) << this << ": dropping too big huge message: size=" << size;
601+
VLOG(ADNL_INFO) << this << ": dropping too big huge message: size=" << size;
602602
return;
603603
}
604604
if (message.hash().is_zero()) {
605-
VLOG(ADNL_WARNING) << this << ": dropping huge message with zero hash";
605+
VLOG(ADNL_INFO) << this << ": dropping huge message with zero hash";
606606
return;
607607
}
608608
if (message.hash() != huge_message_hash_) {

crypto/vm/db/DynamicBagOfCellsDb.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,18 @@ class DynamicBagOfCellsDbImpl : public DynamicBagOfCellsDb, private ExtCellCreat
138138
return td::Status::OK();
139139
}
140140
td::Result<Ref<DataCell>> load_cell(td::Slice hash) override {
141-
TRY_RESULT(loaded_cell, get_cell_info_force(hash).cell->load_cell());
142-
return std::move(loaded_cell.data_cell);
141+
auto info = hash_table_.get_if_exists(hash);
142+
if (info && info->sync_with_db) {
143+
TRY_RESULT(loaded_cell, info->cell->load_cell());
144+
return std::move(loaded_cell.data_cell);
145+
}
146+
TRY_RESULT(res, loader_->load(hash, true, *this));
147+
if (res.status != CellLoader::LoadResult::Ok) {
148+
return td::Status::Error("cell not found");
149+
}
150+
Ref<DataCell> cell = res.cell();
151+
hash_table_.apply(hash, [&](CellInfo &info) { update_cell_info_loaded(info, hash, std::move(res)); });
152+
return cell;
143153
}
144154
td::Result<Ref<DataCell>> load_root(td::Slice hash) override {
145155
return load_cell(hash);
@@ -195,9 +205,6 @@ class DynamicBagOfCellsDbImpl : public DynamicBagOfCellsDb, private ExtCellCreat
195205
promise->set_result(std::move(cell));
196206
});
197207
}
198-
CellInfo &get_cell_info_force(td::Slice hash) {
199-
return hash_table_.apply(hash, [&](CellInfo &info) { update_cell_info_force(info, hash); });
200-
}
201208
CellInfo &get_cell_info_lazy(Cell::LevelMask level_mask, td::Slice hash, td::Slice depth) {
202209
return hash_table_.apply(hash.substr(hash.size() - Cell::hash_bytes),
203210
[&](CellInfo &info) { update_cell_info_lazy(info, level_mask, hash, depth); });

tdnet/td/net/TcpListener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void TcpListener::loop() {
6161
break;
6262
}
6363
TRY_RESULT(client_socket, std::move(r_socket));
64-
LOG(ERROR) << "Accept";
64+
LOG(INFO) << "Accept";
6565
callback_->accept(std::move(client_socket));
6666
}
6767
if (td::can_close(server_socket_fd_)) {

validator/db/celldb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void CellDbIn::start_up() {
231231
db_options.two_level_index_and_filter = db_options.enable_bloom_filter
232232
&& opts_->state_ttl() >= 60 * 60 * 24 * 30; // 30 days
233233
if (db_options.two_level_index_and_filter && !opts_->get_celldb_in_memory()) {
234-
o_celldb_cache_size = std::max(o_celldb_cache_size ? o_celldb_cache_size.value() : 0UL, 16UL << 30);
234+
o_celldb_cache_size = std::max<td::uint64>(o_celldb_cache_size ? o_celldb_cache_size.value() : 0UL, 16UL << 30);
235235
}
236236

237237
if (o_celldb_cache_size) {

0 commit comments

Comments
 (0)