Skip to content

Commit

Permalink
fix: bundler spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vid201 committed Sep 21, 2023
1 parent d15b51e commit 16e6e81
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bin/silius/src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct UoPoolArgs {
pub datadir: Option<ExpandedPathBuf>,

/// 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.
Expand Down
19 changes: 9 additions & 10 deletions bundler-spec-tests/geth-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
FROM ethereum/client-go:release-1.10
FROM ethereum/client-go:release-1.12

ENTRYPOINT geth \
--verbosity 1 \
--http.vhosts '*,localhost,host.docker.internal' \
--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" \
--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 \
--ws.addr '0.0.0.0' \
--dev \
--allow-insecure-unlock \
--rpc.allow-unprotected-txs \
--dev.gaslimit 20000000
--nodiscover --maxpeers 0 --mine \
--verbosity 2
2 changes: 1 addition & 1 deletion bundler-spec-tests/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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://localhost:8546 \
--mnemonic-file keys/0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
--beneficiary 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \
--entry-points 0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789 \
Expand Down
5 changes: 4 additions & 1 deletion crates/contracts/src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 16e6e81

Please sign in to comment.