Corvus Labs

Omen API reference

Every Omen gRPC message: ClientMessage, ServerMessage, subscriptions, filters, acks, provenance, conn_seq, Resume, lag policies, errors and enums.

Omen has one RPC on one service. Everything else is a message on that stream.

syntax = "proto3";
package arpc;

service aRPC {
  rpc Subscribe(stream ClientMessage) returns (stream ServerMessage);
}
Proto/proto/omen/arpc.proto, no imports
gRPC path/arpc.aRPC/Subscribe
ShapeBidirectional: you write ClientMessages, the server streams ServerMessages
Streams per connectionOne. A second Subscribe on the same connection fails with FAILED_PRECONDITION (9)
Request compressionIdentity only. gzip or zstd is refused with UNIMPLEMENTED (12)
TransportPlaintext HTTP/2, insecure credentials (endpoints)

Package name

The package is arpc, and it must stay arpc: the service path /arpc.aRPC/Subscribe depends on it. The legacy aRPC proto (/proto/arpc/legacy/service.proto) is also package arpc, so the two collide. Never compile both into one build. If you run both during migration, generate them into separate modules, crates or packages.

The proto has no go_package option. In Go, map it on the protoc command line:

protoc -I proto/omen \
  --go_out=. --go_opt=module=<your/module/path> \
  --go_opt=Marpc.proto=<your/module/path>/gen \
  --go-grpc_out=. --go-grpc_opt=module=<your/module/path> \
  --go-grpc_opt=Marpc.proto=<your/module/path>/gen \
  arpc.proto

Generated names follow the service name aRPC: NewARPCClient in Go, a_rpc_client::ARpcClient in Rust (tonic), arpc.aRPC in @grpc/grpc-js.

Stream lifecycle

  1. Open the connection and send Subscribe within 5 seconds.
  2. Optionally send Resume as the very first message.
  3. Optionally send ConnectionConfig to set the lag policy.
  4. Send one SubscriptionRequest per subscription and wait for its SubscribeAck. Add, replace and remove subscriptions at any time after that.
  5. Read ServerMessages until the stream ends. Nothing survives the connection except what Resume replays.

There's no commitment parameter: every frame is pre-execution. Omen has no accounts, blocks, block metadata or execution results; for those use Velox or Yellowstone gRPC.

ClientMessage

message ClientMessage {
  oneof msg {
    Resume resume = 1;                // optional; when present, MUST be the first message
    SubscriptionRequest subscribe = 2; // add or replace a sub_id
    Unsubscribe unsubscribe = 3;
    Ping ping = 4;
    ConnectionConfig config = 5;
  }
}
ArmUse
resumeReplay retained frames from a slot, then continue live. First message only
subscribeAdd a subscription, or replace the one with the same sub_id
unsubscribeRemove a subscription by sub_id
pingAsk for a Pong echoing your id
configSet the connection-wide lag policy; may precede your subscriptions

Resume

message Resume {
  uint64 from_slot = 1;
}
  • Must be the first message on the stream. A Resume sent later is ignored.
  • The server replays the frames it still retains from from_slot onward that match your subscriptions, each with replayed = true, then sends ReplayComplete and continues live.
  • The replayed tail overlaps what you already received. De-duplicate transactions on (slot, batch_index, entry_index, tx_index), which is stable across replay and reconnects.
  • Retention is a short window: about two minutes at full-chain volume. A from_slot below it gets a StreamError with ERROR_CODE_OUT_OF_RANGE; the message names the oldest slot still retained. Reconnect without Resume (or from a newer slot) and backfill through Solana RPC.
  • Replays are capacity-limited. When none is available you get ERROR_CODE_RESOURCE_EXHAUSTED with retry_after_ms between 0.5 and 5 seconds; reconnect and resume after that.

SubscriptionRequest

message SubscriptionRequest {
  uint32 sub_id = 1; // client-chosen, 0..63
  oneof kind {
    TransactionSubscription transactions = 2;
    EntrySubscription entries = 3;
    SlotSubscription slots = 4;
  }
  DataPolicy policy = 5;
}

