telosnetwork / telos-evm-rpc

2 stars 3 forks source link

Optimize getBlockByNumber queries #78

Open guilledk opened 6 months ago

guilledk commented 6 months ago

Only did this too see how fast batched requests could be so only tested that, but if this ever wants to really get merged need to test more thoroughly.

guilledk commented 6 months ago

Finished tests: https://github.com/telosnetwork/telos-evm-docker/blob/rpc_batch_testing/tests/test_rpc_batch.py

  1. Run mainnet node request first 1000 blocks using batch and compare against getting the same block num using web3.py which is python's standard ethereum framework.
  2. Run mainnet node, do batch request with eth_getBlockByNumber interleaved with eth_blockNumber calls then check correct order on response.
  3. Run local node configured with only 1000 docs per index on elastic and wait till block 1200, do batch request from block 800 to 1200 which should cross over the indeces then compare response for proper ordering and against web3.py for each block.
rozzaswap commented 5 months ago

Issue found - @guilledk investigating

guilledk commented 5 months ago

Done, problem had to do with changing some helper apis to return elasticDoc straight up instead of elasticDoc._source['@raw'] for receipts. Its now passing my local tests, included a new one I added to catch this behaivour next time.