Skip to content

Conversation

@vutuanlinh2k2
Copy link
Contributor

@vutuanlinh2k2 vutuanlinh2k2 commented Jan 19, 2026

Summary

This PR fixes multiple bugs discovered during comprehensive local E2E testing of the CLI and blueprint manager. The testing effort covered 47 of 67 CLI commands (70% coverage) across 7 testing categories with 156+ individual tests passed.

Phase 1: Local E2E Testing Foundation (Commit 1)

Initial bug fixes that enabled the complete blueprint lifecycle to work locally:

  • ECDSA public key format: Use 65-byte uncompressed SEC1 format instead of 33-byte compressed for operator registration
  • Blueprint definition decoding: Use contract binding directly (getBlueprintDefinition) instead of broken manual ABI byte parsing
  • Platform binary matching: Normalize OS/arch strings (arm64aarch64, darwinmacos) to correctly match binaries
  • Protocol CLI argument: Add tangle-evm alias so clap accepts both tangle-evm and tangleevm formats
  • ConfigError variant: Fix UnsupportedProtocolUnexpectedProtocol (correct variant name)
  • macOS build compatibility: Use system PROTOC if available in build.rs files

Phase 2: Dynamic Membership & Service Lifecycle (Commit 2)

  • Dynamic membership deployment fix: Set hasConfig=true when using non-default membership model (Dynamic), preventing contract from overwriting to Fixed membership
  • Added JSON schema to TLV binary format encoding for job schemas
  • Service Lifecycle Testing: 39/39 tests passed across 9 commands

Phase 3: Job System Fixes (Commits 3-4)

Five critical bugs fixed in the job system:

Bug Problem Fix
TLV Schema Encoding CLI didn't convert JSON ABI schemas to TLV binary format Convert to TLV format expected by tnt-core contracts
Payload Encoding CLI used ABI encoding for --params-file Use compact binary encoding
Manager Env Vars Spawned blueprints didn't receive contract addresses Pass TANGLE_CONTRACT, RESTAKING_CONTRACT, STATUS_REGISTRY_CONTRACT env vars
Arg Extraction TangleEvmArg only supported one encoding format Support both compact binary and ABI decoding with automatic format detection
Array Element Types TLV encoder omitted array element types Include array element types as child nodes (fixes uint256[] being decoded as bytes[])
  • TLV v2 Format: Added field name support for better schema compatibility with compact string encoding
  • Job System Testing: 30/30 tests passed across 4 commands

Phase 4: Operator & Delegator Utilities (Commits 5-6)

  • Operator show-restaking fix: Add is_operator check before displaying restaking metadata to properly show "Not Registered" status for unregistered operators
  • Operator Utilities Testing: 34/34 tests passed across 12 commands
  • Delegator Utilities Testing: 14/14 commands tested

Phase 5: Chain State Queries (Commit 7)

  • Chain State Queries Testing: 19/20 tests passed across 3 commands
  • Completed comprehensive CLI testing tracker

Phase 6: Exit Queue Commands & Service Commitments (Commit 8)

Added operator exit queue workflow commands to address the 7-day exit queue limitation:

  • schedule-exit: Enter the exit queue for a service
  • execute-exit: Complete exit after queue duration passes
  • cancel-exit: Cancel a scheduled exit

Added --commitment flag to service join and operator request-service commands for specifying asset security commitments.

Added corresponding client methods in tangle-evm:

  • join_service_with_commitments()
  • schedule_exit()
  • execute_exit()
  • cancel_exit()

Phase 7: Documentation Cleanup (Commit 9)

  • Moved CLI test documentation (PLAN and PROGRESS files) to docs/cli-testing/ folder
  • Added folder to .gitignore to keep test docs local-only

Test Coverage Summary

Category Commands Tests Passed Status
Blueprint Lifecycle 5 4 tested
Key Management 5 1 tested 🔇 (low priority)
Service Lifecycle 9 39/39
Job System 4 30/30
Operator Utilities 12 34/34
Delegator Utilities 14 14/14
Chain State Queries 3 19/20
Cloud Deployment 7 0 ❌ Not tested
EigenLayer AVS 7 0 ❌ Not tested
Total 67 47 tested 70%

Known Limitations / Feature Requests

  1. Exit Queue Commands: service leave cannot work with default 7-day exit queue. Needs new commands: schedule-exit, execute-exit, cancel-exit ✅ Implemented in Phase 6
  2. Operator Join with Commitments: operator join needs --commitments flag for services with security requirements ✅ Implemented in Phase 6

