Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ton committed Apr 10, 2020
1 parent 8be3fc9 commit be9c34c
Show file tree
Hide file tree
Showing 699 changed files with 1,171 additions and 978 deletions.
2 changes: 1 addition & 1 deletion adnl/adnl-db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-db.hpp"
#include "td/db/RocksDb.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-db.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-ext-client.hpp"
#include "adnl-ext-client.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-client.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-ext-connection.hpp"

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-ext-server.hpp"
#include "keys/encryptor.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-server.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-ext-server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl/adnl-message.h"
#include "auto/tl/ton_api.hpp"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-node.h"

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-node.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-packet.h"
#include "td/utils/Random.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-query.h"
#include "common/errorcode.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-query.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-static-nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-static-nodes.h"
#include "adnl-static-nodes.hpp"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-static-nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-static-nodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-test-loopback-implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-test-loopback-implementation.h"

Expand Down
2 changes: 1 addition & 1 deletion adnl/test/adnl-test-ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl/adnl-network-manager.h"
#include "adnl/adnl-peer-table.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "utils.hpp"
#include "tl/tl_object_store.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion blockchain-explorer/blockchain-explorer-query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "catchain-block.hpp"

Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-received-block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include <set>

Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-received-block.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-received-block.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
12 changes: 5 additions & 7 deletions catchain/catchain-receiver-interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,11 @@ class CatChainReceiverInterface : public td::actor::Actor {

virtual void destroy() = 0;

static td::actor::ActorOwn<CatChainReceiverInterface> create(std::unique_ptr<Callback> callback, CatChainOptions opts,
td::actor::ActorId<keyring::Keyring> keyring,
td::actor::ActorId<adnl::Adnl> adnl,
td::actor::ActorId<overlay::Overlays> overlay_manager,
std::vector<CatChainNode> ids, PublicKeyHash local_id,
CatChainSessionId unique_hash, std::string db_root,
bool allow_unsafe_self_blocks_resync);
static td::actor::ActorOwn<CatChainReceiverInterface> create(
std::unique_ptr<Callback> callback, CatChainOptions opts, td::actor::ActorId<keyring::Keyring> keyring,
td::actor::ActorId<adnl::Adnl> adnl, td::actor::ActorId<overlay::Overlays> overlay_manager,
std::vector<CatChainNode> ids, PublicKeyHash local_id, CatChainSessionId unique_hash, std::string db_root,
std::string db_suffix, bool allow_unsafe_self_blocks_resync);

virtual ~CatChainReceiverInterface() = default;
};
Expand Down
16 changes: 9 additions & 7 deletions catchain/catchain-receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ CatChainReceiverImpl::CatChainReceiverImpl(std::unique_ptr<Callback> callback, C
td::actor::ActorId<adnl::Adnl> adnl,
td::actor::ActorId<overlay::Overlays> overlay_manager,
std::vector<CatChainNode> ids, PublicKeyHash local_id,
CatChainSessionId unique_hash, std::string db_root,
CatChainSessionId unique_hash, std::string db_root, std::string db_suffix,
bool allow_unsafe_self_blocks_resync)
: callback_(std::move(callback))
, opts_(std::move(opts))
Expand All @@ -439,6 +439,7 @@ CatChainReceiverImpl::CatChainReceiverImpl(std::unique_ptr<Callback> callback, C
, overlay_manager_(overlay_manager)
, local_id_(local_id)
, db_root_(db_root)
, db_suffix_(db_suffix)
, allow_unsafe_self_blocks_resync_(allow_unsafe_self_blocks_resync) {
std::vector<td::Bits256> short_ids;
local_idx_ = static_cast<td::uint32>(ids.size());
Expand Down Expand Up @@ -491,7 +492,8 @@ void CatChainReceiverImpl::start_up() {

if (!opts_.debug_disable_db) {
std::shared_ptr<td::KeyValue> kv = std::make_shared<td::RocksDb>(
td::RocksDb::open(db_root_ + "/catchainreceiver-" + td::base64url_encode(as_slice(incarnation_))).move_as_ok());
td::RocksDb::open(db_root_ + "/catchainreceiver" + db_suffix_ + td::base64url_encode(as_slice(incarnation_)))
.move_as_ok());
db_ = DbType{std::move(kv)};

auto P = td::PromiseCreator::lambda([SelfId = actor_id(this)](td::Result<DbType::GetResult> R) {
Expand Down Expand Up @@ -611,10 +613,10 @@ td::actor::ActorOwn<CatChainReceiverInterface> CatChainReceiverInterface::create
std::unique_ptr<Callback> callback, CatChainOptions opts, td::actor::ActorId<keyring::Keyring> keyring,
td::actor::ActorId<adnl::Adnl> adnl, td::actor::ActorId<overlay::Overlays> overlay_manager,
std::vector<CatChainNode> ids, PublicKeyHash local_id, CatChainSessionId unique_hash, std::string db_root,
bool allow_unsafe_self_blocks_resync) {
auto A = td::actor::create_actor<CatChainReceiverImpl>("catchainreceiver", std::move(callback), std::move(opts),
keyring, adnl, overlay_manager, std::move(ids), local_id,
unique_hash, db_root, allow_unsafe_self_blocks_resync);
std::string db_suffix, bool allow_unsafe_self_blocks_resync) {
auto A = td::actor::create_actor<CatChainReceiverImpl>(
"catchainreceiver", std::move(callback), std::move(opts), keyring, adnl, overlay_manager, std::move(ids),
local_id, unique_hash, db_root, db_suffix, allow_unsafe_self_blocks_resync);
return std::move(A);
}

Expand Down Expand Up @@ -1058,7 +1060,7 @@ static void destroy_db(std::string name, td::uint32 attempt) {
}

void CatChainReceiverImpl::destroy() {
auto name = db_root_ + "/catchainreceiver-" + td::base64url_encode(as_slice(incarnation_));
auto name = db_root_ + "/catchainreceiver" + db_suffix_ + td::base64url_encode(as_slice(incarnation_));
delay_action([name]() { destroy_db(name, 0); }, td::Timestamp::in(1.0));
stop();
}
Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
4 changes: 3 additions & 1 deletion catchain/catchain-receiver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ class CatChainReceiverImpl : public CatChainReceiver {
CatChainReceiverImpl(std::unique_ptr<Callback> callback, CatChainOptions opts,
td::actor::ActorId<keyring::Keyring> keyring, td::actor::ActorId<adnl::Adnl> adnl,
td::actor::ActorId<overlay::Overlays>, std::vector<CatChainNode> ids, PublicKeyHash local_id,
CatChainBlockHash unique_hash, std::string db_root, bool allow_unsafe_self_blocks_resync);
CatChainBlockHash unique_hash, std::string db_root, std::string db_suffix,
bool allow_unsafe_self_blocks_resync);

private:
std::unique_ptr<overlay::Overlays::Callback> make_callback() {
Expand Down Expand Up @@ -220,6 +221,7 @@ class CatChainReceiverImpl : public CatChainReceiver {
td::Timestamp next_rotate_;

std::string db_root_;
std::string db_suffix_;

using DbType = td::KeyValueAsync<CatChainBlockHash, td::BufferSlice>;
DbType db_;
Expand Down
2 changes: 1 addition & 1 deletion catchain/catchain-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
Loading

0 comments on commit be9c34c

Please sign in to comment.