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

update tonlib

tonlib: update
collator: increased collation speed for masterchain
fift: bugfixes
This commit is contained in:
ton 2019-10-04 16:08:02 +04:00
parent 7ea00ebfcf
commit dd745485e2
27 changed files with 313 additions and 172 deletions

View file

@ -897,7 +897,7 @@ static int process_workchain_shard_hashes(Ref<vm::Cell>& branch, ton::ShardIdFul
int f = (int)cs.fetch_ulong(1);
if (f == 1) {
if ((shard.shard & 1) || cs.size_ext() != 0x20000) {
return false;
return -1;
}
auto left = cs.prefetch_ref(0), right = cs.prefetch_ref(1);
int r = process_workchain_shard_hashes(left, ton::shard_child(shard, true), func);

View file

@ -1922,7 +1922,7 @@ bool AnyIntView<Tr>::export_bits_any(unsigned char* buff, int offs, unsigned bit
if (--ptr > buff) {
*ptr = (unsigned char)(v & 0xff);
} else {
int mask = (-0x100 >> offs) & 0xff;
int mask = (0xff00 >> offs) & 0xff;
if (((unsigned char)v ^ s) & mask) {
return false;
}
@ -1943,7 +1943,7 @@ bool AnyIntView<Tr>::export_bits_any(unsigned char* buff, int offs, unsigned bit
if (--ptr > buff) {
*ptr = (unsigned char)(v & 0xff);
} else {
int mask = (-0x100 >> offs) & 0xff;
int mask = (0xff00 >> offs) & 0xff;
if (((unsigned char)v ^ s) & mask) {
return false;
}
@ -1961,7 +1961,7 @@ bool AnyIntView<Tr>::export_bits_any(unsigned char* buff, int offs, unsigned bit
*ptr = (unsigned char)(v & 0xff);
v >>= 8;
}
int mask = (-0x100 >> offs) & 0xff;
int mask = (0xff00 >> offs) & 0xff;
if (((unsigned char)v ^ s) & mask) {
return false;
}

View file

@ -132,9 +132,7 @@ int main(int argc, char* const argv[]) {
if (!no_env) {
const char* path = std::getenv("FIFTPATH");
if (path) {
parse_include_path_set(path ? path : "/usr/lib/fift", source_include_path);
}
parse_include_path_set(path ? path : "/usr/lib/fift", source_include_path);
}
std::string current_dir;
auto r_current_dir = td::realpath(".");

View file

@ -138,7 +138,7 @@ bool Op::set_var_info_except(const VarDescrList& new_var_info, const std::vector
}
VarDescrList tmp_info{new_var_info};
tmp_info -= var_list;
return set_var_info(new_var_info);
return set_var_info(tmp_info);
}
bool Op::set_var_info_except(VarDescrList&& new_var_info, const std::vector<var_idx_t>& var_list) {

View file

@ -31,8 +31,9 @@ serialized_boc#b5ee9c72 has_idx:(## 1) has_crc32c:(## 1)
absent:(##(size * 8)) { roots + absent <= cells }
tot_cells_size:(##(off_bytes * 8))
root_list:(roots * ##(size * 8))
index:(cells * ##(off_bytes * 8))
index:has_idx?(cells * ##(off_bytes * 8))
cell_data:(tot_cells_size * [ uint8 ])
crc32c:has_crc32c?uint32
= BagOfCells;
compiled_smart_contract

View file

@ -75,7 +75,7 @@ td::Result<int> CellSerializationInfo::get_bits(td::Slice cell) const {
if (data_with_bits) {
DCHECK(data_len != 0);
int last = cell[data_offset + data_len - 1];
if (!last || last == 0x80) {
if (!(last & 0x7f)) {
return td::Status::Error("overlong encoding");
}
return td::narrow_cast<int>((data_len - 1) * 8 + 7 - td::count_trailing_zeroes_non_zero32(last));
@ -391,15 +391,6 @@ td::uint64 BagOfCells::compute_sizes(int mode, int& r_size, int& o_size) {
r_size = o_size = 0;
return 0;
}
if (!(mode & Mode::WithIndex)) {
if (rs > 2 || os > 4) {
rs = std::max(3, rs);
os = 8;
data_bytes_adj = data_bytes + (unsigned long long)int_refs * rs + hashes;
} else {
os = 4;
}
}
r_size = rs;
o_size = os;
return data_bytes_adj;

View file

@ -527,9 +527,6 @@ int CellBuilder::serialize(unsigned char* buff, int buff_size) const {
CellBuilder* CellBuilder::make_copy() const {
CellBuilder* c = new CellBuilder();
if (!c) {
throw CellWriteError();
}
c->bits = bits;
std::memcpy(c->data, data, (bits + 7) >> 3);
c->refs_cnt = refs_cnt;