sub_id rules:

  • You choose it, from 0 to 63. Above 63 is rejected with ACK_REASON_INVALID_SUB_ID.
  • A request for a new sub_id adds a subscription; a request for one already in use replaces it. The other subscriptions are untouched.
  • Every request gets exactly one SubscribeAck with its sub_id. A subscription delivers only after its accepted ack; limits are checked at ack time.
  • If you send two requests for the same sub_id before the first is acked, the earlier one is acked accepted = true with ACK_REASON_SUPERSEDED. That's not an error: the later request is the one in force.
  • The sub_ids that matched a frame come back as bits in ServerMessage.matched_subs.

DataPolicy

message DataPolicy {
  bool exclude_recovered = 1;  // drop Reed-Solomon-recovered frames
  bool exclude_repaired = 2;   // drop turbine-repaired frames
  bool include_unverified = 3; // no effect
}
FieldEffect
exclude_recoveredSkip frames whose data was rebuilt from erasure coding (provenance bit 1)
exclude_repairedSkip frames whose data arrived through repair (provenance bit 2)
include_unverifiedNo effect: everything is verified before it's sent

Leave the policy unset to receive everything.

TransactionSubscription

message TransactionSubscription {
  repeated bytes account_include = 1;  // raw 32-byte keys
  repeated bytes account_exclude = 2;
  repeated bytes account_required = 3;
  bool exclude_votes = 4;
  TransactionEncoding encoding = 5;
  CuckooFilter cuckoo_account_include = 6;
}

enum TransactionEncoding {
  TRANSACTION_ENCODING_BINARY = 0;  // exact wire bytes (default)
  TRANSACTION_ENCODING_DECODED = 1; // parsed Transaction with LUT-resolved addresses
}
FieldRule
account_includeAt least one listed key must be in the transaction
account_requiredEvery listed key must be in the transaction
account_excludeNo listed key may be in the transaction
exclude_votesDrop vote transactions
encodingBINARY sends BinaryTransaction (exact wire bytes); DECODED sends DecodedTransaction
cuckoo_account_includeA compact replacement for account_include; see cuckoo filters
  • Keys are raw 32-byte values (bytes), not base58 strings. Decode addresses before you send them. A key of any other length is rejected with ACK_REASON_INVALID_FILTER.
  • Keys match against the transaction's static account keys and the addresses its lookup tables resolve to.
  • The rules combine with AND.
  • A transaction subscription with an empty account_include and no cuckoo filter is an unfiltered firehose, even if it sets account_required or account_exclude. Firehose capacity is limited: when it's full you get ACK_REASON_FILTER_TOO_BROAD.
  • Key limits: 100,000 keys per subscription and 200,000 per connection (limits).

CuckooFilter

For very large key sets, send a cuckoo filter instead of listing every key. It replaces the account_include test with a membership probe: no false negatives, about one false positive in a million at 16-bit fingerprints. Drop the false positives on your side by checking the transaction's keys against your real set. account_exclude, account_required, exclude_votes, encoding and the DataPolicy still apply.

message CuckooFilter {
  bytes data = 1;
  uint32 bucket_count = 2;       // advisory only; derived from len(data)
  uint32 entries_per_bucket = 3; // 4, or 0 = unset (treated as 4)
  uint32 fingerprint_bits = 4;   // 16, or 0 = unset (treated as 16)
  uint64 hash_seed = 5;
  CuckooHashAlgorithm hash_algorithm = 6;
}

enum CuckooHashAlgorithm {
  CUCKOO_HASH_ALGORITHM_SIP_HASH_2_4 = 0; // the only supported algorithm
}
  • Field numbers match Yellowstone's cuckoo filter message, but Omen supports only 16-bit fingerprints, 4 entries per bucket and SipHash-2-4.
  • data is the bucket array over raw 32-byte keys. Each bucket is 8 bytes: four little-endian 16-bit fingerprint lanes, where 0 means an empty lane.
  • The server derives the bucket count as floor(len(data) / 8), which must be a non-zero power of two. Trailing bytes past the last whole bucket are ignored. bucket_count is advisory and never trusted.
  • hash_seed is SipHash k0; k1 is rotl64(hash_seed, 32). An absent hash_seed means 0, not the common client default 0x796c6c7773746e21: if your library uses that default, send it explicitly.
  • Don't combine it with a non-empty account_include.
  • data is at most 2 MiB; at most 4 cuckoo subscriptions per connection.

Where a cuckoo filter problem shows up:

ProblemYou getStream
Bad geometry, algorithm or bucket count, or combined with account_includeSubscribeAck, ACK_REASON_CUCKOO_FILTER_INVALIDStays open
Already 4 cuckoo subscriptions on this connection, or no cuckoo filter capacity leftSubscribeAck, ACK_REASON_CUCKOO_FILTER_LIMIT; retry after an unsubscribe frees oneStays open
Empty data, data above the size limit, or a wrong wire type on the fieldgRPC INVALID_ARGUMENT (3), no ackClosed
An oversized message that arrives when there's no capacity for itgRPC RESOURCE_EXHAUSTED (8), retryable with backoffClosed

EntrySubscription

message EntrySubscription {
  EntryMetadataFilter metadata = 1;
}

message EntryMetadataFilter {
  optional uint32 min_transaction_count = 1;
  optional uint32 max_transaction_count = 2;
  optional uint32 min_signature_count = 3;
  optional uint32 max_signature_count = 4;
  optional bool include_tick_entries = 5;
  optional bool include_non_tick_entries = 6;
}

Each set field narrows the entries you receive: transaction and signature count ranges, and whether tick-only and non-tick entries are included. Leave a field unset for no constraint.

SlotSubscription

message SlotSubscription {
  bool include_dead = 1;
  bool include_complete = 2;
  bool include_first_shred = 3;
}

SLOT_STATUS_ALIVE is always sent. Each flag adds one more status: DEAD, COMPLETE or FIRST_SHRED.

Unsubscribe, Ping, ConnectionConfig

message Unsubscribe {
  uint32 sub_id = 1; // the sub_id (0..63) to tear down
}

message Ping {
  uint64 id = 1; // echoed back in Pong for RTT measurement
}

message ConnectionConfig {
  OnLag on_lag = 1; // connection-wide lag policy; may precede subscribes
}

enum OnLag {
  ON_LAG_CLOSE = 0;        // close the stream with DATA_LOSS "lagged"
  ON_LAG_SKIP_TO_LIVE = 1; // jump to head and emit a GapNotice
  ON_LAG_CONFLATE = 2;     // slot-status subs keep the latest per slot; data subs behave as SKIP_TO_LIVE
}
OnLagWhen your reader falls too far behind
ON_LAG_CLOSE (default)The stream closes with gRPC DATA_LOSS (15), message lagged. Reconnect with Resume to pick up what you missed
ON_LAG_SKIP_TO_LIVEThe stream jumps to the live head and sends a GapNotice with the skipped seq range
ON_LAG_CONFLATESlot-status subscriptions keep only the latest status per slot; data subscriptions behave as SKIP_TO_LIVE

SKIP_TO_LIVE and CONFLATE are opt-in and lose data by design; backfill what a GapNotice reports through Solana RPC if you need it.

ServerMessage

message ServerMessage {
  uint64 matched_subs = 1;
  bool replayed = 16;
  fixed64 conn_seq = 17;

  fixed64 seq = 2;
  fixed64 created_at_ns = 3;
  uint32 provenance = 4;
  oneof payload {
    BinaryTransaction binary_transaction = 5;
    DecodedTransaction decoded_transaction = 6;
    Entry entry = 7;
    SlotStatusUpdate slot = 8;
    SlotRetract retract = 9;
    Pong pong = 10;
    SubscribeAck ack = 11;
    StreamError error = 12;
    Heartbeat heartbeat = 13;
    ReplayComplete replay_done = 14;
    GapNotice gap = 15;
  }
}
FieldMeaning
matched_subsBitmask of your sub_ids that matched this frame: bit n is sub_id n
replayedThis frame was served from a Resume replay
conn_seqPer-connection counter, +1 on every frame, control frames included. Gap-free
seqGlobal frame id. A de-duplication key only: it has gaps on a filtered stream
created_at_nsUnix time in nanoseconds when the data in this frame was first received; control-only frames carry the server's time
provenanceHow the frame's data arrived; see provenance

