Runtime and RPC service
The Runtime and RPC service hosts a local Solana-compatible chain for tests and client tools. It joins SVM execution, local and durable state, optional remote account data, HTTP and WebSocket RPC, test controls, and event output so all clients share one session view.
Runtime boundary
The surfpool-core runtime creates one local chain session and gives RPC handlers, execution loops, and observers access to that session. This shared boundary keeps reads, writes, slot progress, and downstream events tied to one chain view. crates/…/svm.rs• L490-614 crates/…/locker.rs• L178-253
The runtime has two linked roles. It is the chain that clients read and change. It is also the source of session and Geyser events that report accepted changes to other tools. The related Shared contracts page explains the data shapes that cross these boundaries. crates/…/mod.rs• L90-129 crates/…/svm.rs• L1123-1167
References: crates/…/svm.rs• L490-614 crates/…/locker.rs• L178-253 crates/…/mod.rs• L90-129
Local chain state
Local chain state combines SVM execution with accounts, slots, blocks, transactions, indexes, subscriptions, profiles, startup status, scheduled scenario overrides, and test-session controls. The state can use memory only or connect to durable storage. The related State and Surfnet page explains this state boundary. crates/…/svm.rs• L490-614 crates/…/surfnet_lite_svm.rs• L51-117
Account data has a source and an update policy. Local writes stay authoritative. Database and remote data fill missing state without replacing newer local state. Program data and token mints can travel with the account that needs them. crates/…/mod.rs• L251-286 crates/…/locker.rs• L308-435
The SVM manages its Clock, SlotHashes, RecentBlockhashes, EpochSchedule, and LastRestartSlot values. RPC cannot write these managed sysvars through account mutation; time control is the supported path. crates/…/surfnet_lite_svm.rs• L30-47
References: crates/…/svm.rs• L490-614 crates/…/surfnet_lite_svm.rs• L30-117 crates/…/mod.rs• L251-286 crates/…/locker.rs• L308-435
Durable state
Durable state preserves account data, blocks, transactions, indexes, profiles, bundles, slot checkpoints, time-travel records, and session records across runtime restarts when a persistent backend is configured. Stored transaction records retain the metadata needed for status, history, and encoded transaction responses. crates/…/svm.rs• L490-614 crates/…/types.rs• L183-329
The runtime restores known chain state before it serves normal work. Profiling and bundle work use isolated storage views. A failed isolated operation can therefore disappear without changing live state or its observers. crates/…/svm.rs• L796-922 crates/…/svm.rs• L952-1031
References: crates/…/svm.rs• L490-614 crates/…/svm.rs• L796-922 crates/…/svm.rs• L952-1031 crates/…/types.rs• L183-329
Runtime events
Runtime events describe accepted state changes to session observers, Geyser plugins, and WebSocket subscribers. They cover account changes, transactions, logs, slots, blocks, entries, startup accounts, and snapshot progress. crates/…/mod.rs• L90-129 crates/…/svm.rs• L523-538
Isolated work buffers its events until its state is accepted. A successful bundle replays those events onto the live channels. A failed simulation or bundle drops both its state changes and its buffered events. crates/…/svm.rs• L952-1031 crates/…/svm.rs• L1123-1167
References: crates/…/mod.rs• L90-129 crates/…/svm.rs• L523-538 crates/…/svm.rs• L952-1031 crates/…/svm.rs• L1123-1167
Service endpoints
The service exposes request-response JSON-RPC over HTTP and long-lived JSON-RPC subscriptions over WebSocket. Both transports use the same runtime middleware and chain view. WebSocket connections add session state for live streams. crates/…/mod.rs• L1105-1286 crates/…/mod.rs• L116-140
Each request receives the runtime context needed to read state, submit commands, use optional remote data, apply session policy, and manage plugins. State-changing methods enter the same command path as transaction processing and block production. crates/…/mod.rs• L49-112 crates/…/mod.rs• L517-649
The middleware checks each call in a batch. Notifications execute without a response. Cheatcode policy is applied before dispatch, so one disabled control does not block unrelated calls in the same batch. crates/…/mod.rs• L144-255 crates/…/mod.rs• L258-347
The service checks both addresses before binding. If WebSocket startup fails after HTTP startup, it closes the HTTP server before it reports the error. During normal shutdown it sends a close to each tracked WebSocket session, waits briefly for sessions to leave, and then closes the server. crates/…/mod.rs• L154-173 crates/…/mod.rs• L1044-1061 crates/…/mod.rs• L1105-1159
RPC method families
The server groups methods by client capability rather than by transport. The main families are:
| Family | Purpose |
|---|---|
| Node and bank data | Report identity, health, slots, epochs, versions, rent, inflation, leader information, supply, and other bank facts. |
| Account data and scans | Read accounts and find program-owned or token-related accounts. |
| Transaction and block data | Simulate or submit transactions and inspect blocks, signatures, status, fees, address history, and encoded transaction records. |
| WebSocket subscriptions | Stream account, program, signature, slot, slot-lifecycle, log, block, snapshot, and slot-related changes. |
| Jito bundle RPC | Simulate, submit, and inspect ordered transaction bundles. |
| Surfnet cheatcodes | Change test state, control time, profile work, manage snapshots and streamed accounts, and inspect session data. |
| Administrative RPC | Stop the service and manage loaded Geyser plugins. |
The child page RPC surface describes the client-facing method families. Registration is shared across the runtime, while WebSocket adds pubsub handlers and session metadata. Subscription tasks now wait on a runtime wake signal and re-check their channel, so updates do not depend on the next periodic poll. Some compatibility subscription names remain present without a live event stream, such as vote and root subscriptions. crates/…/mod.rs• L1173-1197 crates/…/mod.rs• L1228-1286 crates/…/ws.rs• L91-1071 crates/…/ws.rs• L1270-1410 crates/…/ws.rs• L1510-1565 crates/…/ws.rs• L1982-2163 crates/…/ws.rs• L2179-2191
References: crates/…/mod.rs• L1105-1286 crates/…/mod.rs• L116-347 crates/…/minimal.rs• L34-87 crates/…/bank_data.rs• L15-72 crates/…/accounts_data.rs• L25-96 crates/…/accounts_scan.rs• L23-113 crates/…/full.rs• L191-260 crates/…/jito.rs• L38-93 crates/…/surfnet_cheatcodes.rs• L146-193 crates/…/ws.rs• L91-1071
RPC data source
RPC reads use the local chain as the main view. When remote fallback is enabled, missing accounts are fetched from the configured Solana RPC and merged into local state without replacing a newer local write. Offline account rules can block the fetch. crates/…/locker.rs• L456-529 crates/…/locker.rs• L547-655
Historical signature reads can combine local session data with remote history. The service treats local slots from the local chain's starting slot as authoritative and uses the remote source only for earlier slots. The custom getTransactionsForAddress query passes through the shared access boundary but remains local-ledger only. crates/…/locker.rs• L1422-1630 crates/…/locker.rs• L1175-1187 crates/…/full.rs• L2434-2459
The remote service is a data source, not a second live chain. Calls have a full-call deadline of 60 seconds and an HTTP timeout of 30 seconds. Multiple-account reads split requests into groups of at most 100 and restore the caller's input order after concurrent fetches. Unsupported remote methods can fall back to local behavior where the RPC family allows it. crates/…/remote.rs• L56-65 crates/…/remote.rs• L141-185 crates/…/remote.rs• L409-437 crates/…/remote.rs• L805-820
An upstream answer that says a mint is unknown means that the remote side has no matching token accounts. The runtime treats that case as an empty remote result so local accounts remain visible. Other provider errors remain errors. Remote error text names a safe endpoint form and does not expose credentials. crates/…/remote.rs• L67-139 crates/…/remote.rs• L111-126 crates/…/remote.rs• L623-724
References: crates/…/locker.rs• L456-655 crates/…/locker.rs• L1422-1630 crates/…/full.rs• L2434-2459 crates/…/remote.rs• L56-185 crates/…/remote.rs• L409-437 crates/…/remote.rs• L623-820
Account reads and scans
Account RPC presents local account state in Solana UI forms. It supports single and grouped reads, token balances and supply, program-owned account scans, largest-account views, and token-account filters. The same account access layer supplies context slots and token metadata to these responses. crates/…/accounts_data.rs• L25-96 crates/…/accounts_scan.rs• L23-113
The read captures its commitment context before it loads missing accounts. Remote hydration therefore does not silently move the response to a later slot. Token views support both the legacy SPL Token program and Token-2022. Time-based token extensions use the current local clock when the runtime formats UI amounts. crates/…/accounts_data.rs• L349-470 crates/…/accounts_data.rs• L496-625 crates/…/accounts_scan.rs• L464-512 crates/…/svm.rs• L616-634
References: crates/…/accounts_data.rs• L348-645 crates/…/accounts_scan.rs• L459-686 crates/…/utils.rs• L37-101 crates/…/svm.rs• L616-634
Node and bank data
Minimal and bank RPC provide the chain facts that clients need before they read or submit work. They expose balances, slots, epochs, block height, genesis and identity data, rent, inflation, leader information, version data, and supply-related values from the local session.
These methods describe a single local simulation node rather than a validator set. Health reports the local service as ready, vote and block-production views can be empty, and the service uses its fixed local identity as leader. Snapshot queries report that no snapshot is available. Context and minimum-slot checks still apply where a method accepts them. crates/…/minimal.rs• L575-774 crates/…/bank_data.rs• L393-538 crates/…/utils.rs• L249-267
References: crates/…/minimal.rs• L34-774 crates/…/bank_data.rs• L15-538 crates/…/svm.rs• L413-445
Transaction interfaces
Transaction RPC accepts legacy, version 0, and version 1 forms through base58 and base64 encodings supported by the service. Legacy and version 0 payloads use the packet-size wire limit. Version 1 uses its larger protocol limit. Invalid encodings, versions, and payload sizes fail before execution. crates/…/utils.rs• L125-219
The service separates simulation from live submission and reports status, history, logs, account changes, return data, loaded-account data size, and compute use through a common transaction record. Submission and simulation honor the requested minimum context at the commitment view used for the request. crates/…/full.rs• L1753-2070 crates/…/types.rs• L249-329 crates/…/types.rs• L438-589
Address history is also available through getTransactionsForAddress. It returns either signature summaries or full encoded transactions, applies address, slot, block-time, success, and token-account filters, and uses a pagination cursor for later pages. The RPC enters the shared account access boundary, but the current locker path reads the local ledger only. crates/…/full.rs• L1150-1184 crates/…/full.rs• L2434-2459 crates/…/locker.rs• L1176-1419
References: crates/…/utils.rs• L125-267 crates/…/full.rs• L191-260 crates/…/full.rs• L1753-2070 crates/…/full.rs• L1150-1184 crates/…/full.rs• L2434-2459 crates/…/locker.rs• L1176-1419 crates/…/types.rs• L249-329
Test control RPC
Surfnet cheatcodes extend standard Solana RPC for controlled local tests. They can change account and token state, write or clone programs, set supply and authorities, register IDLs and scenarios, profile work, export snapshots, control remote account loading, reset state, control the clock, and inspect startup and runbook state. crates/…/surfnet_cheatcodes.rs• L146-416 crates/…/surfnet_cheatcodes.rs• L745-976 crates/…/surfnet_cheatcodes.rs• L978-1224
Cheatcodes are session controls rather than normal cluster operations. The session can enable or disable named controls. A lockout makes selected controls stay disabled for the life of the session. Locking all controls also removes the test-only paths for airdrops, snapshot import, service stop, and plugin management. The policy is checked before handler execution, including for each method in an HTTP or WebSocket batch. The registered method list is kept as a session contract so the control surface and its client manifest do not drift. crates/…/mod.rs• L144-347 crates/…/surfnet_cheatcodes.rs• L195-287 crates/…/surfnet_cheatcodes.rs• L1630-1754 crates/…/surfnet_cheatcodes.rs• L2588-2604 crates/…/mod.rs• L1175-1189
Scenario registration chooses an explicit base slot or the next slot the surfnet produces, then schedules overrides for their target slots; it does not apply them during registration. A base slot that has already been produced is rejected. Overrides take effect when the surfnet produces their slot. Time travel produces only the next slot before jumping, so skipped scheduled slots are not applied; step one slot at a time. crates/…/surfnet_cheatcodes.rs• L1423-1446 crates/…/surfnet_cheatcodes.rs• L2534-2553
Confidential-transfer helpers support Token-2022 tests. A caller can derive test keys from a signed seed, build a configured account, and read available or pending balances with the matching secrets. The signature and returned secrets are test data that must stay private to the local test connection. crates/…/surfnet_cheatcodes.rs• L1226-1361 crates/…/surfnet_cheatcodes.rs• L2398-2457
References: crates/…/surfnet_cheatcodes.rs• L146-416 crates/…/surfnet_cheatcodes.rs• L745-976 crates/…/surfnet_cheatcodes.rs• L978-1224 crates/…/surfnet_cheatcodes.rs• L1226-1361 crates/…/surfnet_cheatcodes.rs• L1423-1446 crates/…/surfnet_cheatcodes.rs• L1630-1754 crates/…/surfnet_cheatcodes.rs• L1742-1900 crates/…/surfnet_cheatcodes.rs• L2378-2553 crates/…/mod.rs• L144-347
Startup and readiness
Startup creates the local SVM, connects to an optional remote data source, applies airdrops and snapshots, starts RPC and plugin services, and then starts clock and block processing. Public readiness is separate from server binding. The session becomes ready only after its startup plan reaches a terminal state. crates/…/mod.rs• L175-355
The startup plan records work such as remote account hydration and runbook execution. A runtime-managed session seals an empty plan. An externally planned session seals its declared work. Every declared task must report success or failure before readiness can complete. Deliberately offline accounts do not count as unexpected hydration failures. crates/…/mod.rs• L328-355 crates/…/mod.rs• L559-649
This diagram shows the separation between service startup and public readiness.
flowchart TD
A[Create local SVM] --> B[Connect to optional datasource]
B --> C[Apply airdrops and snapshots]
C --> D[Start HTTP and WebSocket RPC]
D --> E[Start Geyser handling]
E --> F[Seal startup plan]
F --> G[Complete startup work]
G --> H[Ready]
G --> I[Failed]
References: crates/…/mod.rs• L175-355 crates/…/mod.rs• L328-355 crates/…/mod.rs• L559-649
Execution and block flow
The runtime separates transaction work from slot and block advancement. RPC handlers send state-changing commands to the block-production loop. That loop receives transaction, bundle, clock, startup, time-control, and shutdown commands. The child page Execution runloops explains these loops in detail. crates/…/mod.rs• L357-681
Transaction lifecycle
Simulation runs against an isolated execution view and does not change live state. Live processing loads needed accounts, executes the transaction, records status and metadata, publishes accepted events, and queues confirmation work. The RPC waits for a terminal processing result without running transaction work inside the server worker. crates/…/full.rs• L1753-1946 crates/…/locker.rs• L1633-1659 crates/…/types.rs• L438-589
When an account is missing, the transaction path can hydrate it from the remote source before execution. Address lookup table accounts and their loaded addresses follow the same local cache boundary. crates/…/locker.rs• L547-655 crates/…/jito.rs• L1000-1044
References: crates/…/full.rs• L1753-1946 crates/…/locker.rs• L547-655 crates/…/locker.rs• L1633-1659 crates/…/types.rs• L438-589 crates/…/jito.rs• L1000-1044
Slot and block production
Block production determines when processed work becomes part of a confirmed block. The selected mode controls whether confirmation follows clock ticks, accepted transaction work, or an explicit slot-forward command. In transaction mode, the runtime schedules follow-up blocks while pending work still needs to move through finalization. crates/…/mod.rs• L357-383 crates/…/mod.rs• L415-541 crates/…/mod.rs• L664-678
The clock loop emits ticks at the configured interval. Time travel updates the local clock, slot, epoch, and timestamp without rewinding. The block loop confirms the current block after the update and reports the new epoch state to callers. crates/…/mod.rs• L391-506 crates/…/time_travel.rs• L7-233
| Mode | Confirmation trigger |
|---|---|
clock | A clock tick. |
transaction | A processed transaction or completed airdrop, followed by queued confirmation work until finalization completes. |
manual | An explicit slot-forward command. |
References: crates/…/mod.rs• L357-506 crates/…/mod.rs• L517-678 crates/…/time_travel.rs• L7-233
Commitment and subscriptions
Transaction status moves through processed, confirmed, and finalized views as slots advance. WebSocket streams report the matching account, program, signature, slot, log, block, snapshot, and slot-lifecycle changes. This gives subscribers the same chain view as ordinary RPC reads. crates/…/mod.rs• L169-217 crates/…/mod.rs• L364-405 crates/…/ws.rs• L1157-1365 crates/…/ws.rs• L1950-2145
Subscription workers wait for the runtime's shared wake signal before they re-check their update channel. This removes the normal polling delay while keeping a short re-check interval for unsubscribe and channel-close cleanup. The pattern applies to account, program, signature, slot, log, block, slot-lifecycle, and snapshot streams. crates/…/ws.rs• L43-69 crates/…/ws.rs• L1377-1410 crates/…/ws.rs• L1522-1565 crates/…/ws.rs• L1634-1675 crates/…/ws.rs• L1736-1777 crates/…/ws.rs• L1898-1944 crates/…/ws.rs• L2017-2060 crates/…/ws.rs• L2144-2163 crates/…/ws.rs• L2242-2301
Signature subscriptions check current local state while registering for future updates as one coordinated action. A matching signature notification ends that stream. Account, program, log, block, snapshot, and slot streams remain active until the client unsubscribes or closes the connection. Slot-lifecycle notifications expose the simulator's created-bank, frozen, optimistic-confirmation, and root stages. Root and vote subscription names are available for compatibility but do not produce live updates. crates/…/ws.rs• L1189-1365 crates/…/ws.rs• L1413-1559 crates/…/ws.rs• L1950-2259
Block subscriptions accept all blocks or blocks that mention an account or program. They require at least confirmed commitment and use the same block encoding choices as block reads. crates/…/ws.rs• L911-933 crates/…/ws.rs• L2049-2145
References: crates/…/mod.rs• L169-217 crates/…/mod.rs• L364-405 crates/…/ws.rs• L43-69 crates/…/ws.rs• L91-1071 crates/…/ws.rs• L1157-1410 crates/…/ws.rs• L1510-1777 crates/…/ws.rs• L1898-2163 crates/…/ws.rs• L2193-2301
Atomic bundle execution
Jito bundle requests run transactions in order against an isolated execution view. sendBundle commits only when all transactions succeed. A failed bundle leaves live state, storage, and event streams unchanged. simulateBundle uses the same ordered view but always discards it. crates/…/jito.rs• L38-57 crates/…/jito.rs• L168-252
Bundle commit checks whether live state changed during isolated execution. A stale bundle is retried from a fresh view up to the service limit. On success, the runtime stores the bundle identifier and exposes its signatures through the normal transaction status path. crates/…/jito.rs• L851-913 crates/…/svm.rs• L952-1031
References: crates/…/jito.rs• L38-57 crates/…/jito.rs• L168-252 crates/…/jito.rs• L851-913 crates/…/svm.rs• L952-1031
Plugin and client integration
Geyser plugins provide an event integration point for indexers. The runtime loads configured plugins and can load, unload, reload, and list them through administrative RPC. Plugins receive startup account data and live transaction, account, slot, block, and entry events. crates/…/mod.rs• L72-152 crates/…/mod.rs• L737-984
Session events are separate from RPC responses. A CLI or embedding service can use them to report startup, transaction, clock, plugin, and shutdown state without changing the Solana RPC contract. crates/…/mod.rs• L90-129 crates/…/mod.rs• L267-355
References: crates/…/mod.rs• L72-152 crates/…/mod.rs• L737-984 crates/…/mod.rs• L90-129 crates/…/mod.rs• L267-355
Change checklist
When these files or sections are changed, remember to consider these:
- Keep HTTP and WebSocket registration aligned with the shared runtime context. A method family must remain reachable through its intended transport.
- Keep server bind checks, startup handshakes, failure events, and close handles aligned. A failed WebSocket bind must not leave HTTP serving on its port.
- Keep state-changing RPC methods on the command and SVM access paths. A direct write can bypass confirmation, persistence, or event publication.
- Keep batch policy checks per call. A disabled cheatcode must not block unrelated calls in the same batch, and notifications must remain response-free.
- Keep the registered cheatcode method list aligned with the RPC trait and client manifest. A renamed method can make controls appear enabled while client bindings use a different name.
- Keep WebSocket session tracking aligned with session creation and close callbacks. Shutdown must send close frames before the server closes.
- Keep WebSocket subscription maps aligned with event sources, notification payloads, and unsubscribe behavior. A new stream must not expose a confirmation without a matching live event path.
- Keep each subscription's wake signal aligned with its update channel. A missing wake can restore polling latency or prevent prompt cleanup when the channel closes.
- Keep account source, update policy, remote fallback, offline rules, and local-write precedence aligned. Remote or database data must not replace newer local state.
- Keep account response context selection before asynchronous hydration. A fetched account must not change the slot reported for the read.
- Keep remote account batching ordered and bounded. A response that maps to the wrong requested key can silently corrupt the local chain view.
- Keep remote and local history ranges ordered, deduplicated, and split at the local history boundary. A gap or duplicate can change signature and address-history results.
- Keep commitment selection,
minContextSlotchecks, and response context slots aligned. A read must not validate against one slot and report another. - Keep startup task declaration, completion, plan sealing, and readiness transitions aligned. A task without a terminal result can leave the session unready.
- Keep transaction encoding, supported versions, version-specific wire-size limits, response defaults, and persisted transaction records aligned across submission, simulation, restart, and history RPC.
- Keep address-history detail modes, limits, cursors, filters, sort order, transaction indexes, and encoding aligned between the RPC response and local or remote ledger query.
- Keep address-history scope explicit.
getTransactionsForAddresscurrently reads the local ledger only, even when a datasource is configured. - Keep fee estimation aligned with message prioritization settings and the supported transaction versions.
- Keep overlay commit and event replay atomic. Failed simulation or bundle work must not reach live storage or subscribers.
- Keep bundle state-revision checks and bundle-signature records aligned with retry and status lookup behavior.
- Keep bundle size, encoding, snapshot configuration length, and blockhash replacement rules aligned with the Jito wire contract.
- Keep account scan filter validation aligned with the account index and token-program support.
- Keep scenario base-slot selection, relative-slot overflow validation, scheduling, and production-time application aligned. A scenario must not mutate account state during registration; overrides must apply only when their target slot is produced.
- Keep time-travel behavior aligned with scheduled scenario slots. A jump that skips a slot must not silently claim that the skipped override was applied.
- Keep time-travel math aligned with slot time and the configured epoch schedule. Targets in the past must remain rejected.
- Keep managed sysvar writes rejected through account mutation. Clock, epoch, and blockhash state must change through runtime controls.
- Keep startup account events distinct from live account events so plugins receive the correct startup marker.
- Keep Geyser slot, block, entry, transaction, and account event shapes aligned with the plugin interface.
- Keep datasource error messages sanitized. Credentials in datasource URLs must not reach RPC clients or session events.
- Keep confidential cheatcode inputs and outputs scoped to local test connections. The derivation signature and returned keys are equivalent secret material.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An HTTP or WebSocket address is invalid or its port is in use | The service cannot start. | Parse both addresses and check availability before server creation. |
| WebSocket startup fails after HTTP startup | HTTP could stay bound while startup reports failure. | Close the HTTP server handle before returning the WebSocket error. |
| The server startup handshake reports success before its server is ready | Callers can use a service that did not bind correctly. | Send the close handle only after server creation succeeds. |
| The service shuts down with active WebSocket sessions | Clients can lose their subscriptions without a normal close. | Close tracked sessions first, allow a short grace period, then close the server. |
| A declared startup task never reports a result | Public readiness remains blocked. | Complete every declared task with success or failure. |
| A remote call exceeds its deadline | The RPC call fails instead of leaving the session waiting without limit. | Bound the full datasource call and sanitize the error. |
| A remote account result races with a local write | Older remote data could replace newer local state. | Re-check local state under the writer boundary and hydrate only when absent. |
| Account hydration completes after the response context was chosen incorrectly | The response can report a slot that does not describe the read. | Capture the commitment slot before account loading and use it for the response. |
| A batch contains a disabled cheatcode | That call is rejected while allowed calls continue. | Apply policy to each batch element before dispatch. |
| A cheatcode trait changes without its method manifest changing | Client control or generated bindings can drift from the server surface. | Compare registered RPC names with the canonical manifest. |
| A request asks for a minimum context slot above its commitment view | The request fails instead of returning data from a newer view. | Compare the minimum slot with the selected commitment slot and report that slot. |
| A transaction uses an unsupported encoding, version, or version-specific wire size | Submission or simulation returns invalid parameters before execution. | Keep decoding, version support, and legacy, version 0, and version 1 size checks aligned. |
| A live transaction fails before a terminal status is recorded | A client waiting for its signature can wait without a final result. | Publish a failure status before returning the processing error. |
| Transaction mode confirms only the first block for a processed transaction | The transaction can remain short of the expected finalized view. | Queue follow-up blocks while pending work still needs finalization. |
| A subscription update channel is not paired with the runtime wake signal | Notifications can wait for the polling interval instead of arriving with the update, and cleanup can be slow. | Use the shared wake-aware receive path for every subscription worker. |
| A block subscription asks for less than confirmed commitment | The subscription is rejected before it can produce a stream. | Enforce the minimum commitment supported by block notifications. |
| An address-history request uses a zero limit or a full transaction above its supported version | The request fails instead of returning a misleading or oversized page. | Validate limits and encode full entries with the requested version cap. |
A client expects getTransactionsForAddress to search the remote datasource | Remote-only address history is absent from the result. | Treat the method as a local-ledger query until remote history support exists. |
| A managed sysvar is written through account mutation | Runtime clock or block state can become inconsistent with the SVM view. | Reject writes to managed sysvars and use the time-control path. |
| A time-travel target is before the current slot, epoch, or timestamp | The clock update is rejected rather than rewinding the chain. | Validate the target and the slot and epoch schedule inputs. |
| A scenario uses an already produced base slot | Registration is rejected and no overrides are scheduled. | Choose the next produced slot by default and reject an explicit base slot that is already produced. |
| A scenario relative slot overflows the base slot | Registration is rejected without partial scheduling. | Validate every relative slot before adding any scheduled override. |
| A scheduled scenario slot is skipped by time travel | Its override is not applied. | Produce each target slot in order when a scenario depends on intermediate overrides. |
| A bundle exceeds its size cap or uses an unsupported encoding | The bundle is rejected before execution. | Validate bundle size and encoding before sandbox creation. |
| A bundle fails or its sandbox is stale | Partial state or events could leak into the live session. | Execute in an isolated view, check the state revision, and commit only after success. |
| A bundle status refers to an unknown bundle | The requested entry is not found locally. | Return null for that bundle while keeping the response aligned with input order. |
| A datasource rejects a method as unsupported | Remote-only data is unavailable. | Distinguish unsupported methods from other provider errors and use local behavior where supported. |
| A datasource does not know a locally created mint | Remote token reads could hide local token accounts if the answer is treated as a hard failure. | Treat only the specific unknown-mint response as an empty remote result. |
| A scan contains too many or invalid filters | The account query is rejected before it reads the index. | Validate filter count and filter shape before optimizing or scanning. |
| A Geyser event channel or plugin handler fails | Indexer updates can stop while the local chain continues. | Report plugin errors through session events and keep plugin lifecycle operations explicit. |
| A confidential key, derivation signature, or returned secret is exposed | Anyone who sees it can rebuild or read the test confidential balances. | Use these helpers only for local testing and protect the RPC connection. |
Key files
| File | Why to read it |
|---|---|
| crates/…/mod.rs | Connects startup, RPC servers, clock, block production, commands, plugins, WebSocket shutdown, and service termination. |
| crates/…/mod.rs | Defines the shared request context, HTTP and WebSocket middleware, batch behavior, notification behavior, and cheatcode gating. |
| crates/…/svm.rs | Defines the local chain state, execution boundary, overlays, state revisions, persistence view, and event sources. |
| crates/…/locker.rs | Connects shared account reads and writes with remote fallback, transaction processing, confirmation, account hydration, and address history. |
| crates/…/surfnet_lite_svm.rs | Defines the lightweight SVM view, persistent account storage, feature setup, and managed sysvars. |
| crates/…/remote.rs | Defines datasource access, batching, deadlines, fallback results, unknown-mint handling, and sanitized errors. |
| crates/…/minimal.rs | Shows node identity, health, balance, slot, epoch, version, and leader-facing compatibility responses. |
| crates/…/bank_data.rs | Shows rent, inflation, epoch schedule, leader, and block-production data. |
| crates/…/accounts_data.rs | Shows account, token balance, token supply, commitment-context responses, and clock-aware token amounts. |
| crates/…/accounts_scan.rs | Shows program and token account scans, filters, supply, and largest-account views. |
| crates/…/full.rs | Defines the main Solana-compatible transaction, block, history, address-history, commitment, fee, and local-ledger interfaces. |
| crates/…/utils.rs | Defines request validation, transaction decoding, version support, wire-size checks, and request defaults. |
| crates/…/ws.rs | Shows live account, program, signature, slot, slot-lifecycle, log, block, and snapshot subscription behavior, including wake-driven delivery and cleanup. |
| crates/…/jito.rs | Shows atomic bundle submission, simulation, retry, account hydration, and bundle status lookup. |
| crates/…/surfnet_cheatcodes.rs | Defines test-state controls, clock controls, snapshots, account streaming, startup inspection, scenario scheduling, confidential test helpers, and method gating. |
| crates/…/time_travel.rs | Defines forward-only clock calculations for timestamps, slots, and epochs. |
| crates/…/types.rs | Defines persisted transaction metadata, remote result states, token forms, and confidential-transfer data paths. |
| crates/…/error.rs | Defines the shared error boundary between runtime failures and JSON-RPC responses. |
| crates/…/mod.rs | Defines event types, account provenance, commitment rules, and subscription data shared across the runtime. |
| crates/…/helpers.rs | Shows how RPC tests build a shared runtime context and serialize VM mutation work. |
| crates/…/integration.rs | Shows end-to-end startup, readiness, RPC, transaction, remote hydration, and shutdown behavior. |