{"action":"created","issue":{"url":"https://api.github.com/repos/ethcore/parity/issues/559","repository_url":"https://api.github.com/repos/ethcore/parity","labels_url":"https://api.github.com/repos/ethcore/parity/issues/559/labels{/name}","comments_url":"https://api.github.com/repos/ethcore/parity/issues/559/comments","events_url":"https://api.github.com/repos/ethcore/parity/issues/559/events","html_url":"https://github.com/ethcore/parity/pull/559","id":137685090,"number":559,"title":"TransactionsQueue implementation","user":{"login":"tomusdrw","id":581548,"avatar_url":"https://avatars.githubusercontent.com/u/581548?v=3","gravatar_id":"","url":"https://api.github.com/users/tomusdrw","html_url":"https://github.com/tomusdrw","followers_url":"https://api.github.com/users/tomusdrw/followers","following_url":"https://api.github.com/users/tomusdrw/following{/other_user}","gists_url":"https://api.github.com/users/tomusdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/tomusdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomusdrw/subscriptions","organizations_url":"https://api.github.com/users/tomusdrw/orgs","repos_url":"https://api.github.com/users/tomusdrw/repos","events_url":"https://api.github.com/users/tomusdrw/events{/privacy}","received_events_url":"https://api.github.com/users/tomusdrw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ethcore/parity/labels/A2-gotissues","name":"A2-gotissues","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-01T20:59:00Z","updated_at":"2016-03-04T11:41:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ethcore/parity/pulls/559","html_url":"https://github.com/ethcore/parity/pull/559","diff_url":"https://github.com/ethcore/parity/pull/559.diff","patch_url":"https://github.com/ethcore/parity/pull/559.patch"},"body":"TransactionQueue should allow to:\r\n- add a transaction (or list of transactions in batch)\r\n- remove a transaction (or list of transactions in batch)\r\n\r\nIf transaction's nonce matches `last known nonce+1` it should be placed to `current` queue. (`current` will always contain contigous set of transactions from some sender e.g. (Sender(A), Nonce(1..3)))\r\nIf transaction's nonce is greater then `expected+1` it will be put to `future` queue.\r\n\r\nWhenever nonces gap is introduced transactions are moved to `future` accordingly. Whenever gap is filled transactions should be moved from `future` back to `current`\r\n\r\nBoth `future` and `current` are kept in PriorityQueue sorted by relative nonce height (distance between transaction's nonce and first nonce in `current` (in case of `current`) or last nonce in `current` (in case of `future`). If that height is equal transactions are sorted by `gas price` and later by `nonce` (low nonces have more priority) and `sender`)"},"comment":{"url":"https://api.github.com/repos/ethcore/parity/issues/comments/192247363","html_url":"https://github.com/ethcore/parity/pull/559#issuecomment-192247363","issue_url":"https://api.github.com/repos/ethcore/parity/issues/559","id":192247363,"user":{"login":"tomusdrw","id":581548,"avatar_url":"https://avatars.githubusercontent.com/u/581548?v=3","gravatar_id":"","url":"https://api.github.com/users/tomusdrw","html_url":"https://github.com/tomusdrw","followers_url":"https://api.github.com/users/tomusdrw/followers","following_url":"https://api.github.com/users/tomusdrw/following{/other_user}","gists_url":"https://api.github.com/users/tomusdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/tomusdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomusdrw/subscriptions","organizations_url":"https://api.github.com/users/tomusdrw/orgs","repos_url":"https://api.github.com/users/tomusdrw/repos","events_url":"https://api.github.com/users/tomusdrw/events{/privacy}","received_events_url":"https://api.github.com/users/tomusdrw/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T11:41:18Z","updated_at":"2016-03-04T11:41:18Z","body":"Known logical issues:\r\n1. First transaction will have nonce:0, but state returns nonce:0 also when there hasn't been any transactions from particular sender. Should be handled.\r\n2. Nonce height in current should be recalculated when transactions are removed.\r\n3. No way to \"consume\" transactions (take some from current without moving subsequent to future) - not sure how to implement that."}}