Skip to content

feat(actions): add PRESENT_POI and RESIZE action types for Horizon allocations#1162

Merged
tmigone merged 14 commits intomainfrom
feat/collect-action-type
Mar 9, 2026
Merged

feat(actions): add PRESENT_POI and RESIZE action types for Horizon allocations#1162
tmigone merged 14 commits intomainfrom
feat/collect-action-type

Conversation

@MoonBoi9001
Copy link
Copy Markdown
Member

@MoonBoi9001 MoonBoi9001 commented Jan 9, 2026

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

  • ActionType.PRESENT_POI enum value
  • GraphQL presentPOI mutation and PresentPOIResult type
  • Database model validation and migration
  • AllocationManager methods (preparePresentPOI, confirmPresentPOI, etc.)
  • CLI: graph indexer actions queue present-poi <deployment> <allocationID> [poi] [force] [blockNumber] [publicPOI] -n <network>

RESIZE

  • ActionType.RESIZE enum value
  • GraphQL resizeAllocation mutation and ResizeAllocationResult type
  • Database model validation and migration
  • AllocationManager methods (prepareResize, confirmResize, etc.)
  • CLI: graph indexer actions queue resize <deployment> <allocationID> <amount> -n <network>
  • IE087 error code for resize failures

Shared

  • Unit tests for action validation
  • Stake usage summary handling for both action types

Contract interfaces

// PRESENT_POI
function presentPOI(allocationId, poi, poiMetadata) external

// RESIZE
function resizeAllocation(indexer, allocationId, tokens) external

Generated with Claude Code

@github-project-automation github-project-automation bot moved this to 🗃️ Inbox in Indexer Jan 9, 2026
@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review January 9, 2026 05:55
@tmigone
Copy link
Copy Markdown
Member

tmigone commented Jan 23, 2026

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": graph indexer actions queue present-poi ... or something along that vein.

@MoonBoi9001
Copy link
Copy Markdown
Member Author

Sounds good, will update.

@MoonBoi9001 MoonBoi9001 force-pushed the feat/collect-action-type branch from 7bc46c1 to e3b4251 Compare January 23, 2026 18:31
@MoonBoi9001 MoonBoi9001 changed the title feat(actions): add COLLECT action type for Horizon allocations feat(actions): add PRESENT_POI action type for Horizon allocations Jan 23, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the feat/collect-action-type branch from 5febb90 to 8fd9503 Compare January 23, 2026 18:39
MoonBoi9001 and others added 2 commits January 23, 2026 14:31
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>
@MoonBoi9001 MoonBoi9001 force-pushed the feat/collect-action-type branch from 8fd9503 to 8d17c4c Compare January 23, 2026 19:31
@MoonBoi9001 MoonBoi9001 requested a review from tmigone February 10, 2026 17:37
@tmigone
Copy link
Copy Markdown
Member

tmigone commented Feb 24, 2026

@MoonBoi9001 sorry about this but can we use present-poi instead of present_poi? Just for consistency sake with other commands/sub-commands.

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>
@MoonBoi9001
Copy link
Copy Markdown
Member Author

Sounds good @tmigone see ac9cec3

@MoonBoi9001 MoonBoi9001 changed the title feat(actions): add PRESENT_POI action type for Horizon allocations feat(actions): add PRESENT_POI and RESIZE action types for Horizon allocations Feb 25, 2026
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>
@MoonBoi9001 MoonBoi9001 force-pushed the feat/collect-action-type branch from 2a19526 to 9af7472 Compare February 25, 2026 01:06
@tmigone tmigone moved this to In review / testing in The Graph Protocol Feb 26, 2026
tmigone added 9 commits March 6, 2026 16:50
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>
@github-project-automation github-project-automation bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Mar 9, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tmigone tmigone merged commit c7dd692 into main Mar 9, 2026
7 checks passed
@tmigone tmigone deleted the feat/collect-action-type branch March 9, 2026 20:49
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🚗 Merged in Indexer Mar 9, 2026
@github-project-automation github-project-automation bot moved this from In review / testing to Done in The Graph Protocol Mar 9, 2026
MoonBoi9001 added a commit that referenced this pull request Mar 17, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚗 Merged
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants