Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release] 20231020 eth #186

Merged
merged 1 commit into from
Oct 20, 2023
Merged

[release] 20231020 eth #186

merged 1 commit into from
Oct 20, 2023

Conversation

jiqiang90
Copy link

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have tested locally
  • I have performed a self review of my changes
  • Updated any relevant documentation
  • Linked to any relevant issues
  • I have added tests relevant to my changes
  • Any dependent changes have been merged and published in downstream modules
  • My code is up to date with the base branch
  • I have updated relevant changelogs. We suggest using chan

@jiqiang90 jiqiang90 merged commit 75c2557 into main Oct 20, 2023
1 of 2 checks passed
@github-actions
Copy link

Coverage report

❌ An unexpected error occurred. For more details, check console

Error: The process '/usr/local/bin/yarn' failed with exit code 1
St.
Category Percentage Covered / Total
🔴 Statements 48.6% 3029/6233
🟡 Branches 65.69% 247/376
🔴 Functions 32.34% 76/235
🔴 Lines 48.6% 3029/6233

Test suite run failed

Failed tests: 17/53. Failed suites: 5/10.
  ● Api.ethereum › Should format transaction in logs, and the transaction gas should be bigInt type

    Rate Limited at endpoint: eth.api.onfinality.io

      444 |     if ((e as any)?.status === 429) {
      445 |       const { hostname } = new URL(this.endpoint);
    > 446 |       return new Error(`Rate Limited at endpoint: ${hostname}`);
          |              ^
      447 |     }
      448 |
      449 |     return e;

      at EthereumApi.handleError (packages/node/src/ethereum/api.ethereum.ts:446:14)
      at EthereumApi.fetchBlock (packages/node/src/ethereum/api.ethereum.ts:302:18)
      at fetchBlock (packages/node/src/ethereum/api.ethereum.test.ts:49:19)
      at Object.<anonymous> (packages/node/src/ethereum/api.ethereum.test.ts:57:17)

  ● Api.ethereum › Decode nested logs in transactions

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:13 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"1","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › Should return raw logs, if decode fails

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:15 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"2","x-kong-proxy-latency":"1","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › Null filter support

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:20 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"2","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":45}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":45,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":46,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › !null filter support for logs, expect to filter out

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:24 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"34","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":45}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":45,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":46,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › Null filter support, for undefined transaction.to

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:27 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"1","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › Should return all tx if filter.to is not defined

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:29 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"1","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › filter.to Should support only null not undefined

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:31 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"2","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › If transaction is undefined, with null filter, should be supported

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:34 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"1","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":43}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":43,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":44,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16

  ● Api.ethereum › Resolves the correct tags for finalization

    bad response (status=429, headers={"content-type":"text/plain; charset=utf-8","content-length":"160","connection":"keep-alive","date":"Fri, 20 Oct 2023 02:21:39 GMT","x-continent":"SA","x-cluster":"sk","x-kong-upstream-latency":"1","x-kong-proxy-latency":"0","via":"kong/2.5.2"}, body="{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32029,\"message\":\"Too Many Requests, Please apply an OnFinality API key or contact us to receive a higher rate limit\"},\"id\":45}", requestBody="[{\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x0\",false],\"id\":45,\"jsonrpc\":\"2.0\"},{\"method\":\"eth_getBlockByNumber\",\"params\":[\"finalized\",false],\"id\":46,\"jsonrpc\":\"2.0\"}]", requestMethod="POST", url="https://eth.api.onfinality.io/public", code=SERVER_ERROR, version=web/5.7.1)

      388 |       ) {
      389 |         runningTimeout.cancel();
    > 390 |         logger.throwError('bad response', Logger.errors.SERVER_ERROR, {
          |                ^
      391 |           status: response.statusCode,
      392 |           headers: response.headers,
      393 |           body: bodyify(

      at Logger.Object.<anonymous>.Logger.makeError (node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
      at Logger.Object.<anonymous>.Logger.throwError (node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
      at packages/node/src/ethereum/ethers/web/index.ts:390:16


  ● ApiService › can fetch blocks

    All endpoints failed to initialize. Please add healthier endpoints

      64 |     }
      65 |
    > 66 |     await this.createConnections(
         |     ^
      67 |       network,
      68 |       (endpoint) =>
      69 |         EthereumApiConnection.create(

      at EthereumApiService.createConnections (node_modules/@subql/node-core/src/api.service.ts:124:13)
      at EthereumApiService.init (packages/node/src/ethereum/api.service.ethereum.ts:66:5)
      at prepareApiService (packages/node/src/ethereum/api.service.ethereum.test.ts:58:3)
      at Object.<anonymous> (packages/node/src/ethereum/api.service.ethereum.test.ts:68:25)

  ● ApiService › can get the finalized height

    All endpoints failed to initialize. Please add healthier endpoints

      64 |     }
      65 |
    > 66 |     await this.createConnections(
         |     ^
      67 |       network,
      68 |       (endpoint) =>
      69 |         EthereumApiConnection.create(

      at EthereumApiService.createConnections (node_modules/@subql/node-core/src/api.service.ts:124:13)
      at EthereumApiService.init (packages/node/src/ethereum/api.service.ethereum.ts:66:5)
      at prepareApiService (packages/node/src/ethereum/api.service.ethereum.test.ts:58:3)
      at Object.<anonymous> (packages/node/src/ethereum/api.service.ethereum.test.ts:68:25)

  ● ApiService › ensure api errorCode is exposed when throwing

    All endpoints failed to initialize. Please add healthier endpoints

      64 |     }
      65 |
    > 66 |     await this.createConnections(
         |     ^
      67 |       network,
      68 |       (endpoint) =>
      69 |         EthereumApiConnection.create(

      at EthereumApiService.createConnections (node_modules/@subql/node-core/src/api.service.ts:124:13)
      at EthereumApiService.init (packages/node/src/ethereum/api.service.ethereum.ts:66:5)
      at prepareApiService (packages/node/src/ethereum/api.service.ethereum.test.ts:58:3)
      at Object.<anonymous> (packages/node/src/ethereum/api.service.ethereum.test.ts:68:25)

  ● ApiService › should not retry on any errors not in the retry list

    All endpoints failed to initialize. Please add healthier endpoints

      64 |     }
      65 |
    > 66 |     await this.createConnections(
         |     ^
      67 |       network,
      68 |       (endpoint) =>
      69 |         EthereumApiConnection.create(

      at EthereumApiService.createConnections (node_modules/@subql/node-core/src/api.service.ts:124:13)
      at EthereumApiService.init (packages/node/src/ethereum/api.service.ethereum.ts:66:5)
      at prepareApiService (packages/node/src/ethereum/api.service.ethereum.test.ts:58:3)
      at Object.<anonymous> (packages/node/src/ethereum/api.service.ethereum.test.ts:68:25)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "hex": "0x01e84800",
    +   "hex": "0x02faf080",
        "type": "BigNumber",
      }

      31 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      32 |     );
    > 33 |     expect(BigNumber.from(block.gasLimit)).toEqual(BigNumber.from(0x01e84800));
         |                                            ^
      34 |   });
      35 | });
      36 |

      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-json-rpc-batch-provider.spec.ts:33:44)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "hex": "0x01e84800",
    +   "hex": "0x02faf080",
        "type": "BigNumber",
      }

      29 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      30 |     );
    > 31 |     expect(BigNumber.from(block.gasLimit)).toEqual(BigNumber.from(0x01e84800));
         |                                            ^
      32 |   });
      33 | });
      34 |

      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-json-rpc-provider.spec.ts:31:44)


  ● CeloJsonRpcProvider › should not set gasLimit to zero for blocks after the hard fork

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

      Object {
    -   "hex": "0x01e84800",
    +   "hex": "0x02faf080",
        "type": "BigNumber",
      }

      29 |       await provider.send('eth_getBlockByNumber', ['latest', true]),
      30 |     );
    > 31 |     expect(BigNumber.from(block.gasLimit)).toEqual(BigNumber.from(0x01e84800));
         |                                            ^
      32 |   });
      33 | });
      34 |

      at Object.<anonymous> (packages/node/src/ethereum/ethers/celo/celo-ws-provider.spec.ts:31:44)

Report generated by 🧪jest coverage report action from 52c2493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants