Skip to content

Commit

Permalink
fix(cli): fix ep disable flags
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Jun 7, 2024
1 parent 0074fe0 commit 1e8f5e2
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions bin/rundler/src/cli/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl BuilderArgs {
let mut entry_points = vec![];
let mut num_builders = 0;

if common.entry_point_v0_6_enabled {
if !common.disable_entry_point_v0_6 {
entry_points.push(EntryPointBuilderSettings {
address: chain_spec.entry_point_address_v0_6,
version: EntryPointVersion::V0_6,
Expand All @@ -239,7 +239,7 @@ impl BuilderArgs {
});
num_builders += common.num_builders_v0_6;
}
if common.entry_point_v0_7_enabled {
if !common.disable_entry_point_v0_7 {
entry_points.push(EntryPointBuilderSettings {
address: chain_spec.entry_point_address_v0_7,
version: EntryPointVersion::V0_7,
Expand Down
20 changes: 10 additions & 10 deletions bin/rundler/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,13 @@ pub struct CommonArgs {
pub mempool_config_path: Option<String>,

#[arg(
long = "entry_point_v0_6_enabled",
name = "entry_point_v0_6_enabled",
env = "ENTRY_POINT_V0_6_ENABLED",
default_value = "true",
long = "disable_entry_point_v0_6",
name = "disable_entry_point_v0_6",
env = "DISABLE_ENTRY_POINT_V0_6",
default_value = "false",
global = true
)]
pub entry_point_v0_6_enabled: bool,
pub disable_entry_point_v0_6: bool,

// Ignored if entry_point_v0_6_enabled is false
#[arg(
Expand All @@ -285,13 +285,13 @@ pub struct CommonArgs {
pub num_builders_v0_6: u64,

#[arg(
long = "entry_point_v0_7_enabled",
name = "entry_point_v0_7_enabled",
env = "ENTRY_POINT_V0_7_ENABLED",
default_value = "true",
long = "disable_entry_point_v0_7",
name = "disable_entry_point_v0_7",
env = "DISABLE_ENTRY_POINT_V0_7",
default_value = "false",
global = true
)]
pub entry_point_v0_7_enabled: bool,
pub disable_entry_point_v0_7: bool,

// Ignored if entry_point_v0_7_enabled is false
#[arg(
Expand Down
4 changes: 2 additions & 2 deletions bin/rundler/src/cli/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl PoolArgs {

let mut pool_configs = vec![];

if common.entry_point_v0_6_enabled {
if !common.disable_entry_point_v0_6 {
pool_configs.push(PoolConfig {
entry_point: chain_spec.entry_point_address_v0_6,
entry_point_version: EntryPointVersion::V0_6,
Expand All @@ -216,7 +216,7 @@ impl PoolArgs {
..pool_config_base.clone()
});
}
if common.entry_point_v0_7_enabled {
if !common.disable_entry_point_v0_7 {
pool_configs.push(PoolConfig {
entry_point: chain_spec.entry_point_address_v0_7,
entry_point_version: EntryPointVersion::V0_7,
Expand Down
4 changes: 2 additions & 2 deletions bin/rundler/src/cli/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ impl RpcArgs {
estimation_settings,
rpc_timeout: Duration::from_secs(self.timeout_seconds.parse()?),
max_connections: self.max_connections,
entry_point_v0_6_enabled: common.entry_point_v0_6_enabled,
entry_point_v0_7_enabled: common.entry_point_v0_7_enabled,
entry_point_v0_6_enabled: !common.disable_entry_point_v0_6,
entry_point_v0_7_enabled: !common.disable_entry_point_v0_7,
})
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ See [chain spec](./architecture/chain_spec.md) for a detailed description of cha
- This path can either be a local file path or an S3 url. If using an S3 url, Make sure your machine has access to this file.
- env: *MEMPOOL_CONFIG_PATH*
- See [here](./architecture/pool.md#alternative-mempools-in-preview) for details.
- `--entry_point_v0_6_enabled`: Enable entry point v0.6 support. (default: `true`).
- env: *ENTRY_POINT_V0_6_ENABLED*
- `--disable_entry_point_v0_6`: Disable entry point v0.6 support. (default: `false`).
- env: *DISABLE_ENTRY_POINT_V0_6*
- `--num_builders_v0_6`: The number of bundle builders to run on entry point v0.6 (default: `1`)
- env: *NUM_BUILDERS_V0_6*
- `--entry_point_v0_7_enabled`: Enable entry point v0.7 support. (default: `true`).
- env: *ENTRY_POINT_V0_7_ENABLED*
- `--disable_entry_point_v0_7`: Disable entry point v0.7 support. (default: `false`).
- env: *DISABLE_ENTRY_POINT_V0_7*
- `--num_builders_v0_7`: The number of bundle builders to run on entry point v0.7 (default: `1`)
- env: *NUM_BUILDERS_V0_7*

Expand Down
2 changes: 1 addition & 1 deletion test/spec-tests/local/run-spec-tests-v0_6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd "$(dirname "$0")"
cargo build

./launcher.sh stop # kill already running processes if any
export ENTRY_POINT_V0_6_ENABLED=true
export DISABLE_ENTRY_POINT_V0_7=true
./launcher.sh start v0_6

echo "Running v0.6 spec tests"
Expand Down
2 changes: 1 addition & 1 deletion test/spec-tests/local/run-spec-tests-v0_7.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cd "$(dirname "$0")"
cargo build

./launcher.sh stop # kill already running processes if any
export ENTRY_POINT_V0_7_ENABLED=true
export DISABLE_ENTRY_POINT_V0_6=true
./launcher.sh start v0_7

echo "Running v0.7 spec tests"
Expand Down
12 changes: 6 additions & 6 deletions test/spec-tests/remote/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ services:
- PRIORITY_FEE_MODE_KIND=base_fee_percent
- PRIORITY_FEE_MODE_VALUE=0
- POOL_HOST=0.0.0.0
- ENTRY_POINT_V0_6_ENABLED=${ENTRY_POINT_V0_6_ENABLED}
- ENTRY_POINT_V0_7_ENABLED=${ENTRY_POINT_V0_7_ENABLED}
- DISABLE_ENTRY_POINT_V0_6=${DISABLE_ENTRY_POINT_V0_6}
- DISABLE_ENTRY_POINT_V0_7=${DISABLE_ENTRY_POINT_V0_7}

rundler-builder:
image: alchemy-platform/rundler:latest
Expand All @@ -51,8 +51,8 @@ services:
- BUILDER_POOL_URL=https://rundler-pool:50051
- BUILDER_HOST=0.0.0.0
- BUILDER_PORT=50051
- ENTRY_POINT_V0_6_ENABLED=${ENTRY_POINT_V0_6_ENABLED}
- ENTRY_POINT_V0_7_ENABLED=${ENTRY_POINT_V0_7_ENABLED}
- DISABLE_ENTRY_POINT_V0_6=${DISABLE_ENTRY_POINT_V0_6}
- DISABLE_ENTRY_POINT_V0_7=${DISABLE_ENTRY_POINT_V0_7}

rundler-rpc:
image: alchemy-platform/rundler:latest
Expand All @@ -71,8 +71,8 @@ services:
- RPC_API=eth,debug
- RPC_POOL_URL=https://rundler-pool:50051
- RPC_BUILDER_URL=https://rundler-builder:50051
- ENTRY_POINT_V0_6_ENABLED=${ENTRY_POINT_V0_6_ENABLED}
- ENTRY_POINT_V0_7_ENABLED=${ENTRY_POINT_V0_7_ENABLED}
- DISABLE_ENTRY_POINT_V0_6=${DISABLE_ENTRY_POINT_V0_6}
- DISABLE_ENTRY_POINT_V0_7=${DISABLE_ENTRY_POINT_V0_7}
healthcheck:
test: curl --fail http://localhost:3000/health || exit 1
interval: 1s
Expand Down
8 changes: 4 additions & 4 deletions test/spec-tests/remote/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Launcher script for the rundler.

export TAG=latest
export ENTRY_POINT_V0_6_ENABLED=false
export ENTRY_POINT_V0_7_ENABLED=false
export DISABLE_ENTRY_POINT_V0_6=false
export DISABLE_ENTRY_POINT_V0_7=false
cd `dirname \`realpath $0\``
case $1 in

Expand All @@ -14,10 +14,10 @@ case $1 in
start)
case $2 in
v0_6)
export ENTRY_POINT_V0_6_ENABLED=true
export DISABLE_ENTRY_POINT_V0_7=true
;;
v0_7)
export ENTRY_POINT_V0_7_ENABLED=true
export DISABLE_ENTRY_POINT_V0_6=true
;;
*)
cat <<EOF
Expand Down

0 comments on commit 1e8f5e2

Please sign in to comment.