seq vs conn_seq

conn_seqseq
ScopeYour connectionThe server's whole frame stream
GapsNever. A gap is a transport bug: reconnect with Resume and report itAlways, on a filtered stream: frames you didn't match are skipped
RestartsOn every new connectionNo
Use it forDetecting loss on the wireDe-duplication; the range in GapNotice; ReplayComplete.live_seq

For transactions, the position key (slot, batch_index, entry_index, tx_index) is the de-duplication key that stays stable across replay and reconnects.

Provenance

BitNameSet when
0PARTIAL_RUNThe frame was sent as soon as its part of the batch arrived, before the whole batch had been received
1RECOVEREDThe data was rebuilt with Reed-Solomon erasure coding
2REPAIREDThe data arrived through turbine repair
3UNVERIFIEDNever set: everything is verified before it's sent
8–31—Reserved

DataPolicy can filter out recovered and repaired frames per subscription.

BinaryTransaction

message BinaryTransaction {
  uint64 slot = 1;
  uint32 batch_index = 2;
  uint32 entry_index = 3;
  uint32 tx_index = 4;
  bytes signature = 5;   // 64-byte primary signature (raw, no base58)
  bytes transaction = 6; // exact wire bytes of the transaction
}

Sent for subscriptions with TRANSACTION_ENCODING_BINARY. transaction is the exact serialized transaction; decode it with your Solana SDK. slot, batch_index, entry_index and tx_index locate it in the slot.

DecodedTransaction

message DecodedTransaction {
  uint64 slot = 1;
  uint32 batch_index = 2;
  uint32 entry_index = 3;
  uint32 tx_index = 4;
  bytes signature = 5;
  Transaction transaction = 6;
  bool lut_miss = 7; // at least one LUT-referenced key was unresolved
}

message Transaction {
  repeated bytes signatures = 1;
  Message message = 2;
  bool is_vote = 3;
  bytes fee_payer = 4;
}

message Message {
  MessageHeader header = 1;
  repeated bytes account_keys = 2;
  bytes recent_blockhash = 3;
  repeated CompiledInstruction instructions = 4;
  repeated MessageAddressTableLookup address_table_lookups = 5;
  repeated bytes loaded_writable_addresses = 6; // LUT-resolved
  repeated bytes loaded_readonly_addresses = 7; // LUT-resolved
  TransactionVersion transaction_version = 8;
  TransactionConfig transaction_config = 9;     // present only for v1
}

message MessageHeader {
  uint32 num_required_signatures = 1;
  uint32 num_readonly_signed_accounts = 2;
  uint32 num_readonly_unsigned_accounts = 3;
}

message CompiledInstruction {
  uint32 program_id_index = 1;
  bytes accounts = 2;
  bytes data = 3;
}

message MessageAddressTableLookup {
  bytes account_key = 1;
  bytes writable_indexes = 2;
  bytes readonly_indexes = 3;
}

enum TransactionVersion {
  TRANSACTION_VERSION_LEGACY = 0;
  TRANSACTION_VERSION_V0 = 1;
  TRANSACTION_VERSION_V1 = 2;
}

// The mask preserves presence even when a configured scalar is zero.
message TransactionConfig {
  uint32 mask = 1;
  uint64 priority_fee = 2;
  uint32 compute_unit_limit = 3;
  uint32 loaded_accounts_data_size_limit = 4;
  uint32 heap_size = 5;
}

Sent for subscriptions with TRANSACTION_ENCODING_DECODED.

  • All keys, signatures and hashes are raw bytes: 32-byte keys, 64-byte signatures.
  • loaded_writable_addresses and loaded_readonly_addresses are the addresses the lookup tables resolve to. If any lookup couldn't be resolved, lut_miss is true and those lists are incomplete.
  • is_vote and fee_payer are filled for you.
  • CompiledInstruction.accounts is a byte string of account indexes, as on the wire.
  • transaction_config is present only for TRANSACTION_VERSION_V1 messages. mask tells you which of its fields were actually set, so a configured zero is distinguishable from an absent value.

Entry

message Entry {
  uint64 slot = 1;
  uint32 batch_index = 2;
  uint32 entry_index = 3;
  bytes data = 4; // bincode entry bytes (exact leader-signed bytes)
  uint32 tx_count = 5;
  uint32 sig_count = 6;
  bool tick_only = 7;
  bool is_last_in_slot = 8;
}

data is the bincode-serialized entry exactly as the leader produced it. tx_count and sig_count let you skip entries without decoding them; tick_only marks tick entries; is_last_in_slot marks the slot's final entry.

SlotStatusUpdate

message SlotStatusUpdate {
  uint64 slot = 1;
  SlotStatus status = 2;
  bytes leader = 3; // 32-byte leader pubkey; empty when unknown
}

enum SlotStatus {
  SLOT_STATUS_ALIVE = 0;
  SLOT_STATUS_FIRST_SHRED = 1;
  SLOT_STATUS_COMPLETE = 2;
  SLOT_STATUS_DEAD = 3;
  reserved 8, 9; // reserved for consensus statuses; this version is pre-consensus only
}
StatusMeaningSent
ALIVEThe slot is live; sent before its first data frameAlways
FIRST_SHREDThe slot's first shred was observedWith include_first_shred
COMPLETEThe slot's last entry was observed. Not confirmed, rooted or finalizedWith include_complete
DEADThe slot was abandonedWith include_dead

Values 8 and 9 are reserved for future consensus statuses. A slot that was retracted and then receives data again is announced with a new ALIVE.

SlotRetract

message SlotRetract {
  uint64 slot = 1;
  RetractReason reason = 2;
}

enum RetractReason {
  RETRACT_REASON_UNSPECIFIED = 0;
  RETRACT_REASON_DEAD = 1;
  RETRACT_REASON_EQUIVOCATION = 2;
  RETRACT_REASON_VERIFY_FAILED = 3;
}

Discard everything previously delivered for slot.

ReasonMeaning
RETRACT_REASON_DEADThe slot was declared dead
RETRACT_REASON_EQUIVOCATIONThe leader produced a conflicting version of this slot, and the delivered one lost
RETRACT_REASON_VERIFY_FAILEDLeader signature verification failed

Pong

message Pong {
  uint64 id = 1; // echoes Ping.id
}

SubscribeAck

message SubscribeAck {
  uint32 sub_id = 1;
  bool accepted = 2;
  AckReason reason = 3;
}

enum AckReason {
  ACK_REASON_NONE = 0;
  ACK_REASON_INVALID_SUB_ID = 1;
  ACK_REASON_INVALID_FILTER = 2;
  ACK_REASON_MAX_KEYS_PER_SUB = 3;
  ACK_REASON_MAX_KEYS_PER_CONN = 4;
  ACK_REASON_MAX_SUBS_PER_CONN = 5;
  ACK_REASON_FILTER_TOO_LARGE = 6;
  ACK_REASON_FILTER_TOO_BROAD = 7;
  reserved 8;
  ACK_REASON_CUCKOO_FILTER_INVALID = 9;
  ACK_REASON_CUCKOO_FILTER_LIMIT = 10;
  ACK_REASON_SERVER_RESOURCES = 11;
  ACK_REASON_SUPERSEDED = 12;
}

A rejection (accepted = false) affects only that sub_id; the stream and your other subscriptions keep running.

ReasonacceptedMeaningWhat to do
ACK_REASON_NONEtrueAccepted, no further detail—
ACK_REASON_SUPERSEDEDtrueA later request for this sub_id replaced this oneNothing; not an error
ACK_REASON_INVALID_SUB_IDfalsesub_id above 63, or that sub_id is still being removedUse 0–63; retry a sub_id that is being removed
ACK_REASON_INVALID_FILTERfalseMalformed filter, e.g. a key that isn't 32 bytesFix the filter
ACK_REASON_MAX_KEYS_PER_SUBfalseMore than 100,000 keys in this subscriptionSplit it, or use a cuckoo filter
ACK_REASON_MAX_KEYS_PER_CONNfalseMore than 200,000 keys across the connectionOpen another connection
ACK_REASON_MAX_SUBS_PER_CONNfalseNo free subscription slot, on this connection or on the serverUnsubscribe one, or retry with backoff
ACK_REASON_FILTER_TOO_LARGEfalseThe filter is too large for the server to accept right nowShrink it, or retry with backoff
ACK_REASON_FILTER_TOO_BROADfalseUnfiltered firehose refused: firehose capacity is fullAdd filters, or retry later with backoff
ACK_REASON_CUCKOO_FILTER_INVALIDfalseBad cuckoo geometry, algorithm or bucket count, or combined with account_includeFix the filter
ACK_REASON_CUCKOO_FILTER_LIMITfalseAlready 4 cuckoo subscriptions on this connection, or no cuckoo filter capacity leftRetry after an unsubscribe frees one, or with backoff
ACK_REASON_SERVER_RESOURCESfalseTransient server capacity limit, not filter sizeRetry with backoff

Value 8 is retired and never reused. A refusal caused by server capacity (always for FILTER_TOO_LARGE, FILTER_TOO_BROAD and SERVER_RESOURCES; sometimes for MAX_SUBS_PER_CONN and CUCKOO_FILTER_LIMIT) is preceded by a StreamError with ERROR_CODE_RESOURCE_EXHAUSTED and a retry_after_ms hint of 0.5–5 seconds.

StreamError

message StreamError {
  ErrorCode code = 1;
  string message = 2;
  uint32 retry_after_ms = 3; // 0 = no retry hint
}

enum ErrorCode {
  ERROR_CODE_UNSPECIFIED = 0;
  ERROR_CODE_UNKNOWN = 1;
  ERROR_CODE_INVALID_FILTER = 2;
  ERROR_CODE_FILTER_TOO_COMPLEX = 3;
  ERROR_CODE_RATE_LIMITED = 4;
  ERROR_CODE_QUOTA_EXCEEDED = 5;
  ERROR_CODE_INTERNAL = 6;
  ERROR_CODE_UNAVAILABLE = 7;
  ERROR_CODE_SHUTTING_DOWN = 8;
  ERROR_CODE_FLOW_CONTROL_LIMITED = 9;
  ERROR_CODE_RESOURCE_EXHAUSTED = 10;
  ERROR_CODE_OUT_OF_RANGE = 11;
}

An in-band error. Wait at least retry_after_ms (when non-zero) before you reconnect or retry.

CodeMeaningWhat to do
ERROR_CODE_SHUTTING_DOWNThe server is shutting down; carries a jittered retry_after_msReconnect after the hint, with Resume
ERROR_CODE_FLOW_CONTROL_LIMITEDAdvisory: your HTTP/2 receive window is persistently too small for the streamRaise the window (flow control); the stream continues
ERROR_CODE_RESOURCE_EXHAUSTEDA replay or a broad subscription was refused for capacity; carries retry_after_ms (0.5–5 s)Retry after the hint
ERROR_CODE_OUT_OF_RANGEThe Resume slot is older than retentionReconnect without Resume and backfill through Solana RPC
ERROR_CODE_UNSPECIFIED, UNKNOWN, INVALID_FILTER, FILTER_TOO_COMPLEX, RATE_LIMITED, QUOTA_EXCEEDED, INTERNAL, UNAVAILABLEDefined for completeness; you shouldn't normally see themReconnect with backoff

Heartbeat

message Heartbeat {
  uint64 slot = 1;
}

Sent after 10 seconds without any other frame. slot is the newest slot observed, so an idle subscription still sees the chain advance.

ReplayComplete

message ReplayComplete {
  fixed64 live_seq = 1; // head frame id at the moment the stream joined live
}

Sent once a Resume replay has caught up. Frames after it are live.

GapNotice

message GapNotice {
  fixed64 from_seq = 1; // last seq delivered before the gap
  fixed64 to_seq = 2;   // first seq delivered after the jump to live
}

Sent only under ON_LAG_SKIP_TO_LIVE or ON_LAG_CONFLATE, when the stream skipped frames to catch up. conn_seq stays gap-free across it; the skipped data is identified by seq.

Pre-execution data

Nothing on this stream has executed. SLOT_STATUS_COMPLETE means the slot's last entry was observed, not that it's confirmed. Confirm anything irreversible through Solana RPC.

On this page