diff --git a/jito_protos/build.rs b/jito_protos/build.rs index 0be6a00..e98c03c 100755 --- a/jito_protos/build.rs +++ b/jito_protos/build.rs @@ -1,23 +1,23 @@ fn main() { - tonic_build::configure() - .protoc_arg("--experimental_allow_proto3_optional") - .build_server(false) - .out_dir("src/grpc") - .compile_protos( - &[ - "protos/auth.proto", - "protos/block.proto", - "protos/block_engine.proto", - "protos/bundle.proto", - "protos/packet.proto", - "protos/relayer.proto", - "protos/searcher.proto", - "protos/shared.proto", - "protos/shredstream.proto", - "protos/trace_shred.proto", - ], - &["protos"], - ) - .unwrap(); + // tonic_build::configure() + // .protoc_arg("--experimental_allow_proto3_optional") + // .build_server(false) + // .out_dir("src/grpc") + // .compile_protos( + // &[ + // "protos/auth.proto", + // "protos/block.proto", + // "protos/block_engine.proto", + // "protos/bundle.proto", + // "protos/packet.proto", + // "protos/relayer.proto", + // "protos/searcher.proto", + // "protos/shared.proto", + // "protos/shredstream.proto", + // "protos/trace_shred.proto", + // ], + // &["protos"], + // ) + // .unwrap(); } diff --git a/jito_protos/json_rpc/http.md b/jito_protos/json_rpc/http.md deleted file mode 100755 index b1b75e5..0000000 --- a/jito_protos/json_rpc/http.md +++ /dev/null @@ -1,245 +0,0 @@ -# JSON RPC HTTP Methods - -The block engine accepts HTTP requests using the [JSON-RPC 2.0](https://www.jsonrpc.org/specification) specification. - -## RPC HTTP Endpoint - -**Default port:** 443 e.g. [https://mainnet.block-engine.jito.wtf:443/api/v1/bundles](https://mainnet.block-engine.jito.wtf:443/api/v1/bundles), [https://{REGION}.mainnet.block-engine.jito.wtf:443/api/v1/bundles](https://${REGION}.mainnet.block-engine.jito.wtf:443/api/v1/bundles) - -## Request Formatting - -To make a JSON-RPC request, send an HTTP POST request with a `Content-Type: application/json` header. The JSON request data should contain 4 fields: - -- `jsonrpc`: `string` - set to "2.0" -- `id`: `number` - a unique client-generated identifying integer -- `method`: `string` - a string containing the method to be invoked -- `params`: `array` - a JSON array of ordered parameter values - -We follow the same request formatting as Solana json rpc requests. You can find the documentation [here](https://docs.solana.com/api/http#request-formatting) - -## Authorization - -In the short-term we don't require authentication to send the requests. - -If there are any changes to the authentication mechanism it would be updated in the document and communicated with all the stakeholders. - -## Definitions - -- Bundle: Bundles are a list of transactions that execute sequentially and atomically. “All or nothing” so to speak. This means that a user can send a bundle that contains multiple transactions and guarantee that they are all executed one after the other and the bundle succeeds only if all individual transactions succeed. -- Hash: A SHA-256 hash of a chunk of data. -- Pubkey: The public key of a Ed25519 key-pair. -- Tip Account: List of accounts to which a tip can be paid for processing the bundles. Clients submitting bundles must pay a tip for bundle processing. -- Transaction: A list of Solana instructions signed by a client keypair to authorize those actions. -- Signature: An Ed25519 signature of transaction's payload data including instructions. This can be used to identify transactions. - -## State Commitment - -The commitment describes how finalized a block is at that point in time. - -In descending order of commitment (most finalized to least finalized), these are the commitment levels: - -- `"finalized"` - the node will query the most recent block confirmed by supermajority - of the cluster as having reached maximum lockout, meaning the cluster has - recognized this block as finalized -- `"confirmed"` - the node will query the most recent block that has been voted on by supermajority of the cluster. - - It incorporates votes from gossip and replay. - - It does not count votes on descendants of a block, only direct votes on that block. - - This confirmation level also upholds "optimistic confirmation" guarantees in - release 1.3 and onwards. -- `"processed"` - the node will query its most recent block. Note that the block - may still be skipped by the cluster. - -Please refer to [configuring-state-commitment](https://docs.solana.com/api/http#configuring-state-commitment) for more details. - -#### RpcResponse Structure - -Many methods that take a commitment parameter return an RpcResponse JSON object comprised of two parts: - -- `context` : An RpcResponseContext JSON structure including a `slot` field at which the operation was evaluated. example: - - ```json - "context": { - "slot": 1 - }, - ``` - -- `value` : The value returned by the operation itself. example: - -```json - "value": [ - { - "bundle": { - "signatures": [ - "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA", - "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv" - ] - }, - "slot": 1234, - "confirmationStatus": "finalized", - "err": "null" - } - ] -``` - -## JSON RPC API Reference - -## getTipAccounts - -Returns the tip accounts for tip payment for the bundles. - -### Parameters - -None - -### Result - -The result field will be a JSON object with the following fields: - -- `result`: `` - Tip accounts as a list of `strings` - -### Code sample - -#### Request - -```bash -curl https://mainnet.block-engine.jito.wtf:443/api/v1/bundles -X POST -H "Content-Type: application/json" -d ' -{ - "jsonrpc": "2.0", - "id": 1, - "method": "getTipAccounts", - "params": [] -} -' -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "result": [ - "9n3d1K5YD2vECAbRFhFFGYNNjiXtHXJWn9F31t89vsAV", - "aTtUk2DHgLhKZRDjePq6eiHRKC1XXFMBiSUfQ2JNDbN", - "B1mrQSpdeMU9gCvkJ6VsXVVoYjRGkNA7TtjMyqxrhecH", - "9ttgPBBhRYFuQccdR1DSnb7hydsWANoDsV3P9kaGMCEh", - "4xgEmT58RwTNsF5xm2RMYCnR1EVukdK8a1i2qFjnJFu3", - "EoW3SUQap7ZeynXQ2QJ847aerhxbPVr843uMeTfc9dxM", - "E2eSqe33tuhAHKTrwky5uEjaVqnb2T9ns6nHHUrN8588", - "ARTtviJkLLt6cHGQDydfo1Wyk6M4VGZdKZ2ZhdnJL336" - ], - "id": 1 -} -``` - -## sendBundle - -Submits a bundled list of signed transaction(s) (base-58 encoded string) to the cluster for processing. The transactions will be atomically processed in order, meaning if any of the transactions fail, the entire bundle won’t be processed (all or nothing). This method does not alter the transaction in any way; it relays the bundle created by clients to the leader as-is. If the bundle is not set to expire before the next upcoming Jito-Solana leader, this method will immediately return a success response acknowledging that the bundle has been received with a bundle_id. This does not guarantee the bundle is processed or landed on-chain. For the bundle status regarding whether it landed or not, getBundleStatuses should be used with the bundle id - -Please note that a tip is necessary for the bundle to considered. A tip can be any instruction, top-level or CPI, that transfers SOL to one of the 8 tip accounts. Clients should make sure they have balance and state assertions that allow the tip to only go thru conditionally, especially if tipping as a separate tx. If the tip is low, there is a chance that the bundle does not get selected during the auction. You can get the tip accounts using [getTipAccounts](#gettipaccounts). Ideally select one of the accounts in random to reduce contention. - -### Parameters - -``: `required` Fully-signed Transactions, as encoded string (base-58) upto a maximum of 5. Please note that at this point, we don't support base-64 encoded transactions - -### Result - -The result field will be a JSON object with the following fields: - -- `result`: `` - A bundle id, used to identify the bundle. This is the Sha256 hashes of the bundle's tx signatures. - -### Code sample - -#### Request - -```bash -curl https://mainnet.block-engine.jito.wtf:443/api/v1/bundles -X POST -H "Content-Type: application/json" -d ' -{ - "jsonrpc": "2.0", - "id": 1, - "method": "sendBundle", - "params": [ - [ - "4VbvoRYXFaXzDBUYfMXP1irhMZ9XRE6F1keS8GbYzKxgdpEasZtRv6GXxbygPp3yBVeSR4wN9JEauSTnVTKjuq3ktM3JpMebYpdGxZWUttJv9N2DzxBm4vhySdq2hbu1LQX7WxS2xsHG6vNwVCjP33Z2ZLP7S5dZujcan1Xq5Z2HibbbK3M3LD59QVuczyK44Fe3k27kVQ43oRH5L7KgpUS1vBoqTd9ZTzC32H62WPHJeLrQiNkmSB668FivXBAfMg13Svgiu9E", - "6HZu11s3SDBz5ytDj1tyBuoeUnwa1wPoKvq6ffivmfhTGahe3xvGpizJkofHCeDn1UgPN8sLABueKE326aGLXkn5yQyrrpuRF9q1TPZqqBMzcDvoJS1khPBprxnXcxNhMUbV78cS2R8LrCU29wjYk5b4JpVtF23ys4ZBZoNZKmPekAW9odcPVXb9HoMnWvx8xwqd7GsVB56R343vAX6HGUMoiB1WgR9jznG655WiXQTff5gPsCP3QJFTXC7iYEYtrcA3dUeZ3q4YK9ipdYZsgAS9H46i9dhDP2Zx3" - ] - ] -} -' -``` - -#### Response - -```json -{ - "jsonrpc": "2.0", - "result": "2id3YC2jK9G5Wo2phDx4gJVAew8DcY5NAojnVuao8rkxwPYPe8cSwE5GzhEgJA2y8fVjDEo6iR6ykBvDxrTQrtpb", - "id": 1 -} -``` - -## getBundleStatuses - -Returns bundle statuses for submitted bundle(s). The behavior is similar to the solana rpc method [getSignatureStatuses](https://docs.solana.com/api/http#getsignaturestatuses). If the bundle_id is not found or if the bundle has not landed, we return null. If found and landed, we return the context information including the slot at which the request was made and result with the bundle_id(s) and the transactions with the slot and confirmation status. - -### Parameters - -- ``: `required` An array of bundle ids to confirm, as base-58 encoded strings (up to a maximum of 5). - -### Result - -An array of RpcResponse`` consisting of either: - -- ``: If the bundle is not found. -- ``: If the bundle is found, an array of objects with the following fields: - - `bundle_id`: `` Bundle id - - `transactions`: `` - A list of base-58 encoded signatures applied by the bundle. The list will not be empty. - - `slot`: `` The slot this bundle was processed in. - - `confirmationStatus`: `` - The bundle transaction's cluster confirmation status; Either processed, confirmed, or finalized. See [Commitment](#state-commitment) for more on optimistic confirmation. - - `err`: ``: This will show any retryable or non-retryable error encountered when getting the bundle status. If retryable, please query again - -### Code sample - -### Request - -```bash -curl https://mainnet.block-engine.jito.wtf:443/api/v1/bundles -X POST -H "Content-Type: application/json" -d ' -{ - "jsonrpc": "2.0", - "id": 1, - "method": "getBundleStatuses", - "params": [ - [ - "892b79ed49138bfb3aa5441f0df6e06ef34f9ee8f3976c15b323605bae0cf51d" - ] - ] -} -' -``` - -### Response - -```json -{ - "jsonrpc": "2.0", - "result": { - "context": { - "slot": 242806119 - }, - "value": [ - { - "bundle_id": "892b79ed49138bfb3aa5441f0df6e06ef34f9ee8f3976c15b323605bae0cf51d", - "transactions": [ - "3bC2M9fiACSjkTXZDgeNAuQ4ScTsdKGwR42ytFdhUvikqTmBheUxfsR1fDVsM5ADCMMspuwGkdm1uKbU246x5aE3", - "8t9hKYEYNbLvNqiSzP96S13XF1C2f1ro271Kdf7bkZ6EpjPLuDff1ywRy4gfaGSTubsM2FeYGDoT64ZwPm1cQUt" - ], - "slot": 242804011, - "confirmation_status": "finalized", - "err": { - "Ok": null - } - } - ] - }, - "id": 1 -} -``` diff --git a/jito_protos/protos/auth.proto b/jito_protos/protos/auth.proto deleted file mode 100755 index da67b4d..0000000 --- a/jito_protos/protos/auth.proto +++ /dev/null @@ -1,76 +0,0 @@ -syntax = "proto3"; - -package auth; - -import "google/protobuf/timestamp.proto"; - -enum Role { - RELAYER = 0; - SEARCHER = 1; - VALIDATOR = 2; - SHREDSTREAM_SUBSCRIBER = 3; -} - -message GenerateAuthChallengeRequest { - /// Role the client is attempting to generate tokens for. - Role role = 1; - - /// Client's 32 byte pubkey. - bytes pubkey = 2; -} - -message GenerateAuthChallengeResponse { - string challenge = 1; -} - -message GenerateAuthTokensRequest { - /// The pre-signed challenge. - string challenge = 1; - - /// The signing keypair's corresponding 32 byte pubkey. - bytes client_pubkey = 2; - - /// The 64 byte signature of the challenge signed by the client's private key. The private key must correspond to - // the pubkey passed in the [GenerateAuthChallenge] method. The client is expected to sign the challenge token - // prepended with their pubkey. For example sign(pubkey, challenge). - bytes signed_challenge = 3; -} - -message Token { - /// The token. - string value = 1; - - /// When the token will expire. - google.protobuf.Timestamp expires_at_utc = 2; -} - -message GenerateAuthTokensResponse { - /// The token granting access to resources. - Token access_token = 1; - - /// The token used to refresh the access_token. This has a longer TTL than the access_token. - Token refresh_token = 2; -} - -message RefreshAccessTokenRequest { - /// Non-expired refresh token obtained from the [GenerateAuthTokens] method. - string refresh_token = 1; -} - -message RefreshAccessTokenResponse { - /// Fresh access_token. - Token access_token = 1; -} - -/// This service is responsible for issuing auth tokens to clients for API access. -service AuthService { - /// Returns a challenge, client is expected to sign this challenge with an appropriate keypair in order to obtain access tokens. - rpc GenerateAuthChallenge(GenerateAuthChallengeRequest) returns (GenerateAuthChallengeResponse) {} - - /// Provides the client with the initial pair of auth tokens for API access. - rpc GenerateAuthTokens(GenerateAuthTokensRequest) returns (GenerateAuthTokensResponse) {} - - /// Call this method with a non-expired refresh token to obtain a new access token. - rpc RefreshAccessToken(RefreshAccessTokenRequest) returns (RefreshAccessTokenResponse) {} -} - diff --git a/jito_protos/protos/block.proto b/jito_protos/protos/block.proto deleted file mode 100755 index 398c494..0000000 --- a/jito_protos/protos/block.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package block; -import "shared.proto"; - -// Condensed block helpful for getting data around efficiently internal to our system. -message CondensedBlock { - shared.Header header = 1; - string previous_blockhash = 2; - string blockhash = 3; - uint64 parent_slot = 4; - repeated bytes versioned_transactions = 5; - uint64 slot = 6; - string commitment = 7; -} diff --git a/jito_protos/protos/block_engine.proto b/jito_protos/protos/block_engine.proto deleted file mode 100755 index 466adea..0000000 --- a/jito_protos/protos/block_engine.proto +++ /dev/null @@ -1,98 +0,0 @@ -syntax = "proto3"; - -import "packet.proto"; -import "shared.proto"; -import "bundle.proto"; - -package block_engine; - -message SubscribePacketsRequest {} -message SubscribePacketsResponse { - shared.Header header = 1; - packet.PacketBatch batch = 2; -} - -message SubscribeBundlesRequest {} -message SubscribeBundlesResponse { - repeated bundle.BundleUuid bundles = 1; -} - -message BlockBuilderFeeInfoRequest {} -message BlockBuilderFeeInfoResponse { - string pubkey = 1; - - // commission (0-100) - uint64 commission = 2; -} - -message AccountsOfInterest { - // use * for all accounts - repeated string accounts = 1; -} - -message AccountsOfInterestRequest {} -message AccountsOfInterestUpdate { - repeated string accounts = 1; -} - -message ProgramsOfInterestRequest {} -message ProgramsOfInterestUpdate { - repeated string programs = 1; -} - -// A series of packets with an expiration attached to them. -// The header contains a timestamp for when this packet was generated. -// The expiry is how long the packet batches have before they expire and are forwarded to the validator. -// This provides a more censorship resistant method to MEV than block engines receiving packets directly. -message ExpiringPacketBatch { - shared.Header header = 1; - packet.PacketBatch batch = 2; - uint32 expiry_ms = 3; -} - -// Packets and heartbeats are sent over the same stream. -// ExpiringPacketBatches have an expiration attached to them so the block engine can track -// how long it has until the relayer forwards the packets to the validator. -// Heartbeats contain a timestamp from the system and is used as a simple and naive time-sync mechanism -// so the block engine has some idea on how far their clocks are apart. -message PacketBatchUpdate { - oneof msg { - ExpiringPacketBatch batches = 1; - shared.Heartbeat heartbeat = 2; - } -} - -message StartExpiringPacketStreamResponse { - shared.Heartbeat heartbeat = 1; -} - -/// Validators can connect to Block Engines to receive packets and bundles. -service BlockEngineValidator { - /// Validators can subscribe to the block engine to receive a stream of packets - rpc SubscribePackets (SubscribePacketsRequest) returns (stream SubscribePacketsResponse) {} - - /// Validators can subscribe to the block engine to receive a stream of simulated and profitable bundles - rpc SubscribeBundles (SubscribeBundlesRequest) returns (stream SubscribeBundlesResponse) {} - - // Block builders can optionally collect fees. This returns fee information if a block builder wants to - // collect one. - rpc GetBlockBuilderFeeInfo (BlockBuilderFeeInfoRequest) returns (BlockBuilderFeeInfoResponse) {} -} - -/// Relayers can forward packets to Block Engines. -/// Block Engines provide an AccountsOfInterest field to only send transactions that are of interest. -service BlockEngineRelayer { - /// The block engine feeds accounts of interest (AOI) updates to the relayer periodically. - /// For all transactions the relayer receives, it forwards transactions to the block engine which write-lock - /// any of the accounts in the AOI. - rpc SubscribeAccountsOfInterest (AccountsOfInterestRequest) returns (stream AccountsOfInterestUpdate) {} - - rpc SubscribeProgramsOfInterest (ProgramsOfInterestRequest) returns (stream ProgramsOfInterestUpdate) {} - - // Validators can subscribe to packets from the relayer and receive a multiplexed signal that contains a mixture - // of packets and heartbeats. - // NOTE: This is a bi-directional stream due to a bug with how Envoy handles half closed client-side streams. - // The issue is being tracked here: https://github.com/envoyproxy/envoy/issues/22748. In the meantime, the - // server will stream heartbeats to clients at some reasonable cadence. - rpc StartExpiringPacketStream (stream PacketBatchUpdate) returns (stream StartExpiringPacketStreamResponse) {} -} diff --git a/jito_protos/protos/bundle.proto b/jito_protos/protos/bundle.proto deleted file mode 100755 index 7b0f954..0000000 --- a/jito_protos/protos/bundle.proto +++ /dev/null @@ -1,111 +0,0 @@ -syntax = "proto3"; - -import "packet.proto"; -import "shared.proto"; - -package bundle; - -message Bundle { - shared.Header header = 2; - repeated packet.Packet packets = 3; -} - -message BundleUuid { - bundle.Bundle bundle = 1; - string uuid = 2; -} - -/* Bundle Result Types */ - -// Indicates the bundle was accepted and forwarded to a validator. -// NOTE: A single bundle may have multiple events emitted if forwarded to many validators. -message Accepted { - // Slot at which bundle was forwarded. - uint64 slot = 1; - - // Validator identity bundle was forwarded to. - string validator_identity = 2; -} - -// Indicates the bundle was dropped and therefore not forwarded to any validator. -message Rejected { - oneof reason { - StateAuctionBidRejected state_auction_bid_rejected = 1; - WinningBatchBidRejected winning_batch_bid_rejected = 2; - SimulationFailure simulation_failure = 3; - InternalError internal_error = 4; - DroppedBundle dropped_bundle = 5; - } -} - -// Indicates the bundle's bid was high enough to win its state auction. -// However, not high enough relative to other state auction winners and therefore excluded from being forwarded. -message WinningBatchBidRejected { - // Auction's unique identifier. - string auction_id = 1; - // Bundle's simulated bid. - uint64 simulated_bid_lamports = 2; - optional string msg = 3; -} - -// Indicates the bundle's bid was __not__ high enough to be included in its state auction's set of winners. -message StateAuctionBidRejected { - // Auction's unique identifier. - string auction_id = 1; - // Bundle's simulated bid. - uint64 simulated_bid_lamports = 2; - optional string msg = 3; -} - -// Bundle dropped due to simulation failure. -message SimulationFailure { - // Signature of the offending transaction. - string tx_signature = 1; - optional string msg = 2; -} - -// Bundle dropped due to an internal error. -message InternalError { - string msg = 1; -} - -// Bundle dropped (e.g. because no leader upcoming) -message DroppedBundle { - string msg = 1; -} - -message Finalized {} -message Processed { - string validator_identity = 1; - uint64 slot = 2; - /// Index within the block. - uint64 bundle_index = 3; -} -message Dropped { - DroppedReason reason = 1; -} -enum DroppedReason { - BlockhashExpired = 0; - // One or more transactions in the bundle landed on-chain, invalidating the bundle. - PartiallyProcessed = 1; - // This indicates bundle was processed but not finalized. This could occur during forks. - NotFinalized = 2; -} - -message BundleResult { - // Bundle's Uuid. - string bundle_id = 1; - - oneof result { - // Indicated accepted by the block-engine and forwarded to a jito-solana validator. - Accepted accepted = 2; - // Rejected by the block-engine. - Rejected rejected = 3; - // Reached finalized commitment level. - Finalized finalized = 4; - // Reached a processed commitment level. - Processed processed = 5; - // Was accepted and forwarded by the block-engine but never landed on-chain. - Dropped dropped = 6; - } -} diff --git a/jito_protos/protos/packet.proto b/jito_protos/protos/packet.proto deleted file mode 100755 index 23042a3..0000000 --- a/jito_protos/protos/packet.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package packet; - -message PacketBatch { - repeated Packet packets = 1; -} - -message Packet { - bytes data = 1; - Meta meta = 2; -} - -message Meta { - uint64 size = 1; - string addr = 2; - uint32 port = 3; - PacketFlags flags = 4; - uint64 sender_stake = 5; -} - -message PacketFlags { - bool discard = 1; - bool forwarded = 2; - bool repair = 3; - bool simple_vote_tx = 4; - bool tracer_packet = 5; - bool from_staked_node = 6; -} - diff --git a/jito_protos/protos/relayer.proto b/jito_protos/protos/relayer.proto deleted file mode 100755 index 5058d1f..0000000 --- a/jito_protos/protos/relayer.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -import "packet.proto"; -import "shared.proto"; - -package relayer; - -message GetTpuConfigsRequest {} -message GetTpuConfigsResponse { - shared.Socket tpu = 1; - shared.Socket tpu_forward = 2; -} - -message SubscribePacketsRequest {} -message SubscribePacketsResponse { - shared.Header header = 1; - oneof msg { - shared.Heartbeat heartbeat = 2; - packet.PacketBatch batch = 3; - } -} - -/// Relayers offer a TPU and TPU forward proxy for Solana validators. -/// Validators can connect and fetch the TPU configuration for the relayer and start to advertise the -/// relayer's information in gossip. -/// They can also subscribe to packets which arrived on the TPU ports at the relayer -service Relayer { - // The relayer has TPU and TPU forward sockets that validators can leverage. - // A validator can fetch this config and change its TPU and TPU forward port in gossip. - rpc GetTpuConfigs (GetTpuConfigsRequest) returns (GetTpuConfigsResponse) {} - - // Validators can subscribe to packets from the relayer and receive a multiplexed signal that contains a mixture - // of packets and heartbeats - rpc SubscribePackets (SubscribePacketsRequest) returns (stream SubscribePacketsResponse) {} -} diff --git a/jito_protos/protos/searcher.proto b/jito_protos/protos/searcher.proto deleted file mode 100755 index 06a9882..0000000 --- a/jito_protos/protos/searcher.proto +++ /dev/null @@ -1,92 +0,0 @@ -syntax = "proto3"; - -package searcher; - -import "bundle.proto"; - -message SlotList { - repeated uint64 slots = 1; -} - -message ConnectedLeadersResponse { - // Mapping of validator pubkey to leader slots for the current epoch. - map connected_validators = 1; -} - -message SendBundleRequest { - bundle.Bundle bundle = 1; -} - -message SendBundleResponse { - // server uuid for the bundle - string uuid = 1; -} - -message NextScheduledLeaderRequest { - // Defaults to the currently connected region if no region provided. - repeated string regions = 1; -} - -message NextScheduledLeaderResponse { - // the current slot the backend is on - uint64 current_slot = 1; - - // the slot of the next leader - uint64 next_leader_slot = 2; - // the identity pubkey (base58) of the next leader - string next_leader_identity = 3; - // the block engine region of the next leader - string next_leader_region = 4; -} - -message ConnectedLeadersRequest {} - -message ConnectedLeadersRegionedRequest { - // Defaults to the currently connected region if no region provided. - repeated string regions = 1; -} -message ConnectedLeadersRegionedResponse { - map connected_validators = 1; -} - - -message GetTipAccountsRequest {} - -message GetTipAccountsResponse { - repeated string accounts = 1; -} - -message SubscribeBundleResultsRequest {} - -message GetRegionsRequest {} -message GetRegionsResponse { - // The region the client is currently connected to - string current_region = 1; - - // Regions that are online and ready for connections - // All regions: https://jito-labs.gitbook.io/mev/systems/connecting/mainnet - repeated string available_regions = 2; -} - -service SearcherService { - // Searchers can invoke this endpoint to subscribe to their respective bundle results. - // A success result would indicate the bundle won its state auction and was submitted to the validator. - rpc SubscribeBundleResults (SubscribeBundleResultsRequest) returns (stream bundle.BundleResult) {} - - rpc SendBundle (SendBundleRequest) returns (SendBundleResponse) {} - - // Returns the next scheduled leader connected to the block engine. - rpc GetNextScheduledLeader (NextScheduledLeaderRequest) returns (NextScheduledLeaderResponse) {} - - // Returns leader slots for connected jito validators during the current epoch. Only returns data for this region. - rpc GetConnectedLeaders (ConnectedLeadersRequest) returns (ConnectedLeadersResponse) {} - - // Returns leader slots for connected jito validators during the current epoch. - rpc GetConnectedLeadersRegioned (ConnectedLeadersRegionedRequest) returns (ConnectedLeadersRegionedResponse) {} - - // Returns the tip accounts searchers shall transfer funds to for the leader to claim. - rpc GetTipAccounts (GetTipAccountsRequest) returns (GetTipAccountsResponse) {} - - // Returns region the client is directly connected to, along with all available regions - rpc GetRegions (GetRegionsRequest) returns (GetRegionsResponse) {} -} diff --git a/jito_protos/protos/shared.proto b/jito_protos/protos/shared.proto deleted file mode 100755 index bdf391d..0000000 --- a/jito_protos/protos/shared.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -import "google/protobuf/timestamp.proto"; - -package shared; - -message Header { - google.protobuf.Timestamp ts = 1; -} - -message Heartbeat { - uint64 count = 1; -} - -message Socket { - string ip = 1; - int64 port = 2; -} diff --git a/jito_protos/protos/shredstream.proto b/jito_protos/protos/shredstream.proto deleted file mode 100755 index af89449..0000000 --- a/jito_protos/protos/shredstream.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package shredstream; - -import "shared.proto"; - -message Heartbeat { - // don't trust IP:PORT from tcp header since it can be tampered over the wire - // `socket.ip` must match incoming packet's ip. this prevents spamming an unwitting destination - shared.Socket socket = 1; - - // regions for shredstream proxy to receive shreds from - // list of valid regions: https://jito-labs.gitbook.io/mev/systems/connecting/mainnet - repeated string regions = 2; -} - -message HeartbeatResponse { - // client must respond within `ttl_ms` to keep stream alive - uint32 ttl_ms = 1; -} - -service Shredstream { - // RPC endpoint to send heartbeats to keep shreds flowing - rpc SendHeartbeat (Heartbeat) returns (HeartbeatResponse) {} -} diff --git a/jito_protos/protos/trace_shred.proto b/jito_protos/protos/trace_shred.proto deleted file mode 100755 index 560d443..0000000 --- a/jito_protos/protos/trace_shred.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package trace_shred; - -import "google/protobuf/timestamp.proto"; - -message TraceShred { - // source region, one of: https://jito-labs.gitbook.io/mev/systems/connecting/mainnet - string region = 1; - // timestamp of creation - google.protobuf.Timestamp created_at = 2; - // monotonically increases, resets upon service restart - uint32 seq_num = 3; -} -