From 1ea5b2d7ecf9b9442b77f73af1b2ea80966927bd Mon Sep 17 00:00:00 2001 From: lightclient Date: Tue, 11 Mar 2025 09:35:12 -0600 Subject: [PATCH 1/3] add error when accessing pruned chain data --- src/eth/block.yaml | 21 +++++++++++++++++++++ src/eth/transaction.yaml | 9 +++++++++ 2 files changed, 30 insertions(+) diff --git a/src/eth/block.yaml b/src/eth/block.yaml index a8f226c58..44b55f704 100644 --- a/src/eth/block.yaml +++ b/src/eth/block.yaml @@ -16,6 +16,9 @@ oneOf: - $ref: '#/components/schemas/notFound' - $ref: '#/components/schemas/Block' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getBlockByHash example params: @@ -76,6 +79,9 @@ oneOf: - $ref: '#/components/schemas/notFound' - $ref: '#/components/schemas/Block' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getBlockByNumber example params: @@ -131,6 +137,9 @@ - $ref: '#/components/schemas/notFound' - title: Transaction count $ref: '#/components/schemas/uint' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getBlockTransactionCountByHash example params: @@ -152,6 +161,9 @@ - $ref: '#/components/schemas/notFound' - title: Transaction count $ref: '#/components/schemas/uint' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getBlockTransactionCountByNumber example params: @@ -173,6 +185,9 @@ - $ref: '#/components/schemas/notFound' - title: Uncle count $ref: '#/components/schemas/uint' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getUncleCountByBlockHash example params: @@ -194,6 +209,9 @@ - $ref: '#/components/schemas/notFound' - title: Uncle count $ref: '#/components/schemas/uint' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getUncleCountByBlockNumber example params: @@ -218,6 +236,9 @@ type: array items: $ref: '#/components/schemas/ReceiptInfo' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getBlockReceipts example params: diff --git a/src/eth/transaction.yaml b/src/eth/transaction.yaml index 503dc4b1b..17f1f4f5d 100644 --- a/src/eth/transaction.yaml +++ b/src/eth/transaction.yaml @@ -51,6 +51,9 @@ oneOf: - $ref: '#/components/schemas/notFound' - $ref: '#/components/schemas/TransactionInfo' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getTransactionByBlockHashAndIndex example params: @@ -93,6 +96,9 @@ oneOf: - $ref: '#/components/schemas/notFound' - $ref: '#/components/schemas/TransactionInfo' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getTransactionByBlockNumberAndIndex example params: @@ -131,6 +137,9 @@ oneOf: - $ref: '#/components/schemas/notFound' - $ref: '#/components/schemas/ReceiptInfo' + errors: + - code: 4444 + message: Pruned history unavailable examples: - name: eth_getTransactionReceipt example params: From 141008c91f1b16d42d72867a5e58fb8ff3f69bf3 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 13 Mar 2025 15:23:46 +0100 Subject: [PATCH 2/3] eth: add 4444 error to getLogs --- src/eth/filter.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/eth/filter.yaml b/src/eth/filter.yaml index 05477bb16..0ef456290 100644 --- a/src/eth/filter.yaml +++ b/src/eth/filter.yaml @@ -146,6 +146,9 @@ - name: Filter schema: $ref: '#/components/schemas/Filter' + errors: + - code: 4444 + message: Pruned history unavailable result: name: Log objects schema: From 8686381848dc8ed46f4a9e1fda3842c11d9ad48f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 13 Mar 2025 15:24:47 +0100 Subject: [PATCH 3/3] add 4444 error in debug namespace --- src/debug/getters.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/debug/getters.yaml b/src/debug/getters.yaml index c81938159..c6f62ab61 100644 --- a/src/debug/getters.yaml +++ b/src/debug/getters.yaml @@ -5,6 +5,9 @@ required: true schema: $ref: '#/components/schemas/BlockNumberOrTag' + errors: + - code: 4444 + message: Pruned history unavailable result: name: Header RLP schema: @@ -24,6 +27,9 @@ required: true schema: $ref: '#/components/schemas/BlockNumberOrTag' + errors: + - code: 4444 + message: Pruned history unavailable result: name: Block RLP schema: @@ -43,6 +49,9 @@ required: true schema: $ref: '#/components/schemas/hash32' + errors: + - code: 4444 + message: Pruned history unavailable result: name: EIP-2718 binary-encoded transaction schema: @@ -62,6 +71,9 @@ required: true schema: $ref: '#/components/schemas/BlockNumberOrTag' + errors: + - code: 4444 + message: Pruned history unavailable result: name: Receipts schema: