Skip to content

204 Separate Script to Deposit and Register#212

Merged
Supeeerpower merged 5 commits intodevfrom
204-separate-script-to-deposit-and-register
Jul 29, 2025
Merged

204 Separate Script to Deposit and Register#212
Supeeerpower merged 5 commits intodevfrom
204-separate-script-to-deposit-and-register

Conversation

@Supeeerpower
Copy link
Contributor

Fixes on #204

  • Added separated script for deposit and register.
  • Updated register shell script with delay of local and testnet mode.
  • Updated some path-ignore in ci.
  • Updated MD doc for CLI.

@Supeeerpower Supeeerpower linked an issue Jul 24, 2025 that may be closed by this pull request
@Supeeerpower Supeeerpower requested a review from ethanfrey July 24, 2025 19:01
@Supeeerpower Supeeerpower force-pushed the 204-separate-script-to-deposit-and-register branch from fbdc6b6 to 55ab7c0 Compare July 25, 2025 01:03
Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The design looks good. Approve it.

The one request to improve would be to make the sleep a bit more robust as commented below. You could merge and do that in a future PR, or make that change, test it works, then merge. No need to block on my re-review for that change

address _operatorAddr,
uint256 _stakeAmount
) internal {
IStrategyManager strategyManager = IStrategyManager(_strategyManagerAddress);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay this is the code that was pulled out from the register lib, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

/// @notice The error for the failed to get allocation configuration delay.
error WavsRegisterOperatorLib__FailedToGetAllocationConfigurationDelay();

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from here?

IAllocationManager allocationManager = IAllocationManager(allocationManagerAddress);
OperatorSet memory opSetQuery = OperatorSet({avs: serviceManagerAddress, id: 0});
if (!allocationManager.isMemberOfOperatorSet(operatorAddr, opSetQuery)) {
(bool success, bytes memory result) = address(allocationManager).staticcall(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the ugly workaround gone 😄

# Deposit into strategy
forge script script/eigenlayer/bls/WavsDepositIntoStrategy.s.sol -vvv --rpc-url "$RPC_URL" --private-key "$OPERATOR_KEY" --broadcast || handle_error "Failed to deposit into strategy"

# Wait based on environment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very cool.

Run one script, wait the time in bash, then run the second part.
Good approach

cast rpc evm_mine --rpc-url http://localhost:8545
done
elif [[ "$DEPLOY_ENV" == "TESTNET" ]]; then
WAIT_TIME=$((12 * ALLOCATION_DELAY))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit arbitrary.

Could you do something like:

  • calculate target block number (current + allocation delay)
  • while current_block < target_block
    • sleep (5 * target - current)

This is more robust and doesn't have to wait 2x the expected time. You can change 5 with any other number you like, whatever would be a lower bound for block time (could even be 1, you just have a few extra queries, but that is cheap)

@Supeeerpower Supeeerpower force-pushed the 204-separate-script-to-deposit-and-register branch from 60f8050 to c427ff6 Compare July 29, 2025 13:45
@Supeeerpower Supeeerpower merged commit 7368594 into dev Jul 29, 2025
5 of 6 checks passed
@Supeeerpower Supeeerpower deleted the 204-separate-script-to-deposit-and-register branch July 29, 2025 13:57
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.

Separate Script to Deposit and Register

2 participants