{"action":"created","issue":{"url":"https://api.github.com/repos/paritytech/parity/issues/6342","repository_url":"https://api.github.com/repos/paritytech/parity","labels_url":"https://api.github.com/repos/paritytech/parity/issues/6342/labels{/name}","comments_url":"https://api.github.com/repos/paritytech/parity/issues/6342/comments","events_url":"https://api.github.com/repos/paritytech/parity/issues/6342/events","html_url":"https://github.com/paritytech/parity/issues/6342","id":251617530,"number":6342,"title":"Out of gas txs stuck in the txqueue in PoA network","user":{"login":"phahulin","id":2278876,"avatar_url":"https://avatars0.githubusercontent.com/u/2278876?v=4","gravatar_id":"","url":"https://api.github.com/users/phahulin","html_url":"https://github.com/phahulin","followers_url":"https://api.github.com/users/phahulin/followers","following_url":"https://api.github.com/users/phahulin/following{/other_user}","gists_url":"https://api.github.com/users/phahulin/gists{/gist_id}","starred_url":"https://api.github.com/users/phahulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phahulin/subscriptions","organizations_url":"https://api.github.com/users/phahulin/orgs","repos_url":"https://api.github.com/users/phahulin/repos","events_url":"https://api.github.com/users/phahulin/events{/privacy}","received_events_url":"https://api.github.com/users/phahulin/received_events","type":"User","site_admin":false},"labels":[{"id":290482954,"url":"https://api.github.com/repos/paritytech/parity/labels/Z0-question","name":"Z0-question","color":"f8f8f8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-08-21T10:36:10Z","updated_at":"2017-08-21T12:14:01Z","closed_at":"2017-08-21T11:21:11Z","body":"Hello, everyone\r\n> I'm running:\r\n>\r\n> - **Parity version**: Parity/v1.7.0-beta-5f2cabd-20170727/x86_64-linux-gnu/rustc1.18.0\r\n> - **Operating system**: Linux Ubuntu 16.04.1\r\n> - **And installed**: via binary\r\n\r\nWe have a PoA network with validators via contract. Nodes are connected and generate blocks - that's all OK.\r\nHere is [spec.json](https://github.com/oraclesorg/oracles-scripts/blob/alphadevtestnet/spec.json)\r\nHere is node.toml from one of the mining nodes:\r\n```\r\n# AlphaTestTestNet branch\r\n[parity]\r\nchain = \"spec.json\"\r\nbase_path = \"parity\"\r\n[network]\r\nnat=\"extip:$EXT_IP\"\r\nbootnodes=[\"enode://...\"]\r\nport = 30300\r\ndiscovery=true\r\n[rpc]\r\ncors = \"all\"\r\ninterface = \"all\"\r\nhosts = [\"all\"]\r\nport = 8540\r\napis = [\"web3\", \"eth\", \"net\", \"personal\", \"parity\", \"parity_set\", \"traces\", \"rpc\", \"parity_accounts\"]\r\n[account]\r\npassword = [\"node.pwd\"]\r\nunlock = [\"0xd637767e6f97dc1b0f5022618706e986891fd804\"]\r\n[mining]\r\nforce_sealing = true\r\nengine_signer = \"0xd637767e6f97dc1b0f5022618706e986891fd804\"\r\nreseal_on_txs = \"none\"\r\n```\r\n\r\nIf miner tries to deploy some other regular contract that exceeds gas limit (here a default truffle's migration contract is being deployed), his transaction will not be rejected (these logs are obtain with `parity -l engine=trace,tx=trace,txqueue=trace,own_tx=trace,miner=trace`)\r\n\r\n```\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  update_sealing\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  requires_reseal: sealing enabled\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  requires_reseal: should_disable_sealing=false; best_block=63185, last_request=0\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  update_sealing: preparing a block\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  prepare_block: No existing work - making new block\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  Pushed 0/0 transactions\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  update_sealing: engine indicates internal sealing\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE miner  seal_block_internally: attempting internal seal.\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE engine  Fetched proposer for step 300661570: 5e77…d128\r\n2017-08-21 09:30:50 UTC IO Worker #1 TRACE engine  generate_seal: d637…d804 not a proposer for step 300661570.\r\n2017-08-21 09:30:54 UTC  TRACE own_tx  Importing transaction: PendingTransaction { transaction: SignedTransaction { transaction: UnverifiedTransaction { unsigned: Transaction { nonce: 150, gas_price: 100000000000, gas: 4712388, action: Create, value: 0, data: [96, 96, 96, 64, 82, 52, 21, 97, 0, 15, 87, 96, 0, 128, 253, 91, 91, 96, 0, 128, 84, 96, 1, 96, 160, 96, 2, 10, 3, 25, 22, 51, 96, 1, 96, 160, 96, 2, 10, 3, 22, 23, 144, 85, 91, 91, 97, 1, 229, 128, 97, 0, 60, 96, 0, 57, 96, 0, 243, 0, 96, 96, 96, 64, 82, 99, 255, 255, 255, 255, 124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 53, 4, 22, 99, 9, 0, 240, 16, 129, 20, 97, 0, 94, 87, 128, 99, 68, 93, 240, 172, 20, 97, 0, 127, 87, 128, 99, 141, 165, 203, 91, 20, 97, 0, 164, 87, 128, 99, 253, 172, 213, 118, 20, 97, 0, 211, 87, 91, 96, 0, 128, 253, 91, 52, 21, 97, 0, 105, 87, 96, 0, 128, 253, 91, 97, 0, 125, 96, 1, 96, 160, 96, 2, 10, 3, 96, 4, 53, 22, 97, 0, 235, 86, 91, 0, 91, 52, 21, 97, 0, 138, 87, 96, 0, 128, 253, 91, 97, 0, 146, 97, 1, 130, 86, 91, 96, 64, 81, 144, 129, 82, 96, 32, 1, 96, 64, 81, 128, 145, 3, 144, 243, 91, 52, 21, 97, 0, 175, 87, 96, 0, 128, 253, 91, 97, 0, 183, 97, 1, 136, 86, 91, 96, 64, 81, 96, 1, 96, 160, 96, 2, 10, 3, 144, 145, 22, 129, 82, 96, 32, 1, 96, 64, 81, 128, 145, 3, 144, 243, 91, 52, 21, 97, 0, 222, 87, 96, 0, 128, 253, 91, 97, 0, 125, 96, 4, 53, 97, 1, 151, 86, 91, 0, 91, 96, 0, 128, 84, 51, 96, 1, 96, 160, 96, 2, 10, 3, 144, 129, 22, 145, 22, 20, 21, 97, 1, 124, 87, 129, 144, 80, 128, 96, 1, 96, 160, 96, 2, 10, 3, 22, 99, 253, 172, 213, 118, 96, 1, 84, 96, 64, 81, 124, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 255, 255, 255, 255, 132, 22, 2, 129, 82, 96, 4, 129, 1, 145, 144, 145, 82, 96, 36, 1, 96, 0, 96, 64, 81, 128, 131, 3, 129, 96, 0, 135, 128, 59, 21, 21, 97, 1, 103, 87, 96, 0, 128, 253, 91, 97, 2, 198, 90, 3, 241, 21, 21, 97, 1, 120, 87, 96, 0, 128, 253, 91, 80, 80, 80, 91, 91, 91, 80, 80, 86, 91, 96, 1, 84, 129, 86, 91, 96, 0, 84, 96, 1, 96, 160, 96, 2, 10, 3, 22, 129, 86, 91, 96, 0, 84, 51, 96, 1, 96, 160, 96, 2, 10, 3, 144, 129, 22, 145, 22, 20, 21, 97, 1, 180, 87, 96, 1, 129, 144, 85, 91, 91, 91, 80, 86, 0, 161, 101, 98, 122, 122, 114, 48, 88, 32, 108, 234, 136, 140, 245, 57, 120, 47, 185, 187, 157, 155, 233, 116, 191, 92, 46, 143, 188, 237, 35, 148, 16, 51, 34, 102, 175, 6, 137, 242, 38, 70, 0, 41] }, v: 25296896, r: 85958684512054125922881024122434810315738043737640594855323124833258656357840, s: 14143614474863145506591255791883398576786878061012156892982772619383263064944, hash: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df }, sender: d637767e6f97dc1b0f5022618706e986891fd804, public: Some(b3468405b5d446de557b30fa29fb8d60e8720367f7555d645c178647595a5f5a29f531b823055ea6e42bf26dd57fe70a1d5cb621fcc8aa8aa5ea593ce535b103) }, condition: None }\r\n2017-08-21 09:30:54 UTC  TRACE txqueue  Inserting: TransactionOrder { nonce_height: 0, gas_price: 100000000000, gas_factor: 53787704256, gas: 4712388, mem_usage: 640, strategy: GasPriceOnly, hash: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df, insertion_id: 0, origin: Local, penalties: 0 }\r\n2017-08-21 09:30:54 UTC  DEBUG txqueue  Imported transaction to current: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df\r\n2017-08-21 09:30:54 UTC  DEBUG txqueue  status: TransactionQueueStatus { pending: 1, future: 0 }\r\n2017-08-21 09:30:54 UTC  DEBUG own_tx  Imported to Current (hash dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df)\r\n2017-08-21 09:30:54 UTC  TRACE own_tx  Status: TransactionQueueStatus { pending: 1, future: 0 }\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  update_sealing\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  requires_reseal: sealing enabled\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  requires_reseal: should_disable_sealing=false; best_block=63185, last_request=0\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  update_sealing: preparing a block\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  prepare_block: No existing work - making new block\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  Adding tx dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df took Duration { secs: 0, nanos: 16000 }\r\n2017-08-21 09:30:55 UTC IO Worker #0 DEBUG miner  Skipping adding transaction to block because of gas limit: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df (limit: 4700000, used: 0, gas: 4712388)\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  Pushed 0/1 transactions\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  update_sealing: engine indicates internal sealing\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE miner  seal_block_internally: attempting internal seal.\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE engine  Fetched proposer for step 300661571: a487…30f7\r\n2017-08-21 09:30:55 UTC IO Worker #0 TRACE engine  generate_seal: d637…d804 not a proposer for step 300661571.\r\n```\r\nbut will get stuck in the queue, being skipped each round\r\n```\r\n2017-08-21 09:31:01 UTC Verifier #0 DEBUG engine  Author dd0b…7126 built block with step gap. current step: 300661572, parent step: 300661568\r\n2017-08-21 09:31:01 UTC Verifier #0 DEBUG engine  Set of validators obtained: [dd0bb0e2a1594240fed0c2f2c17c1e9ab4f87126, d637767e6f97dc1b0f5022618706e986891fd804, 705a6dc970416cd7df97c75918609f4aeafbcf9f, 66d26d11af18d3d9f228ce242125fca02eb2713a, 5e77b956f7deb4a568ff687f2891c64ec678d128, a4877cce4249e2150bbb3b5b7b44afa3b6bf30f7, 09439c2abbaca1703c856669b2ed8aae7bbcfb9a, 14779640ed1f04c71106505f934d6e07e005c128, 236e21d03955ec7fcefef93276b68e2541c1e9de, bb08f4689e122baa71b1f92fe631033d9a8bcc75, 428c24cf37d4413236c7cc086c50415dd78d78e1, a48538e5b29ed540f4942584f248816d71e50493, 8353decb9b8bf0cc4b0359b85c92d4bd2699529e]\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE engine  Fetched proposer for step 300661569: dd0b…7126\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE engine  Fetched proposer for step 300661570: d637…d804\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE engine  Fetched proposer for step 300661571: 705a…cf9f\r\n2017-08-21 09:31:01 UTC Verifier #0 DEBUG engine  Expected topics for header 3e00…3058: [55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89, fc3dbb4ea326d8b97f36f0ed1e9faff83fcfbc707f2b170afec9cd5813e1be96]\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  chain_new_blocks\r\n2017-08-21 09:31:01 UTC Verifier #0 DEBUG miner  minimal_gas_price: recalibrating...\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  Recalibrating Instant { tv_sec: 995121, tv_nsec: 83505607 } versus Instant { tv_sec: 998528, tv_nsec: 495346089 }\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  update_sealing\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  requires_reseal: sealing enabled\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  requires_reseal: should_disable_sealing=false; best_block=63186, last_request=0\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  update_sealing: preparing a block\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  prepare_block: No existing work - making new block\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  Adding tx dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df took Duration { secs: 0, nanos: 12200 }\r\n2017-08-21 09:31:01 UTC Verifier #0 DEBUG miner  Skipping adding transaction to block because of gas limit: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df (limit: 4700000, used: 0, gas: 4712388)\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  Pushed 0/1 transactions\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  update_sealing: engine indicates internal sealing\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE miner  seal_block_internally: attempting internal seal.\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE engine  Fetched proposer for step 300661572: dd0b…7126\r\n2017-08-21 09:31:01 UTC Verifier #0 TRACE engine  generate_seal: d637…d804 not a proposer for step 300661572.\r\n2017-08-21 09:31:01 UTC Verifier #0 INFO import  Imported #63186 3e00…3058 (0 txs, 0.00 Mgas, 674.22 ms, 0.56 KiB)\r\n2017-08-21 09:31:01 UTC IO Worker #0 TRACE txqueue  Dropping already imported transaction: dcbbcf5a91f2b13a4b0d736adc6b9430e26249ab4850ab9007822641445216df\r\n```\r\n\r\nTruffle migration just hangs\r\n```\r\nUsing network 'development'.\r\n\r\nRunning migration: 1_initial_migration.js\r\n  Deploying Migrations...\r\n  ... 0xc0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b\r\n^C\r\n```\r\nIf you run contract deployment again, a second pending transaction will appear\r\n```\r\n2017-08-21 09:54:40 UTC Verifier #0 TRACE miner  Adding tx 65432cf7edc294eecb42e5ff9741e341fb4d39ae6fe7f852ce2288d4d1ba39a1 took Duration { secs: 0, nanos: 11600 }\r\n2017-08-21 09:54:40 UTC Verifier #0 DEBUG miner  Skipping adding transaction to block because of gas limit: 65432cf7edc294eecb42e5ff9741e341fb4d39ae6fe7f852ce2288d4d1ba39a1 (limit: 4700000, used: 0, gas: 4712388\r\n2017-08-21 09:54:40 UTC Verifier #0 TRACE miner  Adding tx c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b took Duration { secs: 0, nanos: 1600 }\r\n2017-08-21 09:54:40 UTC Verifier #0 DEBUG miner  Skipping adding transaction to block because of invalid nonce: c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b (expected: 152, got: 153)\r\n2017-08-21 09:54:40 UTC Verifier #0 TRACE miner  Pushed 0/2 transactions\r\n```\r\nWe have a separate instance of our network (for real people to test), where there are 20+ transactions like this [that have been hanging in queue for days](http://testnet.oracles.org:4000/tx/pending).\r\n\r\nIf you send a valid tx from that address (e.g. transfer eth to someone), it will also remove one of the pending txs from the queue:\r\n```\r\n2017-08-21 09:55:10 UTC Verifier #0 DEBUG engine  Expected topics for header 1c4d…5717: [55252fa6eee4741b4e24a74a70e9c11fd2c2281df8d6ea13126ff845f7825c89, bcfd824a27fea83b5b743d8536eb185a3941daf18054556385b42585fe387baf]\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  chain_new_blocks\r\n2017-08-21 09:55:10 UTC Verifier #0 DEBUG miner  minimal_gas_price: recalibrating...\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  Recalibrating Instant { tv_sec: 996570, tv_nsec: 53204878 } versus Instant { tv_sec: 998528, tv_nsec: 495346089 }\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE txqueue  Removing old transaction: d6e98f400c77088de059e9af6222f4dab3047c5b27968a2dacf4c17224c5f9f0 (nonce: 152 < 153)\r\n2017-08-21 09:55:10 UTC Verifier #0 INFO own_tx  Transaction mined (hash d6e98f400c77088de059e9af6222f4dab3047c5b27968a2dacf4c17224c5f9f0)\r\n2017-08-21 09:55:10 UTC Verifier #0 DEBUG own_tx  Imported to Future (hash c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b)\r\n2017-08-21 09:55:10 UTC Verifier #0 DEBUG own_tx  Imported to Current (hash c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b)\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  update_sealing\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  requires_reseal: sealing enabled\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  requires_reseal: should_disable_sealing=false; best_block=63332, last_request=0\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  update_sealing: preparing a block\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  prepare_block: No existing work - making new block\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  Adding tx c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b took Duration { secs: 0, nanos: 2000 }\r\n2017-08-21 09:55:10 UTC Verifier #0 DEBUG miner  Skipping adding transaction to block because of gas limit: c0e22c8150f9fb888510199d189a628fc6805265575973a8864ad4defe374a4b (limit: 4700000, used: 0, gas: 4712388)\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  Pushed 0/1 transactions\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  update_sealing: engine indicates internal sealing\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE miner  seal_block_internally: attempting internal seal.\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE engine  Fetched proposer for step 300661862: 705a…cf9f\r\n2017-08-21 09:55:10 UTC Verifier #0 TRACE engine  generate_seal: d637…d804 not a proposer for step 300661862.\r\n2017-08-21 09:55:10 UTC Verifier #0 INFO import  Imported #63332 1c4d…5717 (1 txs, 0.02 Mgas, 0.62 ms, 0.68 KiB)\r\n```\r\nI did this test on a mining node, but it can also be reproduced by any node connected to the network.\r\nI think this is incorrect and invalid transaction should be removed from the queue."},"comment":{"url":"https://api.github.com/repos/paritytech/parity/issues/comments/323728637","html_url":"https://github.com/paritytech/parity/issues/6342#issuecomment-323728637","issue_url":"https://api.github.com/repos/paritytech/parity/issues/6342","id":323728637,"user":{"login":"phahulin","id":2278876,"avatar_url":"https://avatars0.githubusercontent.com/u/2278876?v=4","gravatar_id":"","url":"https://api.github.com/users/phahulin","html_url":"https://github.com/phahulin","followers_url":"https://api.github.com/users/phahulin/followers","following_url":"https://api.github.com/users/phahulin/following{/other_user}","gists_url":"https://api.github.com/users/phahulin/gists{/gist_id}","starred_url":"https://api.github.com/users/phahulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phahulin/subscriptions","organizations_url":"https://api.github.com/users/phahulin/orgs","repos_url":"https://api.github.com/users/phahulin/repos","events_url":"https://api.github.com/users/phahulin/events{/privacy}","received_events_url":"https://api.github.com/users/phahulin/received_events","type":"User","site_admin":false},"created_at":"2017-08-21T12:14:01Z","updated_at":"2017-08-21T12:14:01Z","body":"@tomusdrw what is the eviction period equal to?\r\n"}}
{"actor":{"display_login":"phahulin"}}