Skip to content

[BUG] Not able to call initialize of TaskManager when running Eigenlayer blueprint #1177

@danielbui12

Description

@danielbui12

Summary

The blueprint deploy eigenlayer flow currently interrupts the expected contract deployment process by prompting for the TaskManager.initialize call too early, before the ServiceManager contract is deployed. This prevents a complete initialization and deployment sequence.

Expected Behavior

Deployment should follow this order:

  1. Deploy TaskManager (independent).
  2. Deploy ServiceManager (requires TaskManager address).
  3. Execute TaskManager.initialize after both are deployed, using the ServiceManager address.

Current Behavior

  1. After deploying TaskManager, the CLI immediately prompts for initialization.
  2. If skipped, the user cannot rerun initialization later through the CLI.
  3. The CLI then deploys ServiceManager and exits without letting the user perform the required initialize step.
  4. This causes the deployment to halt before AVS setup and operator registration.

Example Log

$ cargo tangle blueprint deploy eigenlayer --devnet --ordered-deployment
...
SKIP CALL THE `initialize`
...
$ cargo tangle blueprint deploy eigenlayer --devnet --ordered-deployment
...
Contract Deployed Successfully
./contracts/src/TangleTaskManager.sol:TangleTaskManager: 0xc0f115a19107322cfbf1cdbc7ea011c19ebdb4f8
━━━ Initialize ./contracts/src/TangleTaskManager.sol:TangleTaskManager ━━━
Do you want to initialize? no
ℹ Skipping initialization of ./contracts/src/TangleTaskManager.sol:TangleTaskManager
SKIP CALL THE `initialize`

Contract Deployed Successfully
./contracts/src/TangleServiceManager.sol:TangleServiceManager: 0xc96304e3c037f81da488ed9dea1d8f2a48278a75

Deployment Summary:
./contracts/src/TangleTaskManager.sol:TangleTaskManager: 0xc0f1...
./contracts/src/TangleServiceManager.sol:TangleServiceManager: 0xc9630...
...
... By the end, cannot back to initialize step! 

Impact

  • EigenLayer pipeline deployment cannot complete automatically.
  • Developers are forced to manually initialize the task manager using cast or a custom script.
  • Blocks AVS registration, operator configuration, and subsequent integration steps.

Reproduction Steps

  1. Run:
    cargo tangle blueprint deploy eigenlayer --devnet --ordered-deployment
  2. Choose No when prompted to initialize TaskManager.
  3. Observe that there is no later step to run initialize after ServiceManager deployment.

Proposed Fixes

Approach 1: Allow Deferred Initialization

  • Modify deploy pipeline in deploy_eigenlayer.rs
  • Add a new --deferred-init flag or a blueprint initialize subcommand
    Example:
    cargo tangle blueprint initialize eigenlayer TaskManager --service 0xc9630...a75
  • Implementation: enable late binding logic or store constructor outputs in memory/state for later initialization.

Approach 2: Support Solidity Script Deployments

  • Create deployment solidity script i.e
// scripts/DeployAvs.s.sol
contract DeployMyServiceManager is Script {
    function run() public {
        // Deploy
        vm.startBroadcast(deployer);
        serviceManager = new ServiceManager(...);
        taskManager = new TaskManager(...);
        vm.stopBroadcast();

        // Register operator
        vm.startBroadcast(operator);
        delegationManager.registerAsOperator(...);
        vm.stopBroadcast();

        // Link and complete AVS registration
        vm.startBroadcast(operator);
        serviceManager.registerOperatorToAVS(operator, operatorSignature);
        vm.stopBroadcast();
    }
}
  • Introduce --script flag to execute Foundry deployment scripts:
    cargo tangle blueprint deploy eigenlayer --devnet --script scripts/DeployAvs.s.sol
  • Developers manage deployment and initialization manually inside Solidity, while CLI focuses purely on orchestration and logging.

Benefits:

  • Maintains single responsibility for the CLI.
  • Allows reuse of developer’s existing Foundry deployment scripts.
  • Simplifies debugging and iteration.

Acceptance Criteria

  • CLI must allow skipping immediate initialization and completing it later.
  • Deployment summary should include a clear next-step message, e.g.:
    Next: finalize initialization for TaskManager using:
    cargo tangle blueprint initialize eigenlayer --contract TaskManager
    
  • Optionally support a --script flow for fully scripted deployments.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    Projects

    Status

    Not Started 🕧

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions