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

JS Test Schema not matching #2578

Open
rodrigo-pino opened this issue Feb 28, 2025 · 4 comments
Open

JS Test Schema not matching #2578

rodrigo-pino opened this issue Feb 28, 2025 · 4 comments
Assignees
Labels
Bug Something isn't working or security issue

Comments

@rodrigo-pino
Copy link
Contributor

The trace transaction test for v0_7 fail due to not matching schema:

  ● RPCProvider › RPC methods › deploy contract related tests › traceTransaction

    expect(received).toMatchSchema(schema)

    received
      /fee_transfer_invocation/execution_resources/steps must NOT be valid
      /fee_transfer_invocation/execution_resources/steps must NOT be valid
      /type must be equal to one of the allowed values
      must have required property 'constructor_invocation'
      /fee_transfer_invocation/execution_resources/steps must NOT be valid
      /type must be equal to one of the allowed values
      must have required property 'function_invocation'
      /type must be equal to one of the allowed values
      must match exactly one schema in oneOf
@rodrigo-pino rodrigo-pino added Bug Something isn't working or security issue High priority Needs to be solved this week or the next labels Feb 28, 2025
@rodrigo-pino
Copy link
Contributor Author

There might be a chance this is not our fault

@rianhughes
Copy link
Contributor

rianhughes commented Feb 28, 2025

When trying to run this failing test locally, I'm finding that txns fail because the max_fee is set too low. When overriding the overall_fee by 2*overall_fee, the txns pass, and I am able to replicate the error.

It looks like we return

"execution_resources": {
          "steps": 0
        }

but steps is NOT allowed to be zero according to the specs

 "steps": {
                        "title": "Steps",
                        "description": "The number of Cairo steps used",
                        "type": "integer",
                        "not": {
                            "const": 0
                        }
                    },
...
 "required": [
                    "steps"
                ]

It looks like blockifier is returning a 0 value for steps. Which is fine for the rpcv8 spec because it doesn't have any notion of "steps", but it's a breaking change for rpcv7 which requires a non-zero value for steps.

Overriding the steps causes the starknet.js test to pass, specifically
executionResult.Traces[index].FeeTransferInvocation.ExecutionResources.Steps = 3
in rpcv7
func (h *Handler) traceBlockTransactions(

@rodrigo-pino rodrigo-pino changed the title JS Test Broke again JS Test Schema not matching Mar 5, 2025
@hudem1
Copy link
Contributor

hudem1 commented Mar 5, 2025

@rianhughes What result did your experimental PR give ?

@rianhughes
Copy link
Contributor

@hudem1, the starknet.js tests passed in the CICD pipeline. https://github.com/NethermindEth/juno/actions/runs/13590192622/job/37994941475

(Note: that my hack broke the starknet.rs test, but I only wanted to quickly confirm that this solves the problem, not propose a concrete solution)

@rodrigo-pino rodrigo-pino removed the High priority Needs to be solved this week or the next label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working or security issue
Projects
None yet
Development

No branches or pull requests

3 participants