Skip to content

Commit e79af73

Browse files
zeroXbrockferranbt
andauthored
fix beginner setup/instructions for playground config (#232)
## 📝 Summary - changes path of `el_node_ipc_path` in `config-playground.toml` to use `$HOME/.playground/devnet` instead of `/tmp` (aligns with current builder-playground defaults) - adds a step in the README to replace '$HOME' with your actual home path - `$HOME` was not evaluating correctly for me (tested on my ubuntu machine), fully-qualified paths fixed it ## 💡 Motivation and Context Following the [instructions](https://github.com/flashbots/rbuilder?tab=readme-ov-file#end-to-end-local-testing) without changing anything gave me this error: ```txt δ cargo run --bin rbuilder run config-playground.toml Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.67s Running `target/debug/rbuilder run config-playground.toml` ...(truncated) Error: No such file or directory (os error 2) Caused by: No such file or directory (os error 2) Location: /home/dev/code/rbuilder/crates/rbuilder/src/live_builder/order_input/clean_orderpool.rs:30:20 ``` The [line of code](https://github.com/flashbots/rbuilder/blob/develop/crates/rbuilder/src/live_builder/order_input/clean_orderpool.rs#L30) given by the error connects to the IPC provider, which was being initialized with an invalid path given the current instructions & defaults. ## ✅ I have completed the following steps: * [x] Run `make lint` * [x] Run `make test` * [x] Added tests (if applicable) --------- Co-authored-by: Ferran Borreguero <[email protected]>
1 parent 112fb17 commit e79af73

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
version: nightly
5656

5757
- name: Install native dependencies
58-
run: sudo apt-get install -y libsqlite3-dev
58+
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev
5959

6060
- name: Lint
6161
run: make lint

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,22 @@ You can use [builder-playground](https://github.com/flashbots/builder-playground
8484

8585
First, start [builder-playground](https://github.com/flashbots/builder-playground):
8686

87-
```
87+
```bash
8888
git clone [email protected]:flashbots/builder-playground.git
8989
cd builder-playground
9090
go run main.go
9191
```
9292

93-
Then, run `rbuilder` using the `config-playground.toml` config file:
93+
Next, update `config-playground.toml` with fully-qualified paths for entries containing `$HOME`:
9494

95+
```bash
96+
# replaces '$HOME' with the actual value of "$HOME"
97+
sed -i "s|\$HOME|$HOME|g" config-playground.toml
9598
```
99+
100+
Then run `rbuilder` using the `config-playground.toml` config file:
101+
102+
```bash
96103
cargo run --bin rbuilder run config-playground.toml
97104
```
98105

config-playground.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ coinbase_secret_key = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf
1313
cl_node_url = ["http://localhost:3500"]
1414
jsonrpc_server_port = 8645
1515
jsonrpc_server_ip = "0.0.0.0"
16-
el_node_ipc_path = "/tmp/reth.ipc"
16+
el_node_ipc_path = "$HOME/.playground/devnet/reth.ipc"
1717
extra_data = "⚡🤖"
1818

1919
dry_run = false

crates/rbuilder/src/live_builder/base_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl BaseConfig {
209209
watchdog_timeout: self.watchdog_timeout(),
210210
error_storage_path: self.error_storage_path.clone(),
211211
simulation_threads: self.simulation_threads,
212-
order_input_config: OrderInputConfig::from_config(self),
212+
order_input_config: OrderInputConfig::from_config(self)?,
213213
blocks_source: slot_source,
214214
chain_chain_spec: self.chain_spec()?,
215215
provider,

crates/rbuilder/src/live_builder/order_input/mod.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,20 @@ impl OrderInputConfig {
123123
input_channel_buffer_size,
124124
}
125125
}
126-
pub fn from_config(config: &BaseConfig) -> Self {
127-
OrderInputConfig {
126+
127+
pub fn from_config(config: &BaseConfig) -> eyre::Result<Self> {
128+
let el_node_ipc_path = expand_path(config.el_node_ipc_path.clone())?;
129+
130+
Ok(OrderInputConfig {
128131
ignore_cancellable_orders: config.ignore_cancellable_orders,
129132
ignore_blobs: config.ignore_blobs,
130-
ipc_path: config.el_node_ipc_path.clone(),
133+
ipc_path: el_node_ipc_path,
131134
server_port: config.jsonrpc_server_port,
132135
server_ip: config.jsonrpc_server_ip(),
133136
serve_max_connections: 4096,
134137
results_channel_timeout: Duration::from_millis(50),
135138
input_channel_buffer_size: 10_000,
136-
}
139+
})
137140
}
138141

139142
pub fn default_e2e() -> Self {
@@ -288,3 +291,11 @@ where
288291

289292
Ok((handle, subscriber))
290293
}
294+
295+
pub fn expand_path(path: PathBuf) -> eyre::Result<PathBuf> {
296+
let path_str = path
297+
.to_str()
298+
.ok_or_else(|| eyre::eyre!("Invalid UTF-8 in path"))?;
299+
300+
Ok(PathBuf::from(shellexpand::full(path_str)?.into_owned()))
301+
}

0 commit comments

Comments
 (0)