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

Artillery based stress testing is inaccurate due to misconfiguration #2598

Closed
CryptoFewka opened this issue Jul 30, 2024 · 1 comment · Fixed by #2953
Closed

Artillery based stress testing is inaccurate due to misconfiguration #2598

CryptoFewka opened this issue Jul 30, 2024 · 1 comment · Fixed by #2953
Assignees
Labels
bug Something isn't working

Comments

@CryptoFewka
Copy link
Contributor

Describe the Bug
The artillery config uses at least one call which is improperly specified:

params:
- fromBlock: "0x1"
toBlock: "latest"
address: "0x0"
topics: ["0x0"]

This call results in HTTP status 200, but a body of:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "invalid argument 0: invalid address: hex string of odd length"
  }
}

To Reproduce

curl -s -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock": "0x1","toBlock": "latest","address": "0x0","topics":["0x0"]}],"id":1}' 
  • Run it against a zetacored node

Expected Behavior
The intent of the artillery stress test is to judge performance of individual methods. This intent is not met with the current configuration, and it instead measures the ability to recognize invalid input and respond with an error message quickly.

Environment (please complete the following information):

  • Ubuntu 22.04 AMD64
  • zetacored v18
  • athens network
@CryptoFewka CryptoFewka added the bug Something isn't working label Jul 30, 2024
@CryptoFewka
Copy link
Contributor Author

Perhaps we should add and use the expect plugin to ensure that the response doesn't contain an error property. I do not believe that the assert plugin exists, despite an attempt to define its config to try and catch this exact state.

Ref:

Example Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "invalid argument 0: invalid address: hex string of odd length"
  }
}

Example config (last line contains change) that I would expect to fail on that response:

  - name: eth_getLogs
    flow:
      - post:
          url: "/"
          json:
            id: 1
            jsonrpc: "2.0"
            method: "eth_getLogs"
            params:
              - fromBlock: "0x1"
                toBlock: "latest"
                address: "0x0"
                topics: ["0x0"]
          capture:
            - json: "$"
              as: "response"
          ensure:
            - statusCode: 200
            - statusCode: 201
          expect:
            - notHasProperty: 'data[0].error'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants