Skip to content

Conversation

@seongyun-ko
Copy link
Contributor

@seongyun-ko seongyun-ko commented Jan 6, 2026

generate txns to convert to auto-compounding vals, consolidation, or exits and run tenderly simulation

An eample usage is to generate txns for auto-compounding vals:

  1. query validators
# Query 50 validators for an operator (by name)
python3 script/operations/auto-compound/query_validators.py \
  --operator "validation_cloud" \
  --count 50 \
  --output script/operations/auto-compound/validators.json
  1. generate gnosis txns with hashes
    if the safe's last nonce was 661.
JSON_FILE=validators.json SAFE_NONCE=662 forge script \
  script/operations/auto-compound/AutoCompound.s.sol:AutoCompound \
  --fork-url $MAINNET_RPC_URL -vvvv
  1. simulate at Tenderly
python3 script/operations/utils/simulate.py --tenderly \
  --schedule script/operations/auto-compound/auto-compound-txns-link-schedule.json \
  --execute script/operations/auto-compound/auto-compound-txns-link-execute.json \
  --then script/operations/auto-compound/auto-compound-txns-consolidation.json \
  --delay 8h \
  --vnet-name "ValidationCloud-AutoCompound"

For details, Refer to README


Note

Introduces a new validator operations toolkit to generate and simulate Gnosis Safe transactions for auto-compounding, consolidations, and exits.

  • Adds script/operations/ with Solidity, Python, and shell tooling:
    • Auto-compound: AutoCompound.s.sol groups validators by EigenPod, detects unlinked validators, emits timelock schedule/execute + per-pod consolidation txns, and prints EIP-712 signing data
    • Consolidations: ConsolidateToTarget.s.sol, ConsolidationTransactions.s.sol, and GnosisConsolidationLib.sol generate per-target consolidation txns; optional linking via timelock; outputs separate Safe JSON files
    • Python CLIs: query validators (DB + beacon), bucket by sweep time, filter consolidated, export JSON, and generate Safe files; end-to-end runners (run-*.sh) and Tenderly simulation integration
  • Updates foundry.toml fs permissions and .gitignore to support new scripts and ignore generated artifacts

Written by Cursor Bugbot for commit aa65620. This will update automatically on new commits. Configure here.

…mpounding vals, consolidation, or exits and run tenderly simulation
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

📊 Forge Coverage Report

forge coverage failed; see logs above (tests step is the gate).

Generated by workflow run #575

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37bf53fa22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 672 to 676
if args.txns:
env['TXNS'] = args.txns
if args.schedule:
env['SCHEDULE_FILE'] = args.schedule
if args.execute:

Choose a reason for hiding this comment

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

P1 Badge Forge sim omits TXNS env for timelock runs

When running the forge-based simulation with --schedule/--execute, run_forge_simulation never sets the TXNS environment variable (lines 672-676), so SimulateTransactions.s.sol’s run() immediately fails at vm.envString("TXNS") (line 46) before any transactions execute. This makes the documented timelock workflow (simulate.py --schedule ... --execute ...) unusable in forge mode. Compose TXNS from the schedule/execute/then files when those flags are used.

Useful? React with 👍 / 👎.

…g 2: Signing data nonce for batched transactions (AutoCompound.s.sol)
pankajjagtapp and others added 8 commits January 8, 2026 13:45
- Reverts for gas consumed more than 10 Mil
- State Syncing turned off, because not necessary for our use case
…d generate separate consolidation transactions
… auto-compound script

- Added functionality to distribute validators across withdrawal time buckets for optimal consolidation.
- Introduced command-line options for bucket size and enabled round-robin distribution.
- Enhanced error handling for validators without valid withdrawal credentials.
…in auto-compound script

- Implemented a check to ensure --bucket-hours is a positive integer.
- Added warning for excluded validators due to missing beacon index, enhancing user feedback on validator selection.
…chars) and full withdrawal credentials (66 chars).
…r each consolidation transaction and update simulation handling for multiple files. Enhanced simulate.py to support comma-separated transaction file inputs.
… to a dedicated 'txns' directory for better organization and clarity in file management.
… transaction scheduling and execution capabilities. Updated _buildTimelockCalldata function to utilize EtherFiTimelock for batch scheduling and execution of transactions.
…ents-tooling-validators-1

Improvements for Compounding Validator Tooling
action='store_true',
default=True,
help='Enable sweep-time-aware bucketing for balanced distribution across withdrawal queue'
)
Copy link

Choose a reason for hiding this comment

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

Argparse flag always true due to conflicting defaults

Low Severity

The --use-sweep-bucketing argument uses action='store_true' combined with default=True, which is contradictory. With store_true, the flag sets the value to True when present, and default=True sets it to True when absent. This means args.use_sweep_bucketing is always True regardless of whether the flag is provided, making the command-line option completely non-functional. Users cannot disable sweep bucketing from the command line.

Fix in Cursor Fix in Web

pankajjagtapp and others added 13 commits January 9, 2026 14:16
…or improved modularity and reusability of validator operations.

- Moved common functions related to database interactions, beacon chain API calls, and validator management into a new utility module.
…scripts for automated validator consolidation workflow

- Introduced query_validators_consolidation.py to query and select validators for consolidation based on withdrawal credentials and balance constraints.
- Added run-consolidation.sh to automate the consolidation process, including transaction generation and simulation on Tenderly.
…improved logging

- Updated `ConsolidateToTarget.s.sol` to include deduplication logic for unlinked IDs and pubkeys during consolidation.
- Commented out verbose logging for target pubkey, validator ID, and output file to reduce console clutter.
- Modified `query_validators_consolidation.py` to optimize consolidation batch creation and ensure targets are the first source in each batch.
- Adjusted `run-consolidation.sh` to reflect updated default values for maximum target balance and batch size.
…ion and batch creation

- Updated the target selection process to distribute selections across withdrawal queue buckets.
- Enhanced the consolidation batch creation logic to ensure targets are unique and optimize the use of available validators.
- Improved logging to provide clearer insights into the consolidation process, including the number of unique targets used and total sources consolidated.
…ngle run

- Refactored `ConsolidateToTarget.s.sol` to read from `consolidation-data.json`, allowing for batch processing of multiple validator consolidations.
- Enhanced logging to provide detailed insights into the consolidation process, including the number of targets and transactions generated.
- Updated `run-consolidation.sh` to streamline transaction generation and file handling, ensuring all output files are correctly named and organized.
- Improved handling of linking transactions, consolidating outputs into a single directory for easier management.
…idators by default

- Changed the default count of source validators to consolidate from 50 to 0, allowing the use of all available validators.
- Updated help messages and examples in `run-consolidation.sh` to reflect the new default behavior.
- Adjusted logging in `query_validators_consolidation.py` to clarify the source count being used during consolidation.
…g python

- Introduced `generate_gnosis_txns.py` to generate Gnosis Safe transaction files for validator consolidation, including linking and consolidation transactions.
- Added `run-consolidationThroughPython.sh` to automate the consolidation process, including querying validators, generating transactions, and simulating on Tenderly.
…ation-validators-tooling

Consolidation validators tooling
uint256 feePerRequest = _getConsolidationFeeSafe(targetPubkey);

// Generate consolidation transactions for this target
_generateConsolidationTxs(sourcePubkeys, targetPubkey, feePerRequest, config.batchSize);
Copy link

Choose a reason for hiding this comment

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

Consolidation fee calculated before linking simulation completes

High Severity

The consolidation fee is calculated in _processConsolidation (line 193) before the linking simulation runs in _generateLinkingTransactions (line 141). When _getConsolidationFeeSafe cannot find a linked node, it returns 1 wei as a placeholder. However, consolidation transactions are generated immediately with this incorrect fee, and no update occurs after linking. This results in transactions with insufficient ETH value that will fail on execution.

Additional Locations (1)

Fix in Cursor Fix in Web

pankajjagtapp and others added 4 commits January 15, 2026 14:17
…atting in validator scripts

- Removed the `--include-non-restaked` option from `query_validators.py` and `query_validators_consolidation.py`.
- Updated output formatting in operator listing to exclude restaked count for clarity.
- Adjusted README documentation to reflect the removal of the non-restaked option.
- Enhanced README.md to clarify output file structure and transaction import steps for auto-compound workflows.
- Updated run-auto-compound.sh to list consolidation files for user instructions.
- Improved transaction file references in simulation examples to include nonce placeholders.
- Adjusted ConsolidateToTarget.s.sol to handle directory paths more robustly.
- Modified query_validators_consolidation.py to use filtered validator counts for consolidation planning.
- Updated validator_utils.py to ensure case-insensitive operator queries.
…oling-db

fix: Update operator handling and database queries in validator scripts
}

// Otherwise, assume it's relative to auto-compound directory
return string.concat(root, "/script/operations/auto-compound/txns/", path);
Copy link

Choose a reason for hiding this comment

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

Incorrect path resolution adds erroneous /txns/ subdirectory

Medium Severity

The _resolvePath function appends /txns/ to relative paths, resolving validators.json to script/operations/auto-compound/txns/validators.json. However, the README documentation shows the Python script outputting to script/operations/auto-compound/validators.json (without /txns/). When users follow the documented workflow using JSON_FILE=validators.json, the script will fail to find the input file.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants