Skip to content

update eth2 type 00 deposits withdrawal addresses job#474

Open
jpsains wants to merge 1 commit intomainfrom
update-eth2-type-00-deposits-withdrawal-addresses-job
Open

update eth2 type 00 deposits withdrawal addresses job#474
jpsains wants to merge 1 commit intomainfrom
update-eth2-type-00-deposits-withdrawal-addresses-job

Conversation

@jpsains
Copy link
Collaborator

@jpsains jpsains commented Oct 7, 2025

Note

Introduces an ETH2 validator withdrawal-credentials update job using beacon API, adds beacon config/env wiring, and exposes related constants/utilities while tightening default RPC provider enablement.

  • Workers:
    • Runner: Adds ETH2 withdrawal credentials update flow that:
      • Fetches validator pubkeys with placeholder addresses from DB, calls beacon API, derives updated userAddress from withdrawal credentials, and updates DB.
    • DB Client: Adds getEth2StakingPubkeysWithPlaceholderAddress and updateUserAddressesForPubkeys.
  • Adapters Library:
    • ETH2 Staking Adapter: Uses ZERO_ADDRESS for ETH; introduces and exports ETH2_DEPOSIT_CONTRACT_ADDRESS.
    • Log Transformers: Adds and exports ETH2_TYPE_00_WITHDRAWAL_PLACEHOLDER_ADDRESS; uses it for type 00 credentials.
    • Index: Exports new ETH2 constants and transformer symbol.
  • Config:
    • Adds BEACON_BASE_URL and BEACON_NODE_API_KEY support.
    • Disables default RPC URLs for several chains (e.g., bsc, ftm, sei, and defaults for base, arb, avax, linea).
  • DevOps:
    • docker-compose.yaml: Passes BEACON_BASE_URL and BEACON_NODE_API_KEY to api and workers.

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


console.log('🎉 ETH2 withdrawal credentials update process completed!')
// Historic cache building and latest cache building happen simultaneously
// await Promise.all([historicCacheLoop(), latestCacheLoop()])
Copy link

Choose a reason for hiding this comment

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

Bug: Cache Loops Fail After ETH2 Update

The runnerLoop no longer runs its core historicCacheLoop() and latestCacheLoop() as the Promise.all() call was replaced by the synchronous ETH2 update process (lines 163-336). Additionally, the logger.error() on lines 217-223 logs missing environment variables unconditionally, creating misleading errors even when BEACON_BASE_URL and BEACON_NODE_API_KEY are present.

Fix in Cursor Fix in Web


console.log('🎉 ETH2 withdrawal credentials update process completed!')
// Historic cache building and latest cache building happen simultaneously
// await Promise.all([historicCacheLoop(), latestCacheLoop()])
Copy link

Choose a reason for hiding this comment

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

Bug: Worker Disabled, ETH2 Update Runs Once

The worker's main processing loops (historicCacheLoop and latestCacheLoop) are commented out, disabling its core function of continuous blockchain event processing and cache building. Instead, a new ETH2 update process runs once, causing the worker to exit after completion. The Promise.all call for parallel execution is also commented out.

Fix in Cursor Fix in Web

CHAIN_NOT_ENABLED,
'https://bsc-mainnet.infura.io/v3/abafec30d6aa45ffa0c763b5552a2d02',
),
bsc: parseStringEnv(CHAIN_NOT_ENABLED, CHAIN_NOT_ENABLED),
Copy link

Choose a reason for hiding this comment

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

Bug: Optimism Provider Configuration Defaults Incorrectly

The Optimism provider configuration incorrectly uses CHAIN_NOT_ENABLED as its default value. This disables Optimism support when the DEFI_ADAPTERS_PROVIDER_OPTIMISM environment variable is not set, breaking existing functionality.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant