Commit Graph

11 Commits

Author SHA1 Message Date
Christian Kamm e5d17998ab AccountsDB plugin: Track addresses to notice closure/reuse
Previously there were no messages for accounts that were closed
(lamports=0, owner=system_program) or reused for a different program
(which can happen in one tx).

Now messages contain an is_selected flag that lets the receiver know
whether its a message for a tracked account or just a follow-up message
for an account that used to be tracked.
2022-01-26 10:02:43 +01:00
Christian Kamm f0c26bb8fb Fix write_version from multiple servers and startup
Each node has an internal write_version counter. To deduplicate events
and produce a consistent database snapshot independent of the internal
count, we map it a per-slot-and-pubkey write version.

To do this correctly, we can only process account writes for slots where
all account writes will be received. This is a problem during startup,
where it's unclear what slots we have missed data for.

To make startup easier, let the plugin keep track of the highest slot
number that account writes have happened for, and send it when a new
consumer connects.
2022-01-03 10:36:11 +01:00
Christian Kamm 95da45f597 Remove stale TODO comments 2021-11-08 11:44:37 +01:00
Christian Kamm 3088e8b071 Fix warnings and plugin shutdown 2021-11-07 11:32:57 +01:00
Christian Kamm 132f6bcf38 cargo fmt 2021-11-02 13:37:08 +01:00
Christian Kamm 8fe4795733 plugin: remove unused dependencies 2021-11-02 13:37:08 +01:00
Christian Kamm f3fdb58810 plugin cleanup
- new and changed json config
- shorten main type name to "Plugin"
- move all plugin data into a helper struct, because construction and
  initialization is separate
2021-11-02 13:37:08 +01:00
Christian Kamm eab62d0599 gRPC: send regular ping
The idea was that slot updates would be really frequent and serve as a
ping. But during node startup there can be a long phase of no data.
2021-11-02 13:37:08 +01:00
Christian Kamm 6bb288e6b1 Create tokio runtime for the plugin 2021-11-02 13:37:08 +01:00
Christian Kamm 67f60beab1 Exit early when receiver stream closes 2021-11-02 13:37:08 +01:00
Christian Kamm 11ba681f9c Initial import from separate projects 2021-11-02 13:37:03 +01:00