Skip to content

Add support for operator v4#27

Open
evgeny-stakewise wants to merge 28 commits intomainfrom
operator-v4
Open

Add support for operator v4#27
evgeny-stakewise wants to merge 28 commits intomainfrom
operator-v4

Conversation

@evgeny-stakewise
Copy link
Contributor

No description provided.

evgeny-stakewise and others added 17 commits February 18, 2026 11:17
* Add relayer skeleton

* Fix lint
* Refactor network validators

* Del network validators
* Refactor network validators

* Del network validators

* Merged validator types

* Merged registration endpoints
* Add deposit signature shares

* Add validator_type to validators response

* Add public keys file

* Rename endpoints, add is_deposit_signature_ready

* Rework deposit signature from HexStr to BLSSignature

* Review fixes
* Track registered public keys

* Handle pending deposits, refactor

* Exclude raw exit signature from response

* Fix env file in CI

* Add VALIDATORS_MANAGER_KEY_FILE to env example
* Remove unused settings

* Updated README

* Fix markdown

* Upd gitignore
* Speed up getting last event

* Improvements

* Review fix
* Add validators manager address to /info endpoint

* Fix lint
Copilot AI review requested due to automatic review settings March 6, 2026 20:50
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the service to support “operator v4” flows by introducing a relayer API for validator registration/funding/withdrawal/consolidation (with validators-manager EIP-712 signing), extending the sidecar → relayer signature-share submission to include deposit + exit signatures, and replacing the old DB/genesis-validator bootstrap with a file-driven public-keys manager tracked in-memory.

Changes:

  • Add new Relayer module (schemas, endpoints, typings, validators-manager signer) and related tests/fixtures.
  • Update Validators API to accept combined deposit/exit signature shares and expose richer validator metadata to sidecars.
  • Remove sqlite-backed network validators persistence + genesis IPFS bootstrap; use a CSV public-keys file and event scanning to track registrations.

Reviewed changes

Copilot reviewed 31 out of 36 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/validators/typings.py Removes old validator/network-validator dataclasses; keeps oracle shares dataclass.
src/validators/tasks.py Drops genesis validator loader; updates cleanup lifetime setting; scanner now uses AppState manager.
src/validators/schema.py Renames/reshapes request/response models for v4 (deposit+exit shares; richer validators response).
src/validators/exit_signature.py Adds deposit signature validation helper using sw_utils.
src/validators/execution.py Reworks network validator event processing to update PublicKeysManager instead of DB.
src/validators/endpoints.py Replaces old endpoints with GET /validators and POST /signatures for deposit+exit shares.
src/validators/database.py Deletes sqlite CRUD for network validators.
src/relayer/validators_manager.py New EIP-712 signing utilities for validators-manager signatures.
src/relayer/typings.py New Validator dataclass + ValidatorType supporting v1/v2 withdrawal credentials & deposit data root.
src/relayer/public_keys.py New CSV-backed public key loader and registration tracking (consensus + pending deposits + execution logs).
src/relayer/schema.py New request/response schemas for /register, /fund, /withdraw, /consolidate.
src/relayer/endpoints.py New relayer API endpoints that create validators and produce validators-manager signatures.
src/relayer/tests/test_public_keys.py Unit tests for PublicKeysManager behavior.
src/relayer/tests/test_endpoints.py Endpoint-flow tests, including signature-share aggregation.
src/relayer/tests/conftest.py Loads sidecar share fixtures for tests.
src/relayer/tests/fixtures/sidecar_shares_1_validator.json Test fixture for 1-validator signature shares.
src/relayer/tests/fixtures/sidecar_shares_2_validators.json Test fixture for 2-validator signature shares.
src/conftest.py Adds shared httpx test client fixture for FastAPI app.
src/config/settings.py Removes DB/genesis IPFS settings; adds validators-manager/public-keys settings + event concurrency config.
src/common/schema.py Extends /info response with validators-manager address.
src/common/endpoints.py Implements /info validators-manager address output.
src/common/contracts.py Adds concurrency to event scanning and adds Vault/Registry helper methods.
src/common/clients.py Removes sqlite DB client; keeps consensus/execution/ipfs clients.
src/common/abi/IEthVault.json Adds EthVault ABI for VaultContract wrapper.
src/common/tests/test_endpoints.py Adds test coverage for updated /info.
src/app_state.py Adds public_keys_manager + validators_manager_account to global state; switches validator type source.
src/app.py Loads validators-manager account + public keys on startup; registers relayer router; adjusts task startup.
pyproject.toml Bumps version to v1.0.0, adds httpx, configures pytest asyncio mode.
poetry.lock Locks new httpx/httpcore dependencies.
README.md Updates run instructions and sidecar interaction description for v4.
.env.example Replaces DB setting with keyfile/password/public-keys settings and concurrency option.
.github/workflows/ci.yaml Ensures .env exists in CI by copying .env.example.
.gitignore Ignores additional local/dev artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 9, 2026 12:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 32 out of 37 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 39 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 16, 2026 09:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 35 out of 40 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings March 16, 2026 10:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 34 out of 39 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +113 to +115
empty_signature = bytes(96)
for public_key, amount in zip(request.public_keys, request.amounts):
validator = Validator(


def _create_and_sign_message(
vault: ChecksumAddress, validators: bytes, validators_registry_root: bytes
Copy link

Choose a reason for hiding this comment

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

Pls add comment that nonce is used as validators_registry_root in contract

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.

3 participants