Test Plan

  • Local E2E test passes from clean slate
  • Blueprint create → deploy → register → request → approve → submit job → watch result
  • All 14 original E2E steps complete successfully with job result: "Hello, Alice!"
  • Service lifecycle: 39/39 tests passed
  • Job system: 30/30 tests passed
  • Operator utilities: 34/34 tests passed
  • Delegator utilities: 14/14 commands tested
  • Chain state queries: 19/20 tests passed

🤖 Generated with Claude Code

- Fix ECDSA public key format: use 65-byte uncompressed SEC1 format
  instead of 33-byte compressed for operator registration
- Add `get_blueprint_definition` to TangleEvmClient for direct struct
  decoding, replacing broken manual ABI byte parsing
- Normalize OS/arch strings in binary selection (arm64→aarch64,
  darwin→macos) to match platform binaries correctly
- Add `tangle-evm` alias to Protocol enum so clap accepts both formats
- Use system PROTOC if available in build.rs files (macOS compatibility)
- Fix ConfigError variant: UnsupportedProtocol → UnexpectedProtocol
- Remove dead code: Protocol::from_env, FromStr impl, unused error variant
- Add LOCAL_E2E_TEST_PLAN.md documenting the full testing workflow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vutuanlinh2k2 vutuanlinh2k2 self-assigned this Jan 19, 2026
@vutuanlinh2k2 vutuanlinh2k2 changed the title fix(cli): resolve local E2E testing issues fix(cli): resolve local E2E testing issues with the CLI Jan 19, 2026
- Fix blueprint deployment to correctly set hasConfig=true when using
  non-default membership model (Dynamic), preventing contract from
  overwriting to Fixed membership
- Add JSON schema to TLV binary format encoding for job schemas
- Add comprehensive service lifecycle CLI command testing documentation
- Add E2E testing notes documenting all issues found and fixes applied
- Add CLI command testing tracker for QA coverage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vutuanlinh2k2 vutuanlinh2k2 marked this pull request as draft January 20, 2026 16:56
vutuanlinh2k2 and others added 7 commits January 21, 2026 17:35
This commit addresses 5 bugs discovered during comprehensive testing of
the job system CLI commands (jobs list, show, submit, watch):

- Bug #1: TLV schema encoding - CLI now converts JSON ABI schemas to
  the TLV binary format expected by tnt-core contracts
- Bug #2: Payload encoding - CLI uses compact binary encoding instead
  of ABI encoding for --params-file submissions
- Bug #3: Manager now passes TANGLE_CONTRACT, RESTAKING_CONTRACT, and
  STATUS_REGISTRY_CONTRACT env vars to spawned blueprint binaries
- Bug #4: TangleEvmArg extractor now supports both compact binary and
  ABI decoding with automatic format detection
- Bug #5: TLV encoder correctly includes array element types as child
  nodes (fixes uint256[] being decoded as bytes[])

Test Results: 29/30 tests passed across 7 phases of testing.

Documentation added:
- JOB_SYSTEM_TEST_PLAN.md: Comprehensive test plan for job commands
- JOB_SYSTEM_TEST_PROGRESS.md: Detailed test results and bug reports
- TLV_FIELD_NAMES_PROPOSAL.md: Proposal to add field names to TLV format

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ve job helpers

- Add version 2 TLV format with field name support for better schema compatibility
- Implement compact string encoding for field names in schema serialization
- Update job helpers with improved functionality
- Update testing documentation and progress tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… docs

- Add is_operator check before displaying restaking metadata to properly
  show "Not Registered" status for unregistered operators
- Add comprehensive operator utilities test plan covering all 12 commands
- Add test progress tracker documenting 34/34 tests completed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add test plan and progress tracker for delegator utilities testing
- Add links to operator utilities test docs in CLI testing tracker
- Fix formatting in TLV field names proposal

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add operator exit queue workflow commands:
- schedule-exit: Enter the exit queue for a service
- execute-exit: Complete exit after queue duration passes
- cancel-exit: Cancel a scheduled exit

Add --commitment flag to service join and operator request-service
commands for specifying asset security commitments.

Add corresponding client methods in tangle-evm:
- join_service_with_commitments()
- schedule_exit()
- execute_exit()
- cancel_exit()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move PLAN and PROGRESS markdown files to docs/cli-testing/ and add to
.gitignore to keep them local-only.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vutuanlinh2k2 vutuanlinh2k2 marked this pull request as ready for review January 23, 2026 14:21
@tangle-network tangle-network deleted a comment from claude bot Jan 23, 2026
@drewstone drewstone merged commit 50f5e81 into v2 Jan 23, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants