You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for eth_getBlockReceipts RPC method (#102)
### TL;DR
Added support for using `eth_getBlockReceipts` instead of `eth_getLogs` and enhanced transaction data storage.
### What changed?
- Introduced `eth_getBlockReceipts` RPC method support
- Added new configuration options for block receipts
- Enhanced transaction structure with additional fields from receipts
- Updated ClickHouse schema to accommodate new transaction fields
- Improved serialization logic to handle block receipts data
### How to test?
1. Update the configuration file to enable block receipts:
```yaml
rpc:
blockReceipts:
enabled: true
blocksPerRequest: 500
batchDelay: 100
```
2. Run the indexer with the updated configuration
3. Verify that transactions in the ClickHouse database contain the new fields (e.g., `contract_address`, `gas_used`, `status`)
4. Check the logs to ensure that `eth_getBlockReceipts` method is being used when enabled
### Why make this change?
This change improves the efficiency and completeness of data collection:
1. Using `eth_getBlockReceipts` can be more efficient than fetching logs and receipts separately
2. Additional transaction data from receipts provides more comprehensive information for analysis and querying
3. The enhanced schema allows for more detailed transaction insights without the need for additional RPC calls
Copy file name to clipboardExpand all lines: README.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,43 @@ rpc:
136
136
batchDelay: 100
137
137
```
138
138
139
+
#### RPC Block Receipts Enabled
140
+
If this is `true`, will use `eth_getBlockReceipts` instead of `eth_getLogs` if the RPC supports it. Allows getting receipt data for transactions, but is not supported by every RPC. Default is `false`.
141
+
142
+
cmd: `--rpc-block-receipts-enabled`
143
+
env: `RPC_BLOCKRECEIPTS_ENABLED`
144
+
yaml:
145
+
```yaml
146
+
rpc:
147
+
blockReceipts:
148
+
enabled: true
149
+
```
150
+
151
+
#### RPC Block Receipts Blocks Per Request
152
+
How many blocks at a time to fetch block receipts for from the RPC. Default is 250.
153
+
Has no effect if it's larger than RPC blocks per request.
154
+
155
+
cmd: `--rpc-block-receipts-blocksPerRequest`
156
+
env: `RPC_BLOCKRECEIPTS_BLOCKSPERREQUEST`
157
+
yaml:
158
+
```yaml
159
+
rpc:
160
+
blockReceipts:
161
+
blocksPerRequest: 100
162
+
```
163
+
164
+
#### RPC Block Receipts Batch Delay
165
+
Milliseconds to wait between batches of block receipts when fetching from the RPC. Default is 0.
166
+
167
+
cmd: `--rpc-block-receipts-batchDelay`
168
+
env: `RPC_BLOCKRECEIPTS_BATCHDELAY`
169
+
yaml:
170
+
```yaml
171
+
rpc:
172
+
blockReceipts:
173
+
batchDelay: 100
174
+
```
175
+
139
176
#### RPC Traces Enabled
140
177
Whether to enable fetching traces from the RPC. Default is `true`, but it will try to detect if the RPC supports traces automatically.
0 commit comments