Skip to content

feat: add gas estimates rpc and spn-bidding crate - #238

Merged
Farhad-Shabani merged 1 commit into
mainfrom
farhad/program-gas-stats-proto
Jul 23, 2026
Merged

feat: add gas estimates rpc and spn-bidding crate#238
Farhad-Shabani merged 1 commit into
mainfrom
farhad/program-gas-stats-proto

Conversation

@Farhad-Shabani

Copy link
Copy Markdown
Collaborator

What

Two pieces that let bidders size proof requests by expected gas instead of declared limits:

GetProgramGasEstimates RPC. Batch lookup of per-program gas estimates, derived from fulfilled request history. The estimation method lives server-side and can change without touching this contract; programs with no history are simply absent from the response. Server caps the batch size per call.

spn-bidding crate. Pure, dependency-free bidding policy shared by consumer repos.

  • gas-aware admission: solo-feasibility and loaded-schedulability checks against a request's effective deadline, including wrap-stage capacity packing
  • expected-gas policy: published estimate scaled by an operator multiplier, capped by the request's own limits
  • client-side TTL cache for estimate resolutions
  • port the performance-requirement deadline math

Why

Bidders previously admitted work on concurrency counts alone, so clusters over- or under-committed depending on the proof mix. Publishing estimates from the network and centralizing the policy math gives every prover the same admission foundation, with one home for the logic instead of per-bidder copies.

@Farhad-Shabani
Farhad-Shabani force-pushed the farhad/program-gas-stats-proto branch from 21a51ea to 7a7b104 Compare July 23, 2026 15:18
@Farhad-Shabani
Farhad-Shabani force-pushed the farhad/program-gas-stats-proto branch from 7a7b104 to 3284105 Compare July 23, 2026 15:23
@Farhad-Shabani
Farhad-Shabani merged commit 98490b2 into main Jul 23, 2026
4 checks passed
@Farhad-Shabani
Farhad-Shabani deleted the farhad/program-gas-stats-proto branch July 23, 2026 16:04
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.

2 participants