Skip to content

Cache for RPC calls is actually kinda broken #722

Open
@msooseth

Description

@msooseth

The cache is not coherent between different threads. So each thread will do another RPC call. I'm talking about this:

data VM (t :: VMType) s = VM
  { result         :: Maybe (VMResult t s)
  , state          :: FrameState t s
  , frames         :: [Frame t s]
  , env            :: Env
  , block          :: Block
  , tx             :: TxState
  , logs           :: [Expr Log]
  , traces         :: Zipper.TreePos Zipper.Empty Trace
  , cache          :: Cache
...

I discovered this when working on #581 -- it kept RPC fetching address 0 repeatedly (which is another issue related to the code being --bin-runtime and not --bin, because we don't yet support the --bin with parameters). Anyway, it should only have fetched the code of Address 0 once, not many of times for the many of threads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions