feat(actions): add PRESENT_POI and RESIZE action types for Horizon allocations#1162
feat(actions): add PRESENT_POI and RESIZE action types for Horizon allocations#1162
Conversation
|
Have not reviewed in detail yet, but first comment is I think we should rename from COLLECT to something else. Collect refers generically to any payment type, could be indexing rewards, query fees or something else. Historically also "collect" has been associated with query fees, so this would be confusing I think. What do you think about switching to something thats more related to what happens to the allocation (poi is posted on chain) and not the side effect (which is rewards are collected). So could be "present/post poi": |
|
Sounds good, will update. |
7bc46c1 to
e3b4251
Compare
5febb90 to
8fd9503
Compare
Add a new action type that posts a POI on-chain to collect indexing
rewards from Horizon allocations without closing them. This enables
periodic reward collection while keeping allocations active.
Changes:
- ActionType.PRESENT_POI enum value ('present_poi')
- GraphQL presentPOI mutation and PresentPOIResult type
- Database model validation for PRESENT_POI actions
- AllocationManager methods (preparePresentPOI, confirmPresentPOI, etc.)
- CLI support with present_poi command
- POI parameter normalization and block number validation
- Improved help text clarifying optional parameters
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add tests for the new PRESENT_POI action type covering: - Building action input with correct structure - POI parameter normalization (zero values) - Block number validation - Required field validation - Database action insertion and querying - Filter generation for action queries Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8fd9503 to
8d17c4c
Compare
|
@MoonBoi9001 sorry about this but can we use |
Use kebab-case for the CLI command name for consistency with other commands and sub-commands. The internal enum representation stays compatible with GraphQL (which doesn't allow hyphens in enum names). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a new action type that resizes an existing allocation by changing its staked amount without closing it. This enables adjusting stake on long-lived allocations without triggering POI submission or reward collection. Changes: - ActionType.RESIZE enum value - GraphQL resizeAllocation mutation and ResizeAllocationResult type - Database model validation and migration for RESIZE actions - AllocationManager methods (prepareResize, confirmResize, etc.) - CLI support: `graph indexer actions queue resize <deployment> <allocationID> <amount>` - Stake usage summary handling for resize operations - IE087 error code for resize failures - Unit tests for action validation and stake calculations Contract interface: - Calls SubgraphService.resizeAllocation(indexer, allocationId, tokens) - Parses AllocationResized event for confirmation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2a19526 to
9af7472
Compare
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The PRESENT_POI action type was added to the ActionType enum and all execution logic in #1162, but was omitted from the isValidActionInput switch statement. This caused the action queue to reject presentPOI actions with "Invalid action input" since hasActionParams was never set to true. Also adds PRESENT_POI to the active allocation check in validateActionInputs, matching the existing pattern for unallocate, reallocate, and resize. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Motivation
Horizon allocations are long-lived and benefit from operations that don't require closing and reopening. This PR adds two new action types that operate on existing allocations: one for collecting rewards by posting a POI, and one for adjusting stake.
Summary
Add two new action types for Horizon allocations:
PRESENT_POI - Posts a POI on-chain to collect indexing rewards without closing the allocation. Enables periodic reward collection while keeping allocations active.
RESIZE - Changes the staked amount on an existing allocation without closing it. More efficient than reallocate for stake adjustments on long-lived allocations since it avoids POI submission and reward collection overhead.
Changes
PRESENT_POI
presentPOImutation andPresentPOIResulttypegraph indexer actions queue present-poi <deployment> <allocationID> [poi] [force] [blockNumber] [publicPOI] -n <network>RESIZE
resizeAllocationmutation andResizeAllocationResulttypegraph indexer actions queue resize <deployment> <allocationID> <amount> -n <network>Shared
Contract interfaces
Generated with Claude Code