diff --git a/methods/http/getRecentPerformanceSamples.md b/methods/http/getRecentPerformanceSamples.md new file mode 100644 index 0000000..a290814 --- /dev/null +++ b/methods/http/getRecentPerformanceSamples.md @@ -0,0 +1,11 @@ +# getRecentPerformanceSamples + +Returns blockstore performance samples for recent slots. + +## Semantics + +The omitted limit defaults to Agave PERFORMANCE_SAMPLES_LIMIT value of 720. A limit above 720 is rejected with the JSON-RPC invalid-params error. numNonVoteTransactions is nullable to preserve compatibility with older serialized samples. + +## Implementation notes + +- [**Agave**](../../implementations/agave.md): reference implementation. See the pinned [handler](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc.rs#L3742-L3766). diff --git a/methods/http/getRecentPerformanceSamples.yaml b/methods/http/getRecentPerformanceSamples.yaml new file mode 100644 index 0000000..1bffca5 --- /dev/null +++ b/methods/http/getRecentPerformanceSamples.yaml @@ -0,0 +1,40 @@ +name: getRecentPerformanceSamples +status: standard +summary: Returns recent validator performance samples. +params: + - name: limit + required: false + summary: Maximum number of samples. Agave accepts at most 720. + schema: { type: integer, minimum: 0, maximum: 720 } +result: + name: samples + summary: Recent performance samples. + schema: + type: array + items: + type: object + required: [slot, numTransactions, numSlots, samplePeriodSecs] + properties: + slot: { $ref: '#/components/schemas/Slot' } + numTransactions: { $ref: '#/components/schemas/U64' } + numNonVoteTransactions: + oneOf: + - { $ref: '#/components/schemas/U64' } + - { type: 'null' } + numSlots: { $ref: '#/components/schemas/U64' } + samplePeriodSecs: { type: integer, minimum: 0, maximum: 65535 } +errors: [] +examples: + - name: one-sample + summary: Request one recent sample. + params: + - name: limit + value: 1 + result: + name: samples + value: + - { slot: 348125, numTransactions: 126, numNonVoteTransactions: 98, numSlots: 60, samplePeriodSecs: 60 } +implementations: + agave: { status: full } + cloudbreak: { status: none } + superbank: { status: none } diff --git a/proposals/0039-get-recent-performance-samples.md b/proposals/0039-get-recent-performance-samples.md new file mode 100644 index 0000000..2806691 --- /dev/null +++ b/proposals/0039-get-recent-performance-samples.md @@ -0,0 +1,39 @@ +--- +number: 0039 +title: Add getRecentPerformanceSamples method specification +authors: [rpcpool] +status: draft +created: 2026-09-14 +reference-implementations: + - https://github.com/anza-xyz/agave/tree/6dd9d38771e46103b9680357a855804165612602 +--- + +# Add getRecentPerformanceSamples method specification + +## Summary + +Add the public getRecentPerformanceSamples RPC method. + +## Motivation + +Clients need a portable contract for this public Agave RPC method. + +## Specification + +Add the paired HTTP method files. The optional limit is bounded to Agave current 720-sample maximum. + +## Return-type impact + +Adds the result shape defined by the paired method source. + +## Compatibility + +This is additive. Agave conforms. Cloudbreak and Superbank do not serve the method. + +## Reference implementation + +- [Agave implementation](https://github.com/anza-xyz/agave/blob/6dd9d38771e46103b9680357a855804165612602/rpc/src/rpc.rs#L3742-L3766) + +## Security considerations + +The bounded limit prevents callers from selecting an unbounded blockstore response. diff --git a/spec-info.yaml b/spec-info.yaml index 892ea85..bca4391 100644 --- a/spec-info.yaml +++ b/spec-info.yaml @@ -1,5 +1,5 @@ title: Solana JSON-RPC API -version: 0.1.0 +version: 0.2.0 license: name: MIT url: https://opensource.org/license/mit/