Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
minor bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ton committed Jun 3, 2020
1 parent 4e26244 commit dbde9c1
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion crypto/func/test/a12_1.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) {
return (f, j, a, b, i, g, d, e, h, c);
return (f, j, a, b, i, g, d, e, h, c); ;; optimal code is 3 ops, 6 bytes
;; s6 s0 s4 XCHG3 s4 s8 s9 XCHG3 8 0 REVERSE
}
3 changes: 2 additions & 1 deletion crypto/func/test/a12_2.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) {
return (f, d, j, a, i, g, b, e, h, c);
return (f, d, j, a, i, g, b, e, h, c); ;; optimal code is 4 ops, 6 bytes
;; s1 s8 XCHG s1 s6 XCHG 7 3 BLKSWAP s9 s4 XCHG2
}
1 change: 1 addition & 0 deletions crypto/func/test/a12_3.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) {
return (e, h, d, a, c, g, f, b, i, j, k); ;; optimal code is 4 ops, 8 bytes
;; s9 s9 XCHG2 s6 s6 s8 XCHG3 s10 s7 s3 XCHG3 10 0 REVERSE
}
1 change: 1 addition & 0 deletions crypto/func/test/a12_4.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) {
return (b, a, c, e, g, d, f, k, i, j, h); ;; optimal code is 4 ops, 8 bytes
;; s5 s0 s8 XCHG3 2 9 BLKSWAP s8 s9 s10 XCHG3 s7 s0 s5 XCHG3
}
1 change: 1 addition & 0 deletions crypto/func/test/a12_5.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) {
return (c, g, d, k, a, f, e, h, i, j, b); ;; optimal code is 6 ops, 6 bytes
;; s0 s7 XCHG s0 s8 XCHG s0 s10 XCHG s0 s6 XCHG s0 s4 XCHG s0 s9 XCHG
}
1 change: 1 addition & 0 deletions crypto/func/test/a12_6.fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k) {
return (h, e, d, j, k, f, i, a, b, c, g); ;; optimal code is 3 ops, 6 bytes
;; s3 s10 XCHG s6 s7 s6 XCHG3 s9 s8 s4 XCHG3
}
4 changes: 4 additions & 0 deletions crypto/func/test/a12_8.fc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, int n, int o, int p) {
return (l, i, o, h, a, m, j, d, p, g, n, b, k, e, c, f); ;; optimal code is 5 ops, 10 bytes
;; 8 0 REVERSE s3 s9 s14 XCHG3 s15 s6 s4 XCHG3 s8 s12 XCHG s11 s13 s10 XCHG3
}
4 changes: 4 additions & 0 deletions crypto/func/test/a12_9.fc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_ f(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m, int n, int o, int p) {
return (g, j, n, f, o, i, e, l, d, h, b, k, m, c, p, a); ;; optimal code is 5 ops, 10 bytes
;; s7 s5 s14 XCHG3 s10 s4 s5 XCHG3 s12 s8 s11 XCHG3 s7 s6 s9 XCHG3 s13 s14 s15 XCHG3
}
16 changes: 8 additions & 8 deletions validator/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1663,14 +1663,6 @@ void ValidatorManagerImpl::completed_prestart_sync() {
}

void ValidatorManagerImpl::new_masterchain_block() {
update_shards();
update_shard_blocks();

if (!shard_client_.empty()) {
td::actor::send_closure(shard_client_, &ShardClient::new_masterchain_block_notification,
last_masterchain_block_handle_, last_masterchain_state_);
}

if (last_masterchain_seqno_ > 0 && last_masterchain_block_handle_->is_key_block()) {
last_key_block_handle_ = last_masterchain_block_handle_;
if (last_key_block_handle_->id().seqno() > last_known_key_block_handle_->id().seqno()) {
Expand All @@ -1679,6 +1671,14 @@ void ValidatorManagerImpl::new_masterchain_block() {
}
}

update_shards();
update_shard_blocks();

if (!shard_client_.empty()) {
td::actor::send_closure(shard_client_, &ShardClient::new_masterchain_block_notification,
last_masterchain_block_handle_, last_masterchain_state_);
}

if (last_masterchain_seqno_ % 1024 == 0) {
LOG(WARNING) << "applied masterchain block " << last_masterchain_block_id_;
}
Expand Down

0 comments on commit dbde9c1

Please sign in to comment.