Skip to content

eth_getBlockReceipts: performance issue #5632

@AlexeyKrasnoperov

Description

@AlexeyKrasnoperov

Describe the bug

I request ethGetBlockReceipts method.
Forest responds in 425 ms, while Lotus returns the same response in 28 ms.

To reproduce

Curl request:

curl -X POST -w '\nTotal: %{time_total}s\n' http://localhost:2345/rpc/v1 \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "method": "eth_getBlockReceipts",
  "params": [
    "0x4B75EC"
  ],
  "id": 1
}'
Response
{"id":1,"jsonrpc":"2.0","result":[{"transactionHash":"0x4d9d069f5b4de1559f6a2b81e4b3b2296c144cb38db8dd83052378012158e93c","transactionIndex":"0x0","blockHash":"0x52b80aec35631af48535f13a84248139aecf214ff652fe57b85394566530b8ea","blockNumber":"0x4b75ec","from":"0xff0000000000000000000000000000000024045a","to":"0xff000000000000000000000000000000001d68f2","root":"0x0000000000000000000000000000000000000000000000000000000000000000","status":"0x1","contractAddress":null,"cumulativeGasUsed":"0x0","gasUsed":"0x24be405","effectiveGasPrice":"0xd7ce8","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","logs":[],"type":"0x2"},...]}

Measure performance

Download and setup the filecoin-benchmark-suite.

git clone https://github.com/ChainSafe/filecoin-benchmark-suite.git
cd filecoin-benchmark-suite
npm install

Generate fresh methods request definitions.

npm run build-requests

Benchmark the method.

k6 run -e K6_RPC_URL=http://localhost:2345/rpc/v1 -e K6_METHOD=eth_getBlockReceipts tests/single_method.js --duration 30s --vus 20

Expected behaviour

Forest responds in <= 28 ms.

Environment (please complete the following information):

  • Hardware
    • 12 cores CPU, 32Gb RAM

Metadata

Metadata

Assignees

Labels

Type: BugSomething isn't working

Type

No type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions