{"action":"created","issue":{"url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/87","labels_url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/87/comments","events_url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/87/events","html_url":"https://github.com/OmniLayer/OmniJ/issues/87","id":91667519,"number":87,"title":"Ability to sync blockheight among multiple servers for consensus tests.","user":{"login":"msgilligan","id":61612,"avatar_url":"https://avatars.githubusercontent.com/u/61612?v=3","gravatar_id":"","url":"https://api.github.com/users/msgilligan","html_url":"https://github.com/msgilligan","followers_url":"https://api.github.com/users/msgilligan/followers","following_url":"https://api.github.com/users/msgilligan/following{/other_user}","gists_url":"https://api.github.com/users/msgilligan/gists{/gist_id}","starred_url":"https://api.github.com/users/msgilligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgilligan/subscriptions","organizations_url":"https://api.github.com/users/msgilligan/orgs","repos_url":"https://api.github.com/users/msgilligan/repos","events_url":"https://api.github.com/users/msgilligan/events{/privacy}","received_events_url":"https://api.github.com/users/msgilligan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-29T01:53:31Z","updated_at":"2015-06-29T06:32:06Z","closed_at":null,"body":"Currently the Spock consensus tests use `BitcoinClient.waitForServer()` and `BitcoinClient.waitForBlock()` to make sure the Omni Core server being tested (usually on localhost) is warmed-up and in sync with the MainNet blockchain before the tests begin. The consensus test Specs contain an [explicit comparison test](https://github.com/OmniLayer/OmniJ/blob/master/omnij-rpc/src/integ/groovy/foundation/omni/test/consensus/BaseConsensusSpec.groovy#L36-L45) of the blockheight between the local server (`leftHeight`) and the remote (`rightHeight`) which will fail if the remote server is on a different block. No attempt is made at synchronizing the local and remote servers and there are frequent failures of this blockheight comparison as well as false positives on Omni account balance comparison due to blockheight differences.\r\n\r\nBecause the Jenkins tests are typically started by commits to the [omnicore](https://github.com/OmniLayer/omnicore) or OmniJ repositories and the consensus tests run against multiple remote servers, some of which are occasionally many blocks behind the MainNet current height, I have not considered it practical to try to sync the block heights between the different servers -- at least in the context of a Jenkins job -- or even in the case of a developer running the Spock consensus tests (via command-line or IDE).\r\n\r\nI have given serious thought to writing a continuously-running consensus-validating server that could *cache* consensus data from multiple Omni server implementations and do comparisons with matching blockheights whenever each server reaches a new block. This consensus-validating server is not something that is in my near term plans, however.\r\n\r\nI created this issue to address @dexX7's request for this capability in [a comment](https://github.com/OmniLayer/OmniJ/issues/74#issuecomment-116365949) on Issue #74 and to give us a place to discuss possible solutions including the idea of a consensus-validating server."},"comment":{"url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/comments/116476856","html_url":"https://github.com/OmniLayer/OmniJ/issues/87#issuecomment-116476856","issue_url":"https://api.github.com/repos/OmniLayer/OmniJ/issues/87","id":116476856,"user":{"login":"msgilligan","id":61612,"avatar_url":"https://avatars.githubusercontent.com/u/61612?v=3","gravatar_id":"","url":"https://api.github.com/users/msgilligan","html_url":"https://github.com/msgilligan","followers_url":"https://api.github.com/users/msgilligan/followers","following_url":"https://api.github.com/users/msgilligan/following{/other_user}","gists_url":"https://api.github.com/users/msgilligan/gists{/gist_id}","starred_url":"https://api.github.com/users/msgilligan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msgilligan/subscriptions","organizations_url":"https://api.github.com/users/msgilligan/orgs","repos_url":"https://api.github.com/users/msgilligan/repos","events_url":"https://api.github.com/users/msgilligan/events{/privacy}","received_events_url":"https://api.github.com/users/msgilligan/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T06:32:06Z","updated_at":"2015-06-29T06:32:06Z","body":"> Such a server shouldn't be used as reference.\r\n\r\nThe worst offender was Chest, but @zathras-crypto  moved it to a bigger instance and it is now only intermittently 1 block behind. It is the only public Chest implementation and the tests are run more to check Chest than anything else. I suppose this could be viewed as an argument for splitting off the consensus tests of local Omni vs. remote Chest into a separate task/job."}}