Edge Cases and Gotchas

Version: 1.0.0
Category: Troubleshooting
Status: Stable
Last Updated: January 1, 2026

Overview

This document documents edge cases and gotchas that AI agents should be aware of when working with Structs. These are non-obvious behaviors that can cause unexpected issues if not handled correctly.


Reactor Staking Edge Cases

Edge Case 1: Player-Level Staking Management

Issue: Staking is managed at player level, but individual reactors may show different statuses

Details:

Implications:

Reference: schemas/entities/reactor.md, protocols/economic-protocol.md#/reactor-staking


Edge Case 2: Undelegation Period During Migration

Issue: Cannot begin migration while in undelegation period

Details:

Implications:

Reference: schemas/actions.md#/reactor-begin-migration, protocols/economic-protocol.md


Edge Case 3: Multiple Reactors with Different Validators

Issue: Player may have reactors delegated to different validators

Details:

Implications:

Reference: schemas/entities/reactor.md#/properties/validator


Permission Combination Edge Cases

Edge Case 4: Permission Value Overflow

Issue: Combining permissions may produce unexpected values

Details:

Implications:

Reference: schemas/game-state.md#/definitions/Permission


Edge Case 5: Permission Hash Database Level

Issue: Permission hash exists in database but not in API response

Details:

Implications:

Reference: schemas/database-schema.md, api/queries/permission.md


Edge Case 6: Permission Object ID Format

Issue: Permission object ID must match entity type

Details:

Implications:

Reference: schemas/formats.md, api/queries/permission.md


StructSweepDelay Edge Cases

Edge Case 7: Slot Appears Occupied After Destruction

Issue: Slot may appear occupied for 5 blocks after struct destruction

Details:

Implications:

Reference: lifecycles/struct-lifecycle.md#/structsweepdelay, schemas/gameplay.md


Edge Case 8: Destroyed Struct Still in Query Results

Issue: Destroyed structs may appear in query results for 5 blocks

Details:

Implications:

Reference: schemas/entities/struct.md#/properties/destroyed, lifecycles/struct-lifecycle.md


Edge Case 9: Slot Reference Persistence During Delay

Issue: Planet/fleet slot arrays reference destroyed struct during delay

Details:

Implications:

Reference: lifecycles/struct-lifecycle.md#/structsweepdelay, schemas/entities/struct.md


Database Query Edge Cases

Edge Case 10: Destroyed Structs in Database Queries

Issue: Database queries may return destroyed structs

Details:

Implications:

Reference: schemas/database-schema.md#/tables/struct, schemas/entities/struct.md


Edge Case 11: Permission Hash in Database vs API

Issue: Database permission_hash may not match API permission value

Details:

Implications:

Reference: schemas/database-schema.md, api/queries/permission.md


Edge Case 12: Signer TX Permission Levels

Issue: Transaction signing requires Hash permission but permission not set

Details:

Implications:

Reference: schemas/database-schema.md#/tables/signer_tx, schemas/entities.md#/definitions/Permission


General Edge Cases

Edge Case 13: Transaction Broadcast vs Action Success

Issue: Transaction status broadcast does not mean action succeeded

Details:

Implications:

Reference: protocols/action-protocol.md#/validation-warning, troubleshooting/common-issues.md


Edge Case 14: Player Online Status Changes

Issue: Player online status may change between checks

Details:

Implications:

Reference: schemas/errors.md#/PLAYER_HALTED, troubleshooting/common-issues.md


Best Practices for Edge Cases

1. Always Verify State

After any action, verify game state matches expected result.

2. Account for Delays

Account for StructSweepDelay (5 blocks) when checking struct availability.

3. Check Multiple Sources

For permissions, check both database and API for complete picture.

4. Filter Destroyed Entities

Always filter queries by destroyed = false for active entities.

5. Handle Status Changes

Account for status changes between checks and actions.

6. Test Permission Combinations

Test permission combinations before applying to production.

7. Verify Transaction Results

Always verify game state after transaction broadcast.



Last Updated: January 1, 2026