Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AA-440 validate without simulateValidation #143

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 12 additions & 71 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
version: 2.1

executors:
my-executor:
docker:
- image: shahafn/go-python-node
commands:
update-and-build-deps-cached:
steps:
Expand Down Expand Up @@ -38,8 +43,7 @@ commands:
- "@rip7560"
jobs:
test-erc4337-bundler:
docker:
- image: shahafn/go-python-node
executor: my-executor
steps:
- checkout
- run:
Expand All @@ -64,7 +68,9 @@ jobs:
- update-and-build-deps-cached
- run:
name: "Clone go-ethereum"
command: ./scripts/clone-helper RIP-7560-revision-3 https://github.com/eth-infinitism/go-ethereum.git --no-submodules
# NOTE: using plain geth + native tracer (no need for eip7560)
# temp: avoid current-branch checkout, and force geth-with-tracer
command: CIRCLE_BRANCH=master ./scripts/clone-helper geth-with-erc7562-tracer https://github.com/eth-infinitism/go-ethereum.git --no-submodules
- restore_cache:
keys:
- go-ethereum-build-{{ checksum "go-ethereum/commit-hash.txt" }}
Expand All @@ -82,7 +88,6 @@ jobs:
key: go-ethereum-build-{{ checksum "go-ethereum/commit-hash.txt" }}
paths:
- go-ethereum/build/bin
- go-ethereum/circleciconfig.toml
- run:
name: "Clone bundler"
command: ./scripts/clone-helper master https://github.com/eth-infinitism/bundler.git
Expand Down Expand Up @@ -142,9 +147,8 @@ jobs:
--http.port \
8545 \
--rpc.allow-unprotected-txs \
--config \
circleciconfig.toml \
"

background: true
- run:
name: "Run bundler (ERC4337)"
Expand All @@ -161,10 +165,9 @@ jobs:
http://localhost:3000/rpc
- run:
name: "Run pytest"
command: pdm run test
command: pdm run test --query-ep
test-rip7560-bundler:
docker:
- image: shahafn/go-python-node
executor: my-executor
steps:
- checkout
- run:
Expand Down Expand Up @@ -288,65 +291,6 @@ jobs:
name: "Run pytest (RIP7560)"
command: "pdm run test-rip7560"

# TODO: extract all the shared boilerplate stuff, pdm and bundler compilation
test-erc4337-with-eip7702-bundler:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
- image: shahafn/go-python-node
- image: ethpandaops/geth:lightclient-prague-devnet-4
command: "\
--miner.gaslimit 12000000 \
--http \
--http.api personal,eth,net,web3,debug \
--allow-insecure-unlock \
--rpc.allow-unprotected-txs \
--http.vhosts '*,localhost,host.docker.internal' \
--http.corsdomain '*' \
--http.addr '0.0.0.0' \
--dev \
--rpc.txfeecap 0 \
--nodiscover --maxpeers 0 --mine \
--verbosity 2"
# Add steps to the job
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
steps:
- checkout
- run:
name: "clone bundler"
command: ./scripts/clone-helper master https://github.com/eth-infinitism/bundler.git
- run:
name: "yarn install for bundler (TMP: delete nested 'util' to use our pre-built)"
working_directory: "./bundler"
command: yarn install --ignore-engines && rm -rf ./node_modules/@ethereumjs/common/node_modules/@ethereumjs/util && yarn preprocess
- run:
name: "curl pdm"
command: "curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -"
- run:
name: "update-deps"
command: "pdm run update-deps"
- run:
name: "pdm install"
command: "pdm install"
- run:
name: "deploy entry point"
working_directory: "./bundler"
command: yarn hardhat-deploy --network localhost
- run:
name: "run 7702 bundler"
working_directory: "./bundler"
command: yarn bundler-eip7702
background: true
- run:
name: "await bundler"
working_directory: "./bundler"
shell: /bin/sh
command: |
wget --post-data="{\"method\": \"eth_supportedEntryPoints\"}" --retry-connrefused --waitretry=2 --timeout=60 --tries=30 http://localhost:3000/rpc
- run:
name: "pytest"
command: "pdm run test-eip7702 --log-rpc -v "

workflows:
version: 2
test-bundler-erc4337-workflow:
Expand All @@ -355,6 +299,3 @@ workflows:
test-bundler-rip7560-workflow:
jobs:
- test-rip7560-bundler
test-erc4337-with-eip7702-bundler:
jobs:
- test-erc4337-with-eip7702-bundler
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ rip7560-build = {shell = "cd @rip7560 && yarn && yarn compile-hardhat" }
dep-build = {composite = ["spec-build", "rip7560-build"]}
update-deps = {composite = ["submodule-update", "dep-build"]}
update-deps-remote = {shell = "git submodule update --init --recursive --remote && cd @account-abstraction && yarn && yarn compile && cd ../spec && yarn && yarn build && cd ../@rip7560 && yarn && yarn compile-hardhat"}
test = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --entry-point 0x0000000071727De22E5E9d8BAf0edAc6f37da032 --ethereum-node http://127.0.0.1:8545/ tests/single"
test-rip7560 = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --nonce-manager 0x3D45A0363baBA693432f9Cb82c60BE9410A5Fd8f --stake-manager 0x2F9d2b9Af343dA0288Fc8270354e4c47b63817f3 --ethereum-node http://127.0.0.1:8545/ tests/rip7560"
test-eip7702 = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --entry-point 0x0000000071727De22E5E9d8BAf0edAc6f37da032 --nonce-manager 0x63f63e798f5F6A934Acf0a3FD1C01f3Fac851fF0 --stake-manager 0x570Aa568b6cf62ff08c6C3a3b3DB1a0438E871Fb --ethereum-node http://127.0.0.1:8545/ tests/eip7702"
test = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --query-ep --ethereum-node http://127.0.0.1:8545/ tests/single"
test-rip7560 = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --nonce-manager 0x59c405Dc6D032d9Ff675350FefC66F3b6c1bEbaB --stake-manager 0xC59f4c593E0BfB731f63Ce35873ef3723B37D25d --ethereum-node http://127.0.0.1:8545/ tests/rip7560"
p2ptest = "pytest --tb=short -rA -W ignore::DeprecationWarning --url http://localhost:3000/rpc --entry-point 0x0000000071727De22E5E9d8BAf0edAc6f37da032 --ethereum-node http://127.0.0.1:8545/ tests/p2p"
lint = "pylint tests"
format = "black tests"
Expand Down
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def pytest_configure(config):
CommandLineArgs.configure(
url=config.getoption("--url"),
entrypoint=config.getoption("--entry-point"),
query_ep=config.getoption("--query-ep"),
nonce_manager=config.getoption("--nonce-manager"),
stake_manager=config.getoption("--stake-manager"),
ethereum_node=config.getoption("--ethereum-node"),
Expand Down Expand Up @@ -53,6 +54,7 @@ def pytest_addoption(parser):
parser.addoption("--ethereum-node", action="store")
parser.addoption("--launcher-script", action="store")
parser.addoption("--log-rpc", action="store_true", default=False)
parser.addoption("--query-ep", action="store_true", default=False)


@pytest.fixture(scope="session")
Expand Down
5 changes: 5 additions & 0 deletions tests/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def configure(
cls,
url,
entrypoint,
query_ep,
nonce_manager,
stake_manager,
ethereum_node,
Expand All @@ -37,6 +38,10 @@ def configure(
cls.ethereum_node = ethereum_node
cls.launcher_script = launcher_script
cls.log_rpc = log_rpc
if query_ep:
cls.entrypoint = (
RPCRequest(method="eth_supportedEntryPoints").send(cls.url).result[0]
)


@dataclass
Expand Down