You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In contrast to other state data, pending data is ephemeral - it is not persisted to disk. It is only used by RPC methods.
The current flow for pending is roughly:
Sync emits new pending data as it is received
RPC methods read pending data - but are only allowed access to it once it has been validated against the latest actual state in storage. This prevents race conditions from pending being in memory, and an actual db transaction being opened.
Since we already use a db transaction to access pending data, we should move it to storage.
Rationale
having all state encapsulated in storage makes sense
allows us to unify pathfinder_storage::BlockId and pathfinder_common::BlockId
already requires a db transaction
opens the door for testing other database abstractions
e.g. having a postgres network db feeding a cluster of rpc nodes - this would require either:
pending queries can only be done on the master node, or
pending data must be persisted (which would be easy to try out once storage abstracts it)
Warning ⚠️
This may be quite convoluted to do correctly. Each RPC method currently handles pending itself - all of this would now need to be done in storage somehow. Could end up being simple or difficult.
The text was updated successfully, but these errors were encountered:
In contrast to other state data, pending data is ephemeral - it is not persisted to disk. It is only used by RPC methods.
The current flow for pending is roughly:
Since we already use a db transaction to access pending data, we should move it to storage.
Rationale
pathfinder_storage::BlockId
andpathfinder_common::BlockId
Warning⚠️
This may be quite convoluted to do correctly. Each RPC method currently handles pending itself - all of this would now need to be done in storage somehow. Could end up being simple or difficult.
The text was updated successfully, but these errors were encountered: