Add stamp pool feature for low-latency stamp provisioning (Issue #63)#64
Merged
Conversation
This feature maintains a reserve of pre-purchased postage stamps that can be released to clients immediately (<5 seconds) without waiting for blockchain confirmation time (>1 minute). Key components: - StampPoolManager service with background task for pool maintenance - Pool API endpoints: status, acquire, available, check - Configuration via STAMP_POOL_* environment variables - Default reserve: 1 small (depth 17), 1 medium (depth 20), 0 large (depth 22) - Automatic fallback to larger stamps when exact size unavailable - TTL monitoring and auto-topup for reserve stamps Closes #63
3 tasks
This was referenced Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Key Components
app/services/stamp_pool.py): Core service managing the pool, background task, and Bee node integrationapp/api/endpoints/pool.py):GET /api/v1/pool/status- Get pool status and reserve levelsPOST /api/v1/pool/acquire- Acquire stamp from pool instantlyGET /api/v1/pool/available- List available stampsPOST /api/v1/pool/check- Trigger manual maintenanceSTAMP_POOL_*environment variablesdocs/stamp-pool-guide.mdConfiguration
Test plan
Closes #63