fix(cli): make POI parameters optional for action queue commands#1194
Merged
fix(cli): make POI parameters optional for action queue commands#1194
Conversation
59557c7 to
a1e259d
Compare
CLI normalization: - default publicPOI to zero-filled bytes when not provided - default poiBlockNumber to 0 when blockNumber is not provided - check blockNumber for explicit undefined instead of truthiness Server-side validation: - relax UNALLOCATE validation to only require 'poi' field when provided - relax REALLOCATE validation to only require 'poi' field when provided - relax PRESENT_POI validation to only require 'poi' field when provided - treat publicPOI and poiBlockNumber as optional fields GraphQL serialization strips undefined fields from the action payload, which previously caused the server's isValidActionInput check to reject queued actions when the user omitted optional POI arguments. Tests: - update CLI normalize test to expect poiBlockNumber of 0 - update server validation test to accept poi without publicPOI
e00024b to
6431fad
Compare
Block number normalization: - use && instead of || so TypeScript narrows blockNumber to string before parseInt - rename poiBlockNumber to normalizedBlockNumber and type as number | undefined - skip parsing when blockNumber is '0' to preserve the default Public POI normalization: - switch condition to check publicPOI !== undefined for consistent handling
Public POI handling: - default normalizedPublicPoi to zeroPOI - only use the provided publicPOI when the main POI is non-zero and a real value is given Block number handling: - skip parsing when the main POI is zero so metadata stays at default
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
tmigone
approved these changes
Apr 23, 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
Make
publicPOIandpoiBlockNumbertruly optional when queuing UNALLOCATE, REALLOCATE, or PRESENT_POI actions through the indexer CLI. Previously, omitting these positional arguments caused the action to be rejected by the server'sisValidActionInputcheck because GraphQL serialization stripsundefinedfields from the payload.CLI normalization (
packages/indexer-cli/src/actions.ts)publicPOIto zero-filled bytes when not providedpoiBlockNumberto0whenblockNumberis not providedblockNumberfor explicitundefinedinstead of truthiness so"0"is parsed correctlyServer-side validation (
packages/indexer-common/src/actions.ts)poifield when a POI is suppliedpublicPOIandpoiBlockNumberas optional fieldsTests
poiBlockNumberof0poiwithoutpublicPOITest plan
normalizes zero POI values for PRESENT_POIgraph indexer actions queue unallocate <deploymentID> <allocationID> 0x0 true --network arbitrum-onesucceeds without specifying a block number