From dbde9c1c40c1fae11fd20d6e4dbd4223eec47a8d Mon Sep 17 00:00:00 2001 From: ton Date: Wed, 3 Jun 2020 21:47:47 +0400 Subject: [PATCH] minor bugfix --- crypto/func/test/a12_1.fc | 3 ++- crypto/func/test/a12_2.fc | 3 ++- crypto/func/test/a12_3.fc | 1 + crypto/func/test/a12_4.fc | 1 + crypto/func/test/a12_5.fc | 1 + crypto/func/test/a12_6.fc | 1 + crypto/func/test/a12_8.fc | 4 ++++ crypto/func/test/a12_9.fc | 4 ++++ validator/manager.cpp | 16 ++++++++-------- 9 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 crypto/func/test/a12_8.fc create mode 100644 crypto/func/test/a12_9.fc diff --git a/crypto/func/test/a12_1.fc b/crypto/func/test/a12_1.fc index 45c97ee5f..2f59e07e7 100644 --- a/crypto/func/test/a12_1.fc +++ b/crypto/func/test/a12_1.fc @@ -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 } diff --git a/crypto/func/test/a12_2.fc b/crypto/func/test/a12_2.fc index 8ee93d273..7c60c6fd5 100644 --- a/crypto/func/test/a12_2.fc +++ b/crypto/func/test/a12_2.fc @@ -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 } diff --git a/crypto/func/test/a12_3.fc b/crypto/func/test/a12_3.fc index faa5c9c20..86b3409a9 100644 --- a/crypto/func/test/a12_3.fc +++ b/crypto/func/test/a12_3.fc @@ -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 } diff --git a/crypto/func/test/a12_4.fc b/crypto/func/test/a12_4.fc index bf0d797eb..a4132917c 100644 --- a/crypto/func/test/a12_4.fc +++ b/crypto/func/test/a12_4.fc @@ -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 } diff --git a/crypto/func/test/a12_5.fc b/crypto/func/test/a12_5.fc index 4c7235801..277308a17 100644 --- a/crypto/func/test/a12_5.fc +++ b/crypto/func/test/a12_5.fc @@ -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 } diff --git a/crypto/func/test/a12_6.fc b/crypto/func/test/a12_6.fc index 49982541d..01f7a5862 100644 --- a/crypto/func/test/a12_6.fc +++ b/crypto/func/test/a12_6.fc @@ -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 } diff --git a/crypto/func/test/a12_8.fc b/crypto/func/test/a12_8.fc new file mode 100644 index 000000000..054ae81d5 --- /dev/null +++ b/crypto/func/test/a12_8.fc @@ -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 +} diff --git a/crypto/func/test/a12_9.fc b/crypto/func/test/a12_9.fc new file mode 100644 index 000000000..cd5789e24 --- /dev/null +++ b/crypto/func/test/a12_9.fc @@ -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 +} diff --git a/validator/manager.cpp b/validator/manager.cpp index 3d711550c..dcd3f89ba 100644 --- a/validator/manager.cpp +++ b/validator/manager.cpp @@ -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()) { @@ -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_; }