Skip to content

Objects in params are not serialized when added to cache key #3872

Closed
@konstantinabl

Description

@konstantinabl

Description

When testing debug_traceTransaction I found that passing params as following
N.B 0xsomeHash is used for the purpose of describing the bug

"params": [
        "0xsomeHash",
        {"tracer":"callTracer","tracerConfig":{"onlyTopCall":true}}
    ]

and then passing a different object for tracerConfig

"params": [
        "0xsomeHash",
        {"tracer":"callTracer","tracerConfig":{"onlyTopCall":false}}
    ]

gives the same result. This happens due to the fact that the nested object is not serialized, we cache the first request with cacheKey as shown bellow

traceTransaction_0xsomeHash_tracer_callTracer_tracerConfig_[object Object]

and when changing the tracerConfig the cacheKey doesn't change thus the cached result is returned

Steps to reproduce

  1. Send a request with one of params having a nested object, e.g debug_traceTransaction
  2. Send a 2nd request with changed nested object

Additional context

No response

Hedera network

No response

Version

0.69.2

Operating system

macOS

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions