diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8fc126a..af5794f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,9 +53,9 @@ jobs: sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc - wget -c https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.11.6-ea9e62ca.tar.gz - tar -xf geth-linux-amd64-1.11.6-ea9e62ca.tar.gz - mv geth-linux-amd64-1.11.6-ea9e62ca/geth /usr/local/bin/ + wget -c https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.12.0-e501b3b0.tar.gz + tar -xf geth-linux-amd64-1.12.0-e501b3b0.tar.gz + mv geth-linux-amd64-1.12.0-e501b3b0/geth /usr/local/bin/ chmod a+x /usr/local/bin/geth - name: Build @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v3 with: repository: eth-infinitism/bundler-spec-tests - ref: 'e193753db1910fb6d0ee2661d96a8d8f79d6c7d8' + ref: 'ec7a90dc3d7268ea55d395ebab030f156ca7f79f' submodules: true - uses: actions/checkout@v3 with: @@ -111,4 +111,4 @@ jobs: - run: npm install -g yarn - name: Run tests - run: pdm run test --launcher-script silius/bundler-spec-tests/launcher.sh --url http://localhost:3000 + run: pdm run test --launcher-script silius/bundler-spec-tests/launcher.sh --url http://127.0.0.1:3000 diff --git a/README.md b/README.md index dd9b4e09..9e9c03a2 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For more information: https://hackmd.io/@Vid201/aa-bundler-rust Rust version: 1.71.1 1. `libclang-dev`, `pkg-config` and `libssl-dev` on Debian/Ubuntu. -2. Ethereum execution client JSON-RPC API with enabled [`debug_traceCall`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debug_tracecall). For production, you can use [Geth](https://github.com/ethereum/go-ethereum) or [Erigon](https://github.com/ledgerwatch/erigon). For testing, we are using Geth dev mode (tested with [v1.11.6](https://github.com/ethereum/go-ethereum/releases/tag/v1.11.6)); so you need to install [Geth](https://geth.ethereum.org/docs/getting-started/installing-geth) for running tests. +2. Ethereum execution client JSON-RPC API with enabled [`debug_traceCall`](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debug_tracecall). For production, you can use [Geth](https://github.com/ethereum/go-ethereum) or [Erigon](https://github.com/ledgerwatch/erigon). For testing, we are using Geth dev mode (tested with [v1.12.0](https://github.com/ethereum/go-ethereum/releases/tag/v1.12.0)); so you need to install [Geth](https://geth.ethereum.org/docs/getting-started/installing-geth) for running tests. 3. [`solc`](https://docs.soliditylang.org/en/v0.8.17/installing-solidity.html) >=0.8.12. 4. [`cargo-sort`](https://crates.io/crates/cargo-sort) and [`cargo-udeps`](https://crates.io/crates/cargo-udeps). @@ -109,7 +109,7 @@ make lint make test ``` -Official [bundler spec tests](https://github.com/eth-infinitism/bundler-spec-tests) developed by the [eth-infinitism](https://github.com/eth-infinitism/) team are also included in the repo's CI pipeline (commit: [e193753db1910fb6d0ee2661d96a8d8f79d6c7d8](https://github.com/eth-infinitism/bundler-spec-tests/tree/e193753db1910fb6d0ee2661d96a8d8f79d6c7d8)). You can find more information on how to run tests [here](https://github.com/eth-infinitism/bundler-spec-tests). Make sure your contribution doesn't break the tests! +Official [bundler spec tests](https://github.com/eth-infinitism/bundler-spec-tests) developed by the [eth-infinitism](https://github.com/eth-infinitism/) team are also included in the repo's CI pipeline (commit: [ec7a90dc3d7268ea55d395ebab030f156ca7f79f](https://github.com/eth-infinitism/bundler-spec-tests/tree/ec7a90dc3d7268ea55d395ebab030f156ca7f79f)). You can find more information on how to run tests [here](https://github.com/eth-infinitism/bundler-spec-tests). Make sure your contribution doesn't break the tests! ## Contact diff --git a/bin/silius/src/cli/args.rs b/bin/silius/src/cli/args.rs index 336b1396..f411492a 100644 --- a/bin/silius/src/cli/args.rs +++ b/bin/silius/src/cli/args.rs @@ -70,7 +70,7 @@ pub struct UoPoolArgs { pub datadir: Option, /// Max allowed verification gas. - #[clap(long, default_value="3000000", value_parser=parse_u256)] + #[clap(long, default_value="5000000", value_parser=parse_u256)] pub max_verification_gas: U256, /// Minimum stake required for entities. diff --git a/bundler-spec-tests/docker-compose.yml b/bundler-spec-tests/docker-compose.yml index fa3b2bdd..fa25243c 100644 --- a/bundler-spec-tests/docker-compose.yml +++ b/bundler-spec-tests/docker-compose.yml @@ -1,13 +1,36 @@ -version: '2' +version: "3" services: geth-dev: - build: geth-dev + image: ethereum/client-go:release-1.12 + healthcheck: + test: [ "CMD-SHELL", "geth attach --exec eth.blockNumber" ] + interval: 10s + timeout: 5s + retries: 5 ports: - 8545:8545 - 8546:8546 + command: + - --miner.gaslimit=12000000 + - --http + - --http.api=personal,eth,net,web3,debug + - --allow-insecure-unlock + - --rpc.allow-unprotected-txs + - --http.vhosts=* + - --http.corsdomain=* + - --http.addr=0.0.0.0 + - --ws + - --ws.api=personal,eth,net,web3,debug + - --ws.origins=* + - --ws.addr=0.0.0.0 + - --dev + - --nodiscover + - --maxpeers=0 + - --mine + - --verbosity=2 fund-signer: - image: ethereum/client-go:release-1.10 + image: ethereum/client-go:release-1.12 entrypoint: 'geth --exec "eth.sendTransaction({from: eth.accounts[0], to: \"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\", value: web3.toWei(10000, \"ether\")})" attach http://geth-dev:8545' depends_on: geth-dev: diff --git a/bundler-spec-tests/geth-dev/Dockerfile b/bundler-spec-tests/geth-dev/Dockerfile deleted file mode 100644 index 5db03fc3..00000000 --- a/bundler-spec-tests/geth-dev/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ethereum/client-go:release-1.10 - -ENTRYPOINT geth \ - --verbosity 1 \ - --http.vhosts '*,localhost,host.docker.internal' \ - --http \ - --http.api personal,eth,net,web3,debug \ - --http.corsdomain '*' \ - --http.addr "0.0.0.0" \ - --ws \ - --ws.api personal,eth,net,web3,debug \ - --ws.origins '*' \ - --ws.addr "0.0.0.0" \ - --nodiscover --maxpeers 0 --mine \ - --networkid 1337 \ - --dev \ - --allow-insecure-unlock \ - --rpc.allow-unprotected-txs \ - --dev.gaslimit 20000000 \ No newline at end of file diff --git a/bundler-spec-tests/launcher.sh b/bundler-spec-tests/launcher.sh old mode 100644 new mode 100755 index af796c8c..d5624ea3 --- a/bundler-spec-tests/launcher.sh +++ b/bundler-spec-tests/launcher.sh @@ -12,7 +12,7 @@ case $1 in docker-compose up -d silius bundler \ --verbosity 4 \ - --eth-client-address ws://localhost:8545 \ + --eth-client-address ws://127.0.0.1:8546 \ --mnemonic-file keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ --beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ --entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 \ diff --git a/crates/contracts/src/tracer.rs b/crates/contracts/src/tracer.rs index 2f233831..fd441686 100644 --- a/crates/contracts/src/tracer.rs +++ b/crates/contracts/src/tracer.rs @@ -165,7 +165,10 @@ pub const JS_TRACER: &str = r#" this.lastThreeOpcodes.shift(); } // this.debug.push(this.lastOp + '-' + opcode + '-' + log.getDepth() + '-' + log.getGas() + '-' + log.getCost()) - if (log.getGas() < log.getCost()) { + if (log.getGas() < log.getCost() || ( + // special rule for SSTORE with gas metering + opcode === 'SSTORE' && log.getGas() < 2300) + ) { this.currentLevel.oog = true; } if (opcode === 'REVERT' || opcode === 'RETURN') { diff --git a/docker-compose.yml b/docker-compose.yml index 64bc8ec2..6549285a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: "3" + services: silius: image: ghcr.io/vid201/silius:latest