Skip to content

feat: support beacon deposit wallets - #22

Merged
cesarenaldi merged 11 commits into
mainfrom
feature/pro-318-sdk-work
May 29, 2026
Merged

cesarenaldi merged 11 commits into
mainfrom
feature/pro-318-sdk-work

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented May 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add beacon deposit-wallet CREATE2 derivation
  • detect at runtime whether the configured factory reports a beacon before deriving the expected deposit wallet address
  • preserve existing UUPS users by returning the UUPS address when it is already deployed
  • fall back to UUPS derivation when the factory has no beacon/reverts
  • use internal RPC helpers for factory probing and code checks
  • use an internal derive_uups_deposit_wallet helper and keep derive_deposit_wallet as a deprecated wrapper with docstring guidance

Verification

  • .venv/bin/black --check py_builder_relayer_client/builder/derive.py py_builder_relayer_client/client.py py_builder_relayer_client/config.py tests/builder/test_derive.py tests/config/test_config.py tests/test_client_deposit_wallet.py
  • .venv/bin/pytest -s tests/builder/test_derive.py tests/config/test_config.py
  • .venv/bin/pytest -s tests/builder/test_derive.py
  • tests/test_client_deposit_wallet.py via pytest with a temporary poly_eip712_structs import stub
  • .venv/bin/python -m py_compile py_builder_relayer_client/client.py py_builder_relayer_client/builder/derive.py py_builder_relayer_client/config.py tests/test_client_deposit_wallet.py

Notes

  • Full pytest collection remains blocked locally because poly_eip712_structs==0.0.1 is unavailable from the configured package index.

Linear: PRO-318


Note

Medium Risk
Incorrect CREATE2 or RPC-based selection could point users at the wrong wallet address; mitigated by preserving deployed UUPS addresses and broad test coverage for derivation and client branches.

Overview
Adds beacon-based ERC-1967 CREATE2 deposit wallet derivation and makes RelayClient.get_expected_deposit_wallet() choose the address at runtime instead of always using UUPS.

get_expected_deposit_wallet now derives the UUPS address, then RPC-probes the configured factory (eth_call with a beacon selector). If there is no beacon (zero address or revert), it returns UUPS. If a beacon exists but the UUPS wallet is already deployed (eth_getCode), it still returns UUPS for existing users; otherwise it returns the beacon CREATE2 address. Shared deposit_wallet_args and derive_uups_deposit_wallet replace the old monolithic derive path; derive_deposit_wallet remains as a deprecated UUPS-only wrapper pointing callers to the client method.

The client gains _rpc_call with chain default RPC URLs (137, 80002) when rpc_url is unset, plus helpers for revert detection and empty bytecode. Package version moves from 0.0.2rc1 to 0.0.2. Tests cover beacon/UUPS vectors and the new selection branches.

Reviewed by Cursor Bugbot for commit 6b1b5f1. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread py_builder_relayer_client/client.py
Comment thread py_builder_relayer_client/client.py Outdated
Comment thread py_builder_relayer_client/client.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 213cd2a. Configure here.

Comment thread py_builder_relayer_client/client.py Outdated
@cesarenaldi
cesarenaldi merged commit 267a36d into main May 29, 2026
5 checks passed
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.

2 participants