Skip to content

Commit

Permalink
Merge branch 'testnet' into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
neodiX committed Jul 3, 2024
2 parents 52e6a5b + 0523892 commit 5949d03
Show file tree
Hide file tree
Showing 52 changed files with 2,449 additions and 405 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ target_link_libraries(test-ton-collator overlay tdutils tdactor adnl tl_api dht
add_executable(test-http test/test-http.cpp)
target_link_libraries(test-http PRIVATE tonhttp)

add_executable(test-emulator test/test-td-main.cpp emulator/test/emulator-tests.cpp)
target_link_libraries(test-emulator PRIVATE emulator)

get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if (HAS_PARENT)
set(ALL_TEST_SOURCE
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 @@ -91,7 +91,7 @@ td::Status AdnlInboundConnection::process_custom_packet(td::BufferSlice &data, b
auto F = fetch_tl_object<ton_api::tcp_authentificate>(data.clone(), true);
if (F.is_ok()) {
if (nonce_.size() > 0 || !remote_id_.is_zero()) {
return td::Status::Error(ErrorCode::protoviolation, "duplicate authentificate");
return td::Status::Error(ErrorCode::protoviolation, "duplicate authenticate");
}
auto f = F.move_as_ok();
nonce_ = td::SecureString{f->nonce_.size() + 256};
Expand Down
2 changes: 1 addition & 1 deletion assembly/native/build-windows-2019.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ echo Using secp256k1...
)


curl -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip
curl --retry 5 --retry-delay 10 -Lo libsodium-1.0.18-stable-msvc.zip https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip
IF %errorlevel% NEQ 0 (
echo Can't download libsodium
exit /b %errorlevel%
Expand Down
2 changes: 1 addition & 1 deletion common/global-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
namespace ton {

// See doc/GlobalVersions.md
const int SUPPORTED_VERSION = 7;
const int SUPPORTED_VERSION = 8;

}
259 changes: 211 additions & 48 deletions crypto/block/block-parse.cpp

Large diffs are not rendered by default.

45 changes: 38 additions & 7 deletions crypto/block/block-parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "td/utils/bits.h"
#include "td/utils/StringBuilder.h"
#include "ton/ton-types.h"
#include "block-auto.h"

namespace block {

Expand Down Expand Up @@ -469,11 +470,17 @@ struct MsgEnvelope final : TLB_Complex {
int cur_addr, next_addr;
td::RefInt256 fwd_fee_remaining;
Ref<vm::Cell> msg;
td::optional<ton::LogicalTime> emitted_lt;
td::optional<MsgMetadata> metadata;
};
bool unpack(vm::CellSlice& cs, Record& data) const;
bool unpack(vm::CellSlice& cs, Record_std& data) const;
bool unpack_std(vm::CellSlice& cs, int& cur_a, int& nhop_a, Ref<vm::Cell>& msg) const;
bool get_created_lt(const vm::CellSlice& cs, unsigned long long& created_lt) const;
bool pack(vm::CellBuilder& cb, const Record_std& data) const;
bool pack_cell(td::Ref<vm::Cell>& cell, const Record_std& data) const;
bool get_emitted_lt(const vm::CellSlice& cs, unsigned long long& emitted_lt) const;
int get_tag(const vm::CellSlice& cs) const override {
return (int)cs.prefetch_ulong(4);
}
};

extern const MsgEnvelope t_MsgEnvelope;
Expand Down Expand Up @@ -801,12 +808,18 @@ struct InMsg final : TLB_Complex {
msg_import_fin = 4,
msg_import_tr = 5,
msg_discard_fin = 6,
msg_discard_tr = 7
msg_discard_tr = 7,
msg_import_deferred_fin = 8,
msg_import_deferred_tr = 9
};
bool skip(vm::CellSlice& cs) const override;
bool validate_skip(int* ops, vm::CellSlice& cs, bool weak = false) const override;
int get_tag(const vm::CellSlice& cs) const override {
return (int)cs.prefetch_ulong(3);
int tag = (int)cs.prefetch_ulong(3);
if (tag != 1) {
return tag;
}
return (int)cs.prefetch_ulong(5) - 0b00100 + 8;
}
bool get_import_fees(vm::CellBuilder& cb, vm::CellSlice& cs) const;
};
Expand All @@ -822,16 +835,24 @@ struct OutMsg final : TLB_Complex {
msg_export_deq_imm = 4,
msg_export_deq = 12,
msg_export_deq_short = 13,
msg_export_tr_req = 7
msg_export_tr_req = 7,
msg_export_new_defer = 20, // 0b10100
msg_export_deferred_tr = 21 // 0b10101
};
bool skip(vm::CellSlice& cs) const override;
bool validate_skip(int* ops, vm::CellSlice& cs, bool weak = false) const override;
int get_tag(const vm::CellSlice& cs) const override {
int t = (int)cs.prefetch_ulong(3);
return t != 6 ? t : (int)cs.prefetch_ulong(4);
if (t == 6) {
return (int)cs.prefetch_ulong(4);
}
if (t == 5) {
return (int)cs.prefetch_ulong(5);
}
return t;
}
bool get_export_value(vm::CellBuilder& cb, vm::CellSlice& cs) const;
bool get_created_lt(vm::CellSlice& cs, unsigned long long& created_lt) const;
bool get_emitted_lt(vm::CellSlice& cs, unsigned long long& emitted_lt) const;
};

extern const OutMsg t_OutMsg;
Expand Down Expand Up @@ -909,6 +930,16 @@ struct Aug_OutMsgQueue final : AugmentationCheckData {

extern const Aug_OutMsgQueue aug_OutMsgQueue;

struct Aug_DispatchQueue final : AugmentationCheckData {
Aug_DispatchQueue() : AugmentationCheckData(gen::t_AccountDispatchQueue, t_uint64) {
}
bool eval_fork(vm::CellBuilder& cb, vm::CellSlice& left_cs, vm::CellSlice& right_cs) const override;
bool eval_empty(vm::CellBuilder& cb) const override;
bool eval_leaf(vm::CellBuilder& cb, vm::CellSlice& cs) const override;
};

extern const Aug_DispatchQueue aug_DispatchQueue;

struct OutMsgQueue final : TLB_Complex {
HashmapAugE dict_type;
OutMsgQueue() : dict_type(32 + 64 + 256, aug_OutMsgQueue){};
Expand Down
Loading

0 comments on commit 5949d03

Please sign in to comment.