{"action":"created","comment":{"url":"https://api.github.com/repos/hyperledger/iroha/pulls/comments/239392835","pull_request_review_id":182162168,"id":239392835,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTM5MjgzNQ==","diff_hunk":"@@ -171,38 +172,62 @@ namespace iroha {\n             proposal_factory,\n         std::shared_ptr<ametsuchi::TxPresenceCache> tx_cache,\n         consensus::Round initial_round) {\n+      auto delay = [reject_counter = static_cast<uint64_t>(0),\n+                    local_counter =\n+                        static_cast<uint64_t>(0)](const auto &commit) mutable {\n+        using iroha::synchronizer::SynchronizationOutcomeType;\n+        if (commit.sync_outcome == SynchronizationOutcomeType::kReject\n+            or commit.sync_outcome == SynchronizationOutcomeType::kNothing) {\n+          if (local_counter++ == 2) {\n+            local_counter = 0;\n+            if (reject_counter < std::numeric_limits<uint64_t>::max()) {\n+              reject_counter++;\n+            }\n+          }\n+        } else {\n+          reject_counter = 0;\n+        }\n+        return std::chrono::seconds(reject_counter);\n+      };\n+\n+      auto map = [](auto commit) {\n+        return matchEvent(\n+            commit,\n+            [](const auto &commit)\n+                -> ordering::OnDemandOrderingGate::BlockRoundEventType {\n+              ordering::cache::OrderingGateCache::HashesSetType hashes;\n+              commit.synced_blocks.as_blocking().subscribe(\n+                  [&hashes](const auto &block) {\n+                    const auto &committed = block->transactions();\n+                    std::transform(committed.begin(),\n+                                   committed.end(),\n+                                   std::inserter(hashes, hashes.end()),\n+                                   [](const auto &transaction) {\n+                                     return transaction.hash();\n+                                   });\n+                    const auto &rejected =\n+                        block->rejected_transactions_hashes();\n+                    std::copy(rejected.begin(),\n+                              rejected.end(),\n+                              std::inserter(hashes, hashes.end()));\n+                  });\n+              return ordering::OnDemandOrderingGate::BlockEvent{commit.round,\n+                                                                hashes};\n+            },\n+            [](const auto &)\n+                -> ordering::OnDemandOrderingGate::BlockRoundEventType {\n+              return ordering::OnDemandOrderingGate::EmptyEvent{};\n+            });\n+      };\n+\n       return std::make_shared<ordering::OnDemandOrderingGate>(\n           std::move(ordering_service),\n           std::move(network_client),\n-          notifier.get_observable().map([](auto commit) {\n-            return matchEvent(\n-                commit,\n-                [](const auto &commit)\n-                    -> ordering::OnDemandOrderingGate::BlockRoundEventType {\n-                  ordering::cache::OrderingGateCache::HashesSetType hashes;\n-                  commit.synced_blocks.as_blocking().subscribe(\n-                      [&hashes](const auto &block) {\n-                        const auto &committed = block->transactions();\n-                        std::transform(committed.begin(),\n-                                       committed.end(),\n-                                       std::inserter(hashes, hashes.end()),\n-                                       [](const auto &transaction) {\n-                                         return transaction.hash();\n-                                       });\n-                        const auto &rejected =\n-                            block->rejected_transactions_hashes();\n-                        std::copy(rejected.begin(),\n-                                  rejected.end(),\n-                                  std::inserter(hashes, hashes.end()));\n-                      });\n-                  return ordering::OnDemandOrderingGate::BlockEvent{\n-                      commit.round, hashes};\n-                },\n-                [](const auto &)\n-                    -> ordering::OnDemandOrderingGate::BlockRoundEventType {\n-                  return ordering::OnDemandOrderingGate::EmptyEvent{};\n-                });\n-          }),\n+          notifier.get_observable()\n+              .lift<iroha::synchronizer::SynchronizationEvent>(\n+                  iroha::makeDelay<iroha::synchronizer::SynchronizationEvent>(\n+                      delay, rxcpp::identity_current_thread()))\n+              .map(map),","path":"irohad/main/impl/on_demand_ordering_init.cpp","position":96,"original_position":96,"commit_id":"d4f87665e8d1c8c1d81a4e95a61a656e0d207457","original_commit_id":"d4f87665e8d1c8c1d81a4e95a61a656e0d207457","user":{"login":"lebdron","id":14347159,"node_id":"MDQ6VXNlcjE0MzQ3MTU5","avatar_url":"https://avatars1.githubusercontent.com/u/14347159?v=4","gravatar_id":"","url":"https://api.github.com/users/lebdron","html_url":"https://github.com/lebdron","followers_url":"https://api.github.com/users/lebdron/followers","following_url":"https://api.github.com/users/lebdron/following{/other_user}","gists_url":"https://api.github.com/users/lebdron/gists{/gist_id}","starred_url":"https://api.github.com/users/lebdron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lebdron/subscriptions","organizations_url":"https://api.github.com/users/lebdron/orgs","repos_url":"https://api.github.com/users/lebdron/repos","events_url":"https://api.github.com/users/lebdron/events{/privacy}","received_events_url":"https://api.github.com/users/lebdron/received_events","type":"User","site_admin":false},"body":"`on_next` caller thread of `notifier`.","created_at":"2018-12-06T10:05:27Z","updated_at":"2018-12-06T10:05:27Z","html_url":"https://github.com/hyperledger/iroha/pull/1914#discussion_r239392835","pull_request_url":"https://api.github.com/repos/hyperledger/iroha/pulls/1914","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/comments/239392835"},"html":{"href":"https://github.com/hyperledger/iroha/pull/1914#discussion_r239392835"},"pull_request":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/1914"}},"in_reply_to_id":239386430},"pull_request":{"url":"https://api.github.com/repos/hyperledger/iroha/pulls/1914","id":236162696,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2MTYyNjk2","html_url":"https://github.com/hyperledger/iroha/pull/1914","diff_url":"https://github.com/hyperledger/iroha/pull/1914.diff","patch_url":"https://github.com/hyperledger/iroha/pull/1914.patch","issue_url":"https://api.github.com/repos/hyperledger/iroha/issues/1914","number":1914,"state":"open","locked":false,"title":"Enable system test","user":{"login":"lebdron","id":14347159,"node_id":"MDQ6VXNlcjE0MzQ3MTU5","avatar_url":"https://avatars1.githubusercontent.com/u/14347159?v=4","gravatar_id":"","url":"https://api.github.com/users/lebdron","html_url":"https://github.com/lebdron","followers_url":"https://api.github.com/users/lebdron/followers","following_url":"https://api.github.com/users/lebdron/following{/other_user}","gists_url":"https://api.github.com/users/lebdron/gists{/gist_id}","starred_url":"https://api.github.com/users/lebdron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lebdron/subscriptions","organizations_url":"https://api.github.com/users/lebdron/orgs","repos_url":"https://api.github.com/users/lebdron/repos","events_url":"https://api.github.com/users/lebdron/events{/privacy}","received_events_url":"https://api.github.com/users/lebdron/received_events","type":"User","site_admin":false},"body":"<!-- You will not see HTML commented line in Pull Request body -->\r\n<!-- Optional sections may be omitted. Just remove them or write None -->\r\n\r\n<!-- ### Requirements -->\r\n<!-- * Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion. -->\r\n<!-- * All new code must have code coverage above 70% (https://docs.codecov.io/docs/about-code-coverage). -->\r\n<!-- * CircleCI builds must be passed. -->\r\n<!-- * Critical and blocker issues reported by Sorabot must be fixed. -->\r\n<!-- * Branch must be rebased onto base branch (https://soramitsu.atlassian.net/wiki/spaces/IS/pages/11173889/Rebase+and+merge+guide). -->\r\n\r\n\r\n### Description of the Change\r\nEnable irohad system test\r\n- Pass boost::none instead of empty proposal\r\n- Use delay to reduce the number of reject rounds\r\n<!-- We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. -->\r\n<!-- Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts. -->\r\n\r\n### Benefits\r\nWorking OS\r\n<!-- What benefits will be realized by the code change? -->\r\n\r\n### Possible Drawbacks \r\nYet to discover\r\n<!-- What are the possible side-effects or negative impacts of the code change? -->\r\n<!-- If no drawbacks, explicitly mention this (write None) -->\r\n","created_at":"2018-12-05T12:51:04Z","updated_at":"2018-12-06T10:05:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"99d444cb385a2003d84fbaf5fe4ab14c40e89c7e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hyperledger/iroha/pulls/1914/commits","review_comments_url":"https://api.github.com/repos/hyperledger/iroha/pulls/1914/comments","review_comment_url":"https://api.github.com/repos/hyperledger/iroha/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyperledger/iroha/issues/1914/comments","statuses_url":"https://api.github.com/repos/hyperledger/iroha/statuses/d4f87665e8d1c8c1d81a4e95a61a656e0d207457","head":{"label":"hyperledger:fix/enable-system-test","ref":"fix/enable-system-test","sha":"d4f87665e8d1c8c1d81a4e95a61a656e0d207457","user":{"login":"hyperledger","id":7657900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2NTc5MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":67340575,"node_id":"MDEwOlJlcG9zaXRvcnk2NzM0MDU3NQ==","name":"iroha","full_name":"hyperledger/iroha","private":false,"owner":{"login":"hyperledger","id":7657900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2NTc5MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hyperledger/iroha","description":"Iroha - A simple, decentralized ledger","fork":false,"url":"https://api.github.com/repos/hyperledger/iroha","forks_url":"https://api.github.com/repos/hyperledger/iroha/forks","keys_url":"https://api.github.com/repos/hyperledger/iroha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/iroha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/iroha/teams","hooks_url":"https://api.github.com/repos/hyperledger/iroha/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/iroha/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/iroha/events","assignees_url":"https://api.github.com/repos/hyperledger/iroha/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/iroha/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/iroha/tags","blobs_url":"https://api.github.com/repos/hyperledger/iroha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/iroha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/iroha/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/iroha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/iroha/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/iroha/languages","stargazers_url":"https://api.github.com/repos/hyperledger/iroha/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/iroha/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/iroha/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/iroha/subscription","commits_url":"https://api.github.com/repos/hyperledger/iroha/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/iroha/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/iroha/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/iroha/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/iroha/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/iroha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/iroha/merges","archive_url":"https://api.github.com/repos/hyperledger/iroha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/iroha/downloads","issues_url":"https://api.github.com/repos/hyperledger/iroha/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/iroha/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/iroha/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/iroha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/iroha/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/iroha/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/iroha/deployments","created_at":"2016-09-04T11:17:53Z","updated_at":"2018-12-03T01:49:37Z","pushed_at":"2018-12-06T10:00:42Z","git_url":"git://github.com/hyperledger/iroha.git","ssh_url":"git@github.com:hyperledger/iroha.git","clone_url":"https://github.com/hyperledger/iroha.git","svn_url":"https://github.com/hyperledger/iroha","homepage":"http://iroha.tech","size":52175,"stargazers_count":977,"watchers_count":977,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":306,"mirror_url":null,"archived":false,"open_issues_count":66,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":306,"open_issues":66,"watchers":977,"default_branch":"master"}},"base":{"label":"hyperledger:trunk/bft-os-integration","ref":"trunk/bft-os-integration","sha":"8192360b29724b1421bf1125cd89c4d879d3a184","user":{"login":"hyperledger","id":7657900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2NTc5MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"repo":{"id":67340575,"node_id":"MDEwOlJlcG9zaXRvcnk2NzM0MDU3NQ==","name":"iroha","full_name":"hyperledger/iroha","private":false,"owner":{"login":"hyperledger","id":7657900,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc2NTc5MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/7657900?v=4","gravatar_id":"","url":"https://api.github.com/users/hyperledger","html_url":"https://github.com/hyperledger","followers_url":"https://api.github.com/users/hyperledger/followers","following_url":"https://api.github.com/users/hyperledger/following{/other_user}","gists_url":"https://api.github.com/users/hyperledger/gists{/gist_id}","starred_url":"https://api.github.com/users/hyperledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyperledger/subscriptions","organizations_url":"https://api.github.com/users/hyperledger/orgs","repos_url":"https://api.github.com/users/hyperledger/repos","events_url":"https://api.github.com/users/hyperledger/events{/privacy}","received_events_url":"https://api.github.com/users/hyperledger/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/hyperledger/iroha","description":"Iroha - A simple, decentralized ledger","fork":false,"url":"https://api.github.com/repos/hyperledger/iroha","forks_url":"https://api.github.com/repos/hyperledger/iroha/forks","keys_url":"https://api.github.com/repos/hyperledger/iroha/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyperledger/iroha/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyperledger/iroha/teams","hooks_url":"https://api.github.com/repos/hyperledger/iroha/hooks","issue_events_url":"https://api.github.com/repos/hyperledger/iroha/issues/events{/number}","events_url":"https://api.github.com/repos/hyperledger/iroha/events","assignees_url":"https://api.github.com/repos/hyperledger/iroha/assignees{/user}","branches_url":"https://api.github.com/repos/hyperledger/iroha/branches{/branch}","tags_url":"https://api.github.com/repos/hyperledger/iroha/tags","blobs_url":"https://api.github.com/repos/hyperledger/iroha/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyperledger/iroha/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyperledger/iroha/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyperledger/iroha/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyperledger/iroha/statuses/{sha}","languages_url":"https://api.github.com/repos/hyperledger/iroha/languages","stargazers_url":"https://api.github.com/repos/hyperledger/iroha/stargazers","contributors_url":"https://api.github.com/repos/hyperledger/iroha/contributors","subscribers_url":"https://api.github.com/repos/hyperledger/iroha/subscribers","subscription_url":"https://api.github.com/repos/hyperledger/iroha/subscription","commits_url":"https://api.github.com/repos/hyperledger/iroha/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyperledger/iroha/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyperledger/iroha/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyperledger/iroha/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyperledger/iroha/contents/{+path}","compare_url":"https://api.github.com/repos/hyperledger/iroha/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyperledger/iroha/merges","archive_url":"https://api.github.com/repos/hyperledger/iroha/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyperledger/iroha/downloads","issues_url":"https://api.github.com/repos/hyperledger/iroha/issues{/number}","pulls_url":"https://api.github.com/repos/hyperledger/iroha/pulls{/number}","milestones_url":"https://api.github.com/repos/hyperledger/iroha/milestones{/number}","notifications_url":"https://api.github.com/repos/hyperledger/iroha/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyperledger/iroha/labels{/name}","releases_url":"https://api.github.com/repos/hyperledger/iroha/releases{/id}","deployments_url":"https://api.github.com/repos/hyperledger/iroha/deployments","created_at":"2016-09-04T11:17:53Z","updated_at":"2018-12-03T01:49:37Z","pushed_at":"2018-12-06T10:00:42Z","git_url":"git://github.com/hyperledger/iroha.git","ssh_url":"git@github.com:hyperledger/iroha.git","clone_url":"https://github.com/hyperledger/iroha.git","svn_url":"https://github.com/hyperledger/iroha","homepage":"http://iroha.tech","size":52175,"stargazers_count":977,"watchers_count":977,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":306,"mirror_url":null,"archived":false,"open_issues_count":66,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":306,"open_issues":66,"watchers":977,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/1914"},"html":{"href":"https://github.com/hyperledger/iroha/pull/1914"},"issue":{"href":"https://api.github.com/repos/hyperledger/iroha/issues/1914"},"comments":{"href":"https://api.github.com/repos/hyperledger/iroha/issues/1914/comments"},"review_comments":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/1914/comments"},"review_comment":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyperledger/iroha/pulls/1914/commits"},"statuses":{"href":"https://api.github.com/repos/hyperledger/iroha/statuses/d4f87665e8d1c8c1d81a4e95a61a656e0d207457"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lebdron"}}