1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

updated vm (breaking compatibility)

- updated vm
- new actor scheduler
- updated tonlib
- updated DNS smartcontract
This commit is contained in:
ton 2020-02-28 14:28:47 +04:00
parent 9e4816e7f6
commit e27fb1e09c
100 changed files with 3692 additions and 1299 deletions

View file

@ -50,6 +50,7 @@ class TestNode : public td::actor::Actor {
bool readline_enabled_ = true;
bool server_ok_ = false;
td::int32 liteserver_idx_ = -1;
int print_limit_ = 1024;
bool ready_ = false;
bool inited_ = false;
@ -66,6 +67,9 @@ class TestNode : public td::actor::Actor {
ton::BlockIdExt last_block_id_, last_state_id_;
td::BufferSlice last_block_data_, last_state_data_;
ton::StdSmcAddress dns_root_;
bool dns_root_queried_{false};
std::string line_;
const char *parse_ptr_, *parse_end_;
td::Status error_;
@ -118,16 +122,31 @@ class TestNode : public td::actor::Actor {
ton::WorkchainId workchain, ton::StdSmcAddress addr, std::string filename, int mode);
bool parse_run_method(ton::WorkchainId workchain, ton::StdSmcAddress addr, ton::BlockIdExt ref_blkid,
std::string method_name, bool ext_mode);
bool start_run_method(ton::WorkchainId workchain, ton::StdSmcAddress addr, ton::BlockIdExt ref_blkid,
std::string method_name, std::vector<vm::StackEntry> params, int mode,
td::Promise<std::vector<vm::StackEntry>> promise);
void run_smc_method(int mode, ton::BlockIdExt ref_blk, ton::BlockIdExt blk, ton::BlockIdExt shard_blk,
td::BufferSlice shard_proof, td::BufferSlice proof, td::BufferSlice state,
ton::WorkchainId workchain, ton::StdSmcAddress addr, std::string method,
std::vector<vm::StackEntry> params, td::BufferSlice remote_c7, td::BufferSlice remote_libs,
td::BufferSlice remote_result, int remote_exit_code);
td::BufferSlice remote_result, int remote_exit_code,
td::Promise<std::vector<vm::StackEntry>> promise);
bool register_config_param4(Ref<vm::Cell> value);
bool dns_resolve_start(ton::WorkchainId workchain, ton::StdSmcAddress addr, ton::BlockIdExt blkid, std::string domain,
int cat, int mode);
bool dns_resolve_send(ton::WorkchainId workchain, ton::StdSmcAddress addr, ton::BlockIdExt blkid, std::string domain,
std::string qdomain, int cat, int mode);
void dns_resolve_finish(ton::WorkchainId workchain, ton::StdSmcAddress addr, ton::BlockIdExt blkid,
std::string domain, std::string qdomain, int cat, int mode, int used_bits,
Ref<vm::Cell> value);
bool show_dns_record(std::ostream& os, int cat, Ref<vm::Cell> value, bool raw_dump);
bool get_all_shards(bool use_last = true, ton::BlockIdExt blkid = {});
void got_all_shards(ton::BlockIdExt blk, td::BufferSlice proof, td::BufferSlice data);
bool get_config_params(ton::BlockIdExt blkid, int mode = 0, std::string filename = "");
bool get_config_params(ton::BlockIdExt blkid, td::Promise<td::Unit> do_after, int mode = 0, std::string filename = "",
std::vector<int> params = {});
void got_config_params(ton::BlockIdExt req_blkid, ton::BlockIdExt blkid, td::BufferSlice state_proof,
td::BufferSlice cfg_proof, int mode, std::string filename, std::vector<int> params);
td::BufferSlice cfg_proof, int mode, std::string filename, std::vector<int> params,
td::Promise<td::Unit> do_after);
bool get_block(ton::BlockIdExt blk, bool dump = false);
void got_block(ton::BlockIdExt blkid, td::BufferSlice data, bool dump);
bool get_state(ton::BlockIdExt blk, bool dump = false);
@ -173,7 +192,7 @@ class TestNode : public td::actor::Actor {
bool set_error(td::Status error);
bool set_error(std::string err_msg);
void show_context() const;
bool parse_account_addr(ton::WorkchainId& wc, ton::StdSmcAddress& addr);
bool parse_account_addr(ton::WorkchainId& wc, ton::StdSmcAddress& addr, bool allow_none = false);
static int parse_hex_digit(int c);
static bool parse_hash(const char* str, ton::Bits256& hash);
static bool parse_hash(td::Slice str, ton::Bits256& hash);
@ -186,6 +205,8 @@ class TestNode : public td::actor::Actor {
bool parse_hash(ton::Bits256& hash);
bool parse_lt(ton::LogicalTime& lt);
bool parse_uint32(td::uint32& val);
bool parse_int32(td::int32& val);
bool parse_int16(int& val);
bool parse_shard_id(ton::ShardIdFull& shard);
bool parse_block_id_ext(ton::BlockIdExt& blkid, bool allow_incomplete = false);
bool parse_block_id_ext(std::string blk_id_string, ton::BlockIdExt& blkid, bool allow_incomplete = false) const;
@ -195,6 +216,7 @@ class TestNode : public td::actor::Actor {
bool register_blkid(const ton::BlockIdExt& blkid);
bool show_new_blkids(bool all = false);
bool complete_blkid(ton::BlockId partial_blkid, ton::BlockIdExt& complete_blkid) const;
td::Promise<td::Unit> trivial_promise();
public:
void conn_ready() {
@ -237,6 +259,11 @@ class TestNode : public td::actor::Actor {
fail_timeout_ = ts;
alarm_timestamp().relax(fail_timeout_);
}
void set_print_limit(int plimit) {
if (plimit >= 0) {
print_limit_ = plimit;
}
}
void add_cmd(td::BufferSlice data) {
ex_mode_ = true;
ex_queries_.push_back(std::move(data));