payload: {"action":"created","comment":{"url":"https://api.github.com/repos/EOSIO/eos/pulls/comments/299693893","pull_request_review_id":257161319,"id":299693893,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5OTY5Mzg5Mw==","diff_hunk":"@@ -341,7 +343,14 @@ fc::variant push_transaction( signed_transaction& trx, packed_transaction::compr\n    }\n \n    if (!tx_dont_broadcast) {\n-      return call(push_txn_func, packed_transaction(trx, compression));\n+      bool send_txn_func_supported = true;\n+      if (info.server_version_string) {\n+        int major, minor;\n+        if (sscanf(info.server_version_string->c_str(), \"v%d.%d\", &major, &minor) == 2) {","path":"programs/cleos/main.cpp","position":24,"original_position":24,"commit_id":"ff15f0e2b07ea8f06e40d7033cd4d95597a5fccb","original_commit_id":"ff15f0e2b07ea8f06e40d7033cd4d95597a5fccb","user":{"login":"arhag","id":8333406,"node_id":"MDQ6VXNlcjgzMzM0MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/8333406?v=4","gravatar_id":"","url":"https://api.github.com/users/arhag","html_url":"https://github.com/arhag","followers_url":"https://api.github.com/users/arhag/followers","following_url":"https://api.github.com/users/arhag/following{/other_user}","gists_url":"https://api.github.com/users/arhag/gists{/gist_id}","starred_url":"https://api.github.com/users/arhag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arhag/subscriptions","organizations_url":"https://api.github.com/users/arhag/orgs","repos_url":"https://api.github.com/users/arhag/repos","events_url":"https://api.github.com/users/arhag/events{/privacy}","received_events_url":"https://api.github.com/users/arhag/received_events","type":"User","site_admin":false},"body":"I agree with @spoonincode. Furthermore, there is a good reason not to change which RPC is called due to reasons outside of the users control (the reported version of the node cleos talks to is outside the user's control), because the different RPCs return slightly different traces.\r\n\r\nThe code should simply use `push_txn_func` when `tx_use_old_rpc` is true; otherwise it should use ``send_txn_func`.\r\n\r\nHowever, it would be good to go further and recognize if the call to `send_txn_func` failed because the endpoint wasn't recognized, and instead provide the user with a more meaningful error message that recommends they use the `--use-old-rpc` option.","created_at":"2019-07-02T21:32:30Z","updated_at":"2019-07-02T21:32:31Z","html_url":"https://github.com/EOSIO/eos/pull/7585#discussion_r299693893","pull_request_url":"https://api.github.com/repos/EOSIO/eos/pulls/7585","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/comments/299693893"},"html":{"href":"https://github.com/EOSIO/eos/pull/7585#discussion_r299693893"},"pull_request":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/7585"}},"in_reply_to_id":299484790},"pull_request":{"url":"https://api.github.com/repos/EOSIO/eos/pulls/7585","id":293657881,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkzNjU3ODgx","html_url":"https://github.com/EOSIO/eos/pull/7585","diff_url":"https://github.com/EOSIO/eos/pull/7585.diff","patch_url":"https://github.com/EOSIO/eos/pull/7585.patch","issue_url":"https://api.github.com/repos/EOSIO/eos/issues/7585","number":7585,"state":"open","locked":false,"title":"Enhance cleos to enable new RPC send_transaction","user":{"login":"aaron-fu-block-one","id":51936236,"node_id":"MDQ6VXNlcjUxOTM2MjM2","avatar_url":"https://avatars3.githubusercontent.com/u/51936236?v=4","gravatar_id":"","url":"https://api.github.com/users/aaron-fu-block-one","html_url":"https://github.com/aaron-fu-block-one","followers_url":"https://api.github.com/users/aaron-fu-block-one/followers","following_url":"https://api.github.com/users/aaron-fu-block-one/following{/other_user}","gists_url":"https://api.github.com/users/aaron-fu-block-one/gists{/gist_id}","starred_url":"https://api.github.com/users/aaron-fu-block-one/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaron-fu-block-one/subscriptions","organizations_url":"https://api.github.com/users/aaron-fu-block-one/orgs","repos_url":"https://api.github.com/users/aaron-fu-block-one/repos","events_url":"https://api.github.com/users/aaron-fu-block-one/events{/privacy}","received_events_url":"https://api.github.com/users/aaron-fu-block-one/received_events","type":"User","site_admin":false},"body":"<!-- PLEASE FILL OUT THE FOLLOWING MARKDOWN TEMPLATE -->\r\n<!-- PR title alone should be sufficient to understand changes. -->\r\n\r\n## Change Description\r\n<!-- Describe your changes, their justification, AND their impact. Reference issues or pull requests where possible (use '#XX' or 'GH-XX' where XX is the issue or pull request number). -->\r\n\r\nWith regard to issue #7536, enhance `cleos` so as to enable `send_transaction`, an RPC newly introduced in  EOSIO `v1.8`.\r\n\r\nChanges are made to `programs/cleos/main.cpp` and `programs/cleos/httpc.hpp`.\r\n\r\n**Background**\r\n\r\n- For versions `v1.8` or after, both RPC `send_transaction` and `push_transaction` are supported.\r\n- For versions before `v1.8`, only RPC `push_transaction` is supported.\r\n- RPC `send_transaction` and `push_transaction` are almost the same, except the traces they return, which can be viewed in JSON format by adding a `-j` option in the command calling them.\r\n\r\n**Flow Control**\r\n\r\n- Users can enforce always using old RPC `push_transaction` by adding a flag `--use-old-rpc`.\r\n- Otherwise, which RPC will be called depends on the current `nodeos` version:\r\n    - If the `nodeos` version is between `v1.0` and `v1.7`, call old RPC `push_transaction`;\r\n    - Otherwise, call new RPC `send_transaction`.\r\n\r\n**Test**\r\n\r\nHave tested behavior such as `create account`, `issue` and `transfer` for `nodeos` version `v1.8.0` and version `v1.7.4`.\r\n\r\n**Sidenote**\r\n\r\nIn `programs/cleos/main.cpp` there is a `void send_transaction(...)` function, which, according to @arhag in issue #7536, is simply ***unrelated*** to this topic. Just ignore it.\r\n\r\n\r\n\r\n## Consensus Changes\r\n- [ ] Consensus Changes\r\n<!-- checked [x] = Consensus changes; unchecked [ ] = no changes, ignore this section -->\r\n<!-- If this PR introduces a change to the validation of blocks in the chain or consensus in general, please describe the impact. -->\r\n\r\n\r\n## API Changes\r\n- [ ] API Changes\r\n<!-- checked [x] = API changes; unchecked [ ] = no changes, ignore this section -->\r\n<!-- If this PR introduces API changes, please describe the changes here. What will developers need to know before upgrading to this version? -->\r\n\r\n\r\n## Documentation Additions\r\n- [ ] Documentation Additions\r\n<!-- checked [x] = Documentation changes; unchecked [ ] = no changes, ignore this section -->\r\n<!-- Describe what must be added to the documentation after merge. -->\r\n","created_at":"2019-07-02T09:17:27Z","updated_at":"2019-07-02T21:32:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f660c3515bb2bcd6ba1df3c25a8e3eb8163df45a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/EOSIO/eos/pulls/7585/commits","review_comments_url":"https://api.github.com/repos/EOSIO/eos/pulls/7585/comments","review_comment_url":"https://api.github.com/repos/EOSIO/eos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EOSIO/eos/issues/7585/comments","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/ff15f0e2b07ea8f06e40d7033cd4d95597a5fccb","head":{"label":"EOSIO:aaron-fu-enhance-push-txn","ref":"aaron-fu-enhance-push-txn","sha":"ff15f0e2b07ea8f06e40d7033cd4d95597a5fccb","user":{"login":"EOSIO","id":26932212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTMyMjEy","avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"repo":{"id":87335980,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzNTk4MA==","name":"eos","full_name":"EOSIO/eos","private":false,"owner":{"login":"EOSIO","id":26932212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTMyMjEy","avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/EOSIO/eos","description":"An open source smart contract platform ","fork":false,"url":"https://api.github.com/repos/EOSIO/eos","forks_url":"https://api.github.com/repos/EOSIO/eos/forks","keys_url":"https://api.github.com/repos/EOSIO/eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EOSIO/eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EOSIO/eos/teams","hooks_url":"https://api.github.com/repos/EOSIO/eos/hooks","issue_events_url":"https://api.github.com/repos/EOSIO/eos/issues/events{/number}","events_url":"https://api.github.com/repos/EOSIO/eos/events","assignees_url":"https://api.github.com/repos/EOSIO/eos/assignees{/user}","branches_url":"https://api.github.com/repos/EOSIO/eos/branches{/branch}","tags_url":"https://api.github.com/repos/EOSIO/eos/tags","blobs_url":"https://api.github.com/repos/EOSIO/eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EOSIO/eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EOSIO/eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/EOSIO/eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/{sha}","languages_url":"https://api.github.com/repos/EOSIO/eos/languages","stargazers_url":"https://api.github.com/repos/EOSIO/eos/stargazers","contributors_url":"https://api.github.com/repos/EOSIO/eos/contributors","subscribers_url":"https://api.github.com/repos/EOSIO/eos/subscribers","subscription_url":"https://api.github.com/repos/EOSIO/eos/subscription","commits_url":"https://api.github.com/repos/EOSIO/eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/EOSIO/eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/EOSIO/eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/EOSIO/eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/EOSIO/eos/contents/{+path}","compare_url":"https://api.github.com/repos/EOSIO/eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EOSIO/eos/merges","archive_url":"https://api.github.com/repos/EOSIO/eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EOSIO/eos/downloads","issues_url":"https://api.github.com/repos/EOSIO/eos/issues{/number}","pulls_url":"https://api.github.com/repos/EOSIO/eos/pulls{/number}","milestones_url":"https://api.github.com/repos/EOSIO/eos/milestones{/number}","notifications_url":"https://api.github.com/repos/EOSIO/eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EOSIO/eos/labels{/name}","releases_url":"https://api.github.com/repos/EOSIO/eos/releases{/id}","deployments_url":"https://api.github.com/repos/EOSIO/eos/deployments","created_at":"2017-04-05T17:09:53Z","updated_at":"2019-07-02T20:48:12Z","pushed_at":"2019-07-02T19:36:49Z","git_url":"git://github.com/EOSIO/eos.git","ssh_url":"git@github.com:EOSIO/eos.git","clone_url":"https://github.com/EOSIO/eos.git","svn_url":"https://github.com/EOSIO/eos","homepage":"https://developers.eos.io/","size":120696,"stargazers_count":10480,"watchers_count":10480,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3280,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":258,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3280,"open_issues":258,"watchers":10480,"default_branch":"master"}},"base":{"label":"EOSIO:develop","ref":"develop","sha":"deff9d53e6b930b9a819b38b6e65a6e80110bd75","user":{"login":"EOSIO","id":26932212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTMyMjEy","avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"repo":{"id":87335980,"node_id":"MDEwOlJlcG9zaXRvcnk4NzMzNTk4MA==","name":"eos","full_name":"EOSIO/eos","private":false,"owner":{"login":"EOSIO","id":26932212,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2OTMyMjEy","avatar_url":"https://avatars2.githubusercontent.com/u/26932212?v=4","gravatar_id":"","url":"https://api.github.com/users/EOSIO","html_url":"https://github.com/EOSIO","followers_url":"https://api.github.com/users/EOSIO/followers","following_url":"https://api.github.com/users/EOSIO/following{/other_user}","gists_url":"https://api.github.com/users/EOSIO/gists{/gist_id}","starred_url":"https://api.github.com/users/EOSIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EOSIO/subscriptions","organizations_url":"https://api.github.com/users/EOSIO/orgs","repos_url":"https://api.github.com/users/EOSIO/repos","events_url":"https://api.github.com/users/EOSIO/events{/privacy}","received_events_url":"https://api.github.com/users/EOSIO/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/EOSIO/eos","description":"An open source smart contract platform ","fork":false,"url":"https://api.github.com/repos/EOSIO/eos","forks_url":"https://api.github.com/repos/EOSIO/eos/forks","keys_url":"https://api.github.com/repos/EOSIO/eos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EOSIO/eos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EOSIO/eos/teams","hooks_url":"https://api.github.com/repos/EOSIO/eos/hooks","issue_events_url":"https://api.github.com/repos/EOSIO/eos/issues/events{/number}","events_url":"https://api.github.com/repos/EOSIO/eos/events","assignees_url":"https://api.github.com/repos/EOSIO/eos/assignees{/user}","branches_url":"https://api.github.com/repos/EOSIO/eos/branches{/branch}","tags_url":"https://api.github.com/repos/EOSIO/eos/tags","blobs_url":"https://api.github.com/repos/EOSIO/eos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EOSIO/eos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EOSIO/eos/git/refs{/sha}","trees_url":"https://api.github.com/repos/EOSIO/eos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EOSIO/eos/statuses/{sha}","languages_url":"https://api.github.com/repos/EOSIO/eos/languages","stargazers_url":"https://api.github.com/repos/EOSIO/eos/stargazers","contributors_url":"https://api.github.com/repos/EOSIO/eos/contributors","subscribers_url":"https://api.github.com/repos/EOSIO/eos/subscribers","subscription_url":"https://api.github.com/repos/EOSIO/eos/subscription","commits_url":"https://api.github.com/repos/EOSIO/eos/commits{/sha}","git_commits_url":"https://api.github.com/repos/EOSIO/eos/git/commits{/sha}","comments_url":"https://api.github.com/repos/EOSIO/eos/comments{/number}","issue_comment_url":"https://api.github.com/repos/EOSIO/eos/issues/comments{/number}","contents_url":"https://api.github.com/repos/EOSIO/eos/contents/{+path}","compare_url":"https://api.github.com/repos/EOSIO/eos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EOSIO/eos/merges","archive_url":"https://api.github.com/repos/EOSIO/eos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EOSIO/eos/downloads","issues_url":"https://api.github.com/repos/EOSIO/eos/issues{/number}","pulls_url":"https://api.github.com/repos/EOSIO/eos/pulls{/number}","milestones_url":"https://api.github.com/repos/EOSIO/eos/milestones{/number}","notifications_url":"https://api.github.com/repos/EOSIO/eos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EOSIO/eos/labels{/name}","releases_url":"https://api.github.com/repos/EOSIO/eos/releases{/id}","deployments_url":"https://api.github.com/repos/EOSIO/eos/deployments","created_at":"2017-04-05T17:09:53Z","updated_at":"2019-07-02T20:48:12Z","pushed_at":"2019-07-02T19:36:49Z","git_url":"git://github.com/EOSIO/eos.git","ssh_url":"git@github.com:EOSIO/eos.git","clone_url":"https://github.com/EOSIO/eos.git","svn_url":"https://github.com/EOSIO/eos","homepage":"https://developers.eos.io/","size":120696,"stargazers_count":10480,"watchers_count":10480,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3280,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":258,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":3280,"open_issues":258,"watchers":10480,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/7585"},"html":{"href":"https://github.com/EOSIO/eos/pull/7585"},"issue":{"href":"https://api.github.com/repos/EOSIO/eos/issues/7585"},"comments":{"href":"https://api.github.com/repos/EOSIO/eos/issues/7585/comments"},"review_comments":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/7585/comments"},"review_comment":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EOSIO/eos/pulls/7585/commits"},"statuses":{"href":"https://api.github.com/repos/EOSIO/eos/statuses/ff15f0e2b07ea8f06e40d7033cd4d95597a5fccb"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"arhag"}}