Skip to content

Conversation

@ripatel-fd
Copy link
Contributor

This PR is a rewrite of solcap structured runtime event logging infrastructure

  • Events are now encoded in Protobuf, including account data
  • Event types are specified/documented in https://github.com/firedancer-io/solana-core.git
  • Protobuf encoding is done via a new schema-less high-performance encoder
  • The solcap custom file formats in v1 (completely custom) and v2 (pcapng extension) are ditched for standard pcapng (UDP/IP encapsulation)

This patch adds a fast embedded dependency-free Protobuf encoder.

The encoder operates at the wire-format level and can serialize
any proto3 message (excluding the deprecated groups feature).

The encoder's design incorporates a few features that sets it apart
from alternatives (Protobuf-C++, nanopb), and more useful to
Firedancer:
- Simple: does not require protoc, absl, etc.
- Serializes in two passes (encode, fixup length prefixes)
- Does not require allocations
- Allows user to serialize existing handwritten structs (instead of
  having to indirect through a Protobuf-generated struct)
- Structured to benefit from compiler's CFG optimizations (bounds
  check elision): consists of a single header library containing
  pure functions
- Various encoding tricks (tail clobbering) to reduce branches and
  code footprint
Adds a packet writer abstraction intended for use in solcap
producer code.  This decouples solcap event generation / Firedancer
runtime from the specifics of the solcap logging setup.

The first two backends provided are pcapng (dumps out solcap events
as fake UDP packets) and tango (sends solcap events to other tiles
on the Firedancer message bus).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants