From 7234967676a39fdb1e71fa3aab749b0fc95379eb Mon Sep 17 00:00:00 2001 From: wslyvh Date: Wed, 11 Jan 2023 16:09:31 +0100 Subject: [PATCH 01/10] add txpool namespace --- scripts/build.js | 12 ++++++++++ src/schemas/filter.yaml | 10 +++++++++ src/schemas/txpool.yaml | 50 +++++++++++++++++++++++++++++++++++++++++ src/txpool/getters.yaml | 19 ++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 src/schemas/txpool.yaml create mode 100644 src/txpool/getters.yaml diff --git a/scripts/build.js b/scripts/build.js index 7b0c5cde1..ab5cb59ce 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -30,6 +30,18 @@ methodFiles.forEach(file => { ]; }); +methodsBase = "src/txpool/"; +methodFiles = fs.readdirSync(methodsBase); +methodFiles.forEach(file => { + console.log(file); + let raw = fs.readFileSync(methodsBase + file); + let parsed = yaml.load(raw); + methods = [ + ...methods, + ...parsed, + ]; +}); + let schemas = {}; let schemasBase = "src/schemas/" let schemaFiles = fs.readdirSync(schemasBase); diff --git a/src/schemas/filter.yaml b/src/schemas/filter.yaml index 51ebf0d77..d81d26123 100644 --- a/src/schemas/filter.yaml +++ b/src/schemas/filter.yaml @@ -49,3 +49,13 @@ FilterTopic: type: array items: $ref: '#/components/schemas/bytes32' +FilterOperators: + title: operator + type: object + oneOf: + - title: eq + $ref: '#/components/schemas/uint' + - title: gt + $ref: '#/components/schemas/uint' + - title: lt + $ref: '#/components/schemas/uint' \ No newline at end of file diff --git a/src/schemas/txpool.yaml b/src/schemas/txpool.yaml new file mode 100644 index 000000000..604cdbe03 --- /dev/null +++ b/src/schemas/txpool.yaml @@ -0,0 +1,50 @@ +TxPoolFilter: + title: txpool filter + type: object + properties: + from: + title: from address + $ref: '#/components/schemas/address' + to: + title: to address + $ref: '#/components/schemas/address' + gas: + title: gas limit + $ref: '#/components/schemas/FilterOperators' + gasPrice: + title: gas price + $ref: '#/components/schemas/FilterOperators' + value: + title: value + $ref: '#/components/schemas/FilterOperators' + nonce: + title: nonce + $ref: '#/components/schemas/FilterOperators' +TxPoolTransactions: + title: transactions + type: object + properties: + pending: + title: pending + type: array + items: + $ref: '#/components/schemas/GenericTransaction' + queued: + title: queued + type: array + items: + $ref: '#/components/schemas/GenericTransaction' +TxPoolStatistics: + title: statistics + type: object + properties: + maxSize: + title: max size + $ref: '#/components/schemas/uint' + pending: + title: pending + $ref: '#/components/schemas/uint' + queued: + title: queued + $ref: '#/components/schemas/uint' + diff --git a/src/txpool/getters.yaml b/src/txpool/getters.yaml new file mode 100644 index 000000000..2ae9ae742 --- /dev/null +++ b/src/txpool/getters.yaml @@ -0,0 +1,19 @@ +- name: txpool_transactions + summary: Returns a list of all transactions that match the supplied filter conditions that are either pending for inclusion in the next block(s) or scheduled for future execution. + params: + - name: Filter + schema: + $ref: '#/components/schemas/TxPoolFilter' + result: + name: Result + schema: + title: Result + schema: + $ref: '#/components/schemas/TxPoolTransactions' +- name: txpool_statistics + summary: Returns statistics about the node's transaction pool. + params: [] + result: + name: Statistics + schema: + $ref: '#/components/schemas/TxPoolStatistics' \ No newline at end of file From a79f1328a58ac11464104551f52a2a849a998f77 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Fri, 13 Jan 2023 15:48:47 +0100 Subject: [PATCH 02/10] add tests --- tests/txpool_statistics/get-statistics.io | 2 ++ tests/txpool_transactions/get-default-transactions.io | 2 ++ tests/txpool_transactions/get-empty-transactions-list.io | 2 ++ .../txpool_transactions/get-filtered-transactions-by-address.io | 2 ++ tests/txpool_transactions/get-filtered-transactions-gt-gas.io | 2 ++ 5 files changed, 10 insertions(+) create mode 100644 tests/txpool_statistics/get-statistics.io create mode 100644 tests/txpool_transactions/get-default-transactions.io create mode 100644 tests/txpool_transactions/get-empty-transactions-list.io create mode 100644 tests/txpool_transactions/get-filtered-transactions-by-address.io create mode 100644 tests/txpool_transactions/get-filtered-transactions-gt-gas.io diff --git a/tests/txpool_statistics/get-statistics.io b/tests/txpool_statistics/get-statistics.io new file mode 100644 index 000000000..49fdff0de --- /dev/null +++ b/tests/txpool_statistics/get-statistics.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":31,"method":"txpool_statistics"} +<< {"jsonrpc":"2.0","id":31,"result":{"maxSize":0,"pending":0,"queued":0} diff --git a/tests/txpool_transactions/get-default-transactions.io b/tests/txpool_transactions/get-default-transactions.io new file mode 100644 index 000000000..be48780af --- /dev/null +++ b/tests/txpool_transactions/get-default-transactions.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions"} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} diff --git a/tests/txpool_transactions/get-empty-transactions-list.io b/tests/txpool_transactions/get-empty-transactions-list.io new file mode 100644 index 000000000..2302feaf8 --- /dev/null +++ b/tests/txpool_transactions/get-empty-transactions-list.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions"} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[],"queued":[]} diff --git a/tests/txpool_transactions/get-filtered-transactions-by-address.io b/tests/txpool_transactions/get-filtered-transactions-by-address.io new file mode 100644 index 000000000..8d66b4ade --- /dev/null +++ b/tests/txpool_transactions/get-filtered-transactions-by-address.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions","params":[{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"}]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} diff --git a/tests/txpool_transactions/get-filtered-transactions-gt-gas.io b/tests/txpool_transactions/get-filtered-transactions-gt-gas.io new file mode 100644 index 000000000..904cbe7b7 --- /dev/null +++ b/tests/txpool_transactions/get-filtered-transactions-gt-gas.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions","params":[{"gas":{"lt":"0x0"}}]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} From 8b85ed8fdf8ed1e28fceb611893283f6a457ee04 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Fri, 13 Jan 2023 15:56:03 +0100 Subject: [PATCH 03/10] fix json format --- tests/txpool_statistics/get-statistics.io | 2 +- tests/txpool_transactions/get-default-transactions.io | 2 +- tests/txpool_transactions/get-empty-transactions-list.io | 2 +- .../txpool_transactions/get-filtered-transactions-by-address.io | 2 +- tests/txpool_transactions/get-filtered-transactions-gt-gas.io | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/txpool_statistics/get-statistics.io b/tests/txpool_statistics/get-statistics.io index 49fdff0de..ef7a53597 100644 --- a/tests/txpool_statistics/get-statistics.io +++ b/tests/txpool_statistics/get-statistics.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_statistics"} -<< {"jsonrpc":"2.0","id":31,"result":{"maxSize":0,"pending":0,"queued":0} +<< {"jsonrpc":"2.0","id":31,"result":{"maxSize":0,"pending":0,"queued":0}} diff --git a/tests/txpool_transactions/get-default-transactions.io b/tests/txpool_transactions/get-default-transactions.io index be48780af..a665f3e9b 100644 --- a/tests/txpool_transactions/get-default-transactions.io +++ b/tests/txpool_transactions/get-default-transactions.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions"} -<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0x658bdf435d810c91414ec09147daa6db62406379","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]}} diff --git a/tests/txpool_transactions/get-empty-transactions-list.io b/tests/txpool_transactions/get-empty-transactions-list.io index 2302feaf8..487e13e13 100644 --- a/tests/txpool_transactions/get-empty-transactions-list.io +++ b/tests/txpool_transactions/get-empty-transactions-list.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions"} -<< {"jsonrpc":"2.0","id":31,"result":{"pending":[],"queued":[]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[],"queued":[]}} diff --git a/tests/txpool_transactions/get-filtered-transactions-by-address.io b/tests/txpool_transactions/get-filtered-transactions-by-address.io index 8d66b4ade..4479fc288 100644 --- a/tests/txpool_transactions/get-filtered-transactions-by-address.io +++ b/tests/txpool_transactions/get-filtered-transactions-by-address.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions","params":[{"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"}]} -<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]}} diff --git a/tests/txpool_transactions/get-filtered-transactions-gt-gas.io b/tests/txpool_transactions/get-filtered-transactions-gt-gas.io index 904cbe7b7..0fc5c43c2 100644 --- a/tests/txpool_transactions/get-filtered-transactions-gt-gas.io +++ b/tests/txpool_transactions/get-filtered-transactions-gt-gas.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_transactions","params":[{"gas":{"lt":"0x0"}}]} -<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]} +<< {"jsonrpc":"2.0","id":31,"result":{"pending":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}],"queued":[{"blockHash":null,"blockNumber":null,"from":"0xfe3b557e8fb62b89f4916b721be55ceb828dbd73","gas":"0x5208","gasPrice":"0x342770c1","hash":"0x74e41d593675913d6d5521f46523f1bd396dff1891bdb35f59be47c7e5e0b34b","input":"0x","nonce":"0x0","to":"0x658bdf435d810c91414ec09147daa6db62406379","transactionIndex":"0x0","value":"0x3e8","type":"0x0","chainId":"0x539","v":"0xa95","r":"0xaf5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60","s":"0x201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b"}]}} From 60bdeb5a9a49c94d297c32f844ae18a0b59de4f3 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Mon, 23 Jan 2023 16:40:36 +0100 Subject: [PATCH 04/10] fix spec types --- tests/txpool_statistics/get-statistics.io | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/txpool_statistics/get-statistics.io b/tests/txpool_statistics/get-statistics.io index ef7a53597..87bb7a7f6 100644 --- a/tests/txpool_statistics/get-statistics.io +++ b/tests/txpool_statistics/get-statistics.io @@ -1,2 +1,2 @@ >> {"jsonrpc":"2.0","id":31,"method":"txpool_statistics"} -<< {"jsonrpc":"2.0","id":31,"result":{"maxSize":0,"pending":0,"queued":0}} +<< {"jsonrpc":"2.0","id":31,"result":{"maxSize":"0x1","pending":"0x1","queued":"0x1"}} From 1870c1cfd40874b4425ffa61885ac765b32dd649 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Mon, 23 Jan 2023 16:40:44 +0100 Subject: [PATCH 05/10] add txpool to dictionary --- wordlist.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wordlist.txt b/wordlist.txt index 5ff2b089b..6a035576f 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -49,3 +49,4 @@ graphql gwei withdrawalv DocToc +txpool \ No newline at end of file From a87f50710a1d92c3df0cd2d6f91afa5be3f25f25 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Tue, 24 Jan 2023 09:17:35 +0100 Subject: [PATCH 06/10] update txpool dictionary --- wordlist.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wordlist.txt b/wordlist.txt index 6a035576f..1874f2543 100644 --- a/wordlist.txt +++ b/wordlist.txt @@ -49,4 +49,8 @@ graphql gwei withdrawalv DocToc -txpool \ No newline at end of file +txpool +TxPool +eq +lt +gt \ No newline at end of file From 78e186967b5ddf876746768009eca4d77ac95516 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Tue, 24 Jan 2023 10:53:11 +0100 Subject: [PATCH 07/10] update filter spec --- src/schemas/filter.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schemas/filter.yaml b/src/schemas/filter.yaml index d81d26123..5d796202f 100644 --- a/src/schemas/filter.yaml +++ b/src/schemas/filter.yaml @@ -52,10 +52,10 @@ FilterTopic: FilterOperators: title: operator type: object - oneOf: - - title: eq + properties: + eq: $ref: '#/components/schemas/uint' - - title: gt + gt: $ref: '#/components/schemas/uint' - - title: lt + lt: $ref: '#/components/schemas/uint' \ No newline at end of file From 7c4b77448e720001be688787be64bff1e5569bc4 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Mon, 21 Aug 2023 10:19:50 +0200 Subject: [PATCH 08/10] add maxFeePerGas and maxPriorityFeePerGas --- src/schemas/txpool.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/schemas/txpool.yaml b/src/schemas/txpool.yaml index 604cdbe03..687abf571 100644 --- a/src/schemas/txpool.yaml +++ b/src/schemas/txpool.yaml @@ -14,6 +14,12 @@ TxPoolFilter: gasPrice: title: gas price $ref: '#/components/schemas/FilterOperators' + maxFeePerGas: + title: max fee + $ref: '#/components/schemas/FilterOperators' + maxPriorityFeePerGas: + title: max priority fee + $ref: '#/components/schemas/FilterOperators' value: title: value $ref: '#/components/schemas/FilterOperators' From 638a270896f9847f41d1c0cfbccdeeac3bd08af7 Mon Sep 17 00:00:00 2001 From: wslyvh Date: Mon, 21 Aug 2023 10:56:35 +0200 Subject: [PATCH 09/10] update one-time schemas --- src/schemas/txpool.yaml | 56 ----------------------------------------- src/txpool/getters.yaml | 54 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 58 deletions(-) delete mode 100644 src/schemas/txpool.yaml diff --git a/src/schemas/txpool.yaml b/src/schemas/txpool.yaml deleted file mode 100644 index 687abf571..000000000 --- a/src/schemas/txpool.yaml +++ /dev/null @@ -1,56 +0,0 @@ -TxPoolFilter: - title: txpool filter - type: object - properties: - from: - title: from address - $ref: '#/components/schemas/address' - to: - title: to address - $ref: '#/components/schemas/address' - gas: - title: gas limit - $ref: '#/components/schemas/FilterOperators' - gasPrice: - title: gas price - $ref: '#/components/schemas/FilterOperators' - maxFeePerGas: - title: max fee - $ref: '#/components/schemas/FilterOperators' - maxPriorityFeePerGas: - title: max priority fee - $ref: '#/components/schemas/FilterOperators' - value: - title: value - $ref: '#/components/schemas/FilterOperators' - nonce: - title: nonce - $ref: '#/components/schemas/FilterOperators' -TxPoolTransactions: - title: transactions - type: object - properties: - pending: - title: pending - type: array - items: - $ref: '#/components/schemas/GenericTransaction' - queued: - title: queued - type: array - items: - $ref: '#/components/schemas/GenericTransaction' -TxPoolStatistics: - title: statistics - type: object - properties: - maxSize: - title: max size - $ref: '#/components/schemas/uint' - pending: - title: pending - $ref: '#/components/schemas/uint' - queued: - title: queued - $ref: '#/components/schemas/uint' - diff --git a/src/txpool/getters.yaml b/src/txpool/getters.yaml index 2ae9ae742..a9e0a2e9f 100644 --- a/src/txpool/getters.yaml +++ b/src/txpool/getters.yaml @@ -3,17 +3,67 @@ params: - name: Filter schema: - $ref: '#/components/schemas/TxPoolFilter' + title: txpool filter + type: object + properties: + from: + title: from address + $ref: '#/components/schemas/address' + to: + title: to address + $ref: '#/components/schemas/address' + gas: + title: gas limit + $ref: '#/components/schemas/FilterOperators' + gasPrice: + title: gas price + $ref: '#/components/schemas/FilterOperators' + maxFeePerGas: + title: max fee + $ref: '#/components/schemas/FilterOperators' + maxPriorityFeePerGas: + title: max priority fee + $ref: '#/components/schemas/FilterOperators' + value: + title: value + $ref: '#/components/schemas/FilterOperators' + nonce: + title: nonce + $ref: '#/components/schemas/FilterOperators' result: name: Result schema: title: Result schema: $ref: '#/components/schemas/TxPoolTransactions' + title: transactions + type: object + properties: + pending: + title: pending + type: array + items: + $ref: '#/components/schemas/GenericTransaction' + queued: + title: queued + type: array + items: + $ref: '#/components/schemas/GenericTransaction' - name: txpool_statistics summary: Returns statistics about the node's transaction pool. params: [] result: name: Statistics schema: - $ref: '#/components/schemas/TxPoolStatistics' \ No newline at end of file + title: statistics + type: object + properties: + maxSize: + title: max size + $ref: '#/components/schemas/uint' + pending: + title: pending + $ref: '#/components/schemas/uint' + queued: + title: queued + $ref: '#/components/schemas/uint' From 5ba9ddd528ce1ece2d1dcf8c0f3ae0161306dcee Mon Sep 17 00:00:00 2001 From: wslyvh Date: Tue, 29 Aug 2023 15:43:16 +0200 Subject: [PATCH 10/10] remove maxsize --- src/txpool/getters.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/txpool/getters.yaml b/src/txpool/getters.yaml index a9e0a2e9f..f4932be96 100644 --- a/src/txpool/getters.yaml +++ b/src/txpool/getters.yaml @@ -58,9 +58,6 @@ title: statistics type: object properties: - maxSize: - title: max size - $ref: '#/components/schemas/uint' pending: title: pending $ref: '#/components/schemas/uint'