Skip to content

Commit 551ae21

Browse files
authored
config: adds flashbots endpoint env var (#143)
# config: adds flashbots endpoint env var Adds an environment variable to the config for interacting with a `FLASHBOTS_ENDPOINT` API. This is to enable the Builder to submit blocks to the configured Flashbots destination.
1 parent 27b4072 commit 551ae21

File tree

3 files changed

+50
-40
lines changed

3 files changed

+50
-40
lines changed

README.md

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -71,32 +71,33 @@ Finally, if it's non-empty, the submit task attempts to get a signature for the
7171

7272
The Builder is configured via environment variables. The following values are supported for configuration.
7373

74-
| Key | Required | Description |
75-
| ----------------------------- | -------- | ----------------------------------------------------------------------- |
76-
| `HOST_CHAIN_ID` | Yes | Host-chain ID (e.g. `3151908`) |
77-
| `RU_CHAIN_ID` | Yes | Rollup-chain ID (e.g. `14174`) |
78-
| `HOST_RPC_URL` | Yes | RPC endpoint for the host chain |
79-
| `ROLLUP_RPC_URL` | Yes | RPC endpoint for the rollup chain |
80-
| `TX_POOL_URL` | Yes | Transaction pool URL (must end with `/`) |
81-
| `TX_BROADCAST_URLS` | No | Additional endpoints for blob txs (comma-separated, slash required) |
82-
| `ZENITH_ADDRESS` | Yes | Zenith contract address |
83-
| `BUILDER_HELPER_ADDRESS` | Yes | Builder helper contract address |
84-
| `QUINCEY_URL` | Yes | Remote sequencer signing endpoint |
85-
| `BUILDER_PORT` | Yes | HTTP port for the Builder (default: `8080`) |
86-
| `SEQUENCER_KEY` | Yes | AWS KMS key ID _or_ local private key for sequencer signing |
87-
| `BUILDER_KEY` | Yes | AWS KMS key ID _or_ local private key for builder signing |
88-
| `BUILDER_REWARDS_ADDRESS` | Yes | Address receiving builder rewards |
89-
| `ROLLUP_BLOCK_GAS_LIMIT` | No | Override for block gas limit |
90-
| `CONCURRENCY_LIMIT` | No | Max concurrent tasks the simulator uses |
91-
| `OAUTH_CLIENT_ID` | Yes | Oauth client ID for the builder |
92-
| `OAUTH_CLIENT_SECRET` | Yes | Oauth client secret for the builder |
93-
| `OAUTH_AUTHENTICATE_URL` | Yes | Oauth authenticate URL for the builder for performing OAuth logins |
94-
| `OAUTH_TOKEN_URL` | Yes | Oauth token URL for the builder to get an Oauth2 access token |
95-
| `AUTH_TOKEN_REFRESH_INTERVAL` | Yes | The OAuth token refresh interval in seconds. |
96-
| `CHAIN_NAME` | No | The chain name ("pecorino", or the corresponding name) |
97-
| `SLOT_OFFSET` | No | Slot timing offset in seconds. Required if `CHAIN_NAME` is not present |
98-
| `SLOT_DURATION` | No | Slot duration in seconds. Required if `CHAIN_NAME` is not present |
99-
| `START_TIMESTAMP` | No | UNIX timestamp for slot 0. Required if `CHAIN_NAME` is not present |
74+
| Key | Required | Description |
75+
| ----------------------------- | -------- | ---------------------------------------------------------------------- |
76+
| `HOST_CHAIN_ID` | Yes | Host-chain ID (e.g. `3151908`) |
77+
| `RU_CHAIN_ID` | Yes | Rollup-chain ID (e.g. `14174`) |
78+
| `HOST_RPC_URL` | Yes | RPC endpoint for the host chain |
79+
| `ROLLUP_RPC_URL` | Yes | RPC endpoint for the rollup chain |
80+
| `TX_POOL_URL` | Yes | Transaction pool URL (must end with `/`) |
81+
| `TX_BROADCAST_URLS` | No | Additional endpoints for blob txs (comma-separated, slash required) |
82+
| `FLASHBOTS_ENDPOINT` | No | Flashbots API to submit blocks to. |
83+
| `ZENITH_ADDRESS` | Yes | Zenith contract address |
84+
| `BUILDER_HELPER_ADDRESS` | Yes | Builder helper contract address |
85+
| `QUINCEY_URL` | Yes | Remote sequencer signing endpoint |
86+
| `BUILDER_PORT` | Yes | HTTP port for the Builder (default: `8080`) |
87+
| `SEQUENCER_KEY` | Yes | AWS KMS key ID _or_ local private key for sequencer signing |
88+
| `BUILDER_KEY` | Yes | AWS KMS key ID _or_ local private key for builder signing |
89+
| `BUILDER_REWARDS_ADDRESS` | Yes | Address receiving builder rewards |
90+
| `ROLLUP_BLOCK_GAS_LIMIT` | No | Override for block gas limit |
91+
| `CONCURRENCY_LIMIT` | No | Max concurrent tasks the simulator uses |
92+
| `OAUTH_CLIENT_ID` | Yes | Oauth client ID for the builder |
93+
| `OAUTH_CLIENT_SECRET` | Yes | Oauth client secret for the builder |
94+
| `OAUTH_AUTHENTICATE_URL` | Yes | Oauth authenticate URL for the builder for performing OAuth logins |
95+
| `OAUTH_TOKEN_URL` | Yes | Oauth token URL for the builder to get an Oauth2 access token |
96+
| `AUTH_TOKEN_REFRESH_INTERVAL` | Yes | The OAuth token refresh interval in seconds. |
97+
| `CHAIN_NAME` | No | The chain name ("pecorino", or the corresponding name) |
98+
| `SLOT_OFFSET` | No | Slot timing offset in seconds. Required if `CHAIN_NAME` is not present |
99+
| `SLOT_DURATION` | No | Slot duration in seconds. Required if `CHAIN_NAME` is not present |
100+
| `START_TIMESTAMP` | No | UNIX timestamp for slot 0. Required if `CHAIN_NAME` is not present |
100101

101102
---
102103

@@ -136,13 +137,13 @@ A binary (`bin/submit_transaction.rs`) for continously sending very small transa
136137

137138
The following values are available for configuring the transaction sender:
138139

139-
| Key | Required | Description |
140-
| ------------------- | -------- | ------------------------------------------------ |
141-
| `RPC_URL` | Yes | RPC endpoint used for sending the transaction |
142-
| `RECIPIENT_ADDRESS` | Yes | Address to which the transaction is sent |
143-
| `SLEEP_TIME` | Yes | Optional delay (in ms) between transactions |
144-
| `SIGNER_CHAIN_ID` | Yes | Chain ID used for signing |
145-
| `SIGNER_KEY` | Yes | Signing key used to sign the transaction |
140+
| Key | Required | Description |
141+
| ------------------- | -------- | --------------------------------------------- |
142+
| `RPC_URL` | Yes | RPC endpoint used for sending the transaction |
143+
| `RECIPIENT_ADDRESS` | Yes | Address to which the transaction is sent |
144+
| `SLEEP_TIME` | Yes | Optional delay (in ms) between transactions |
145+
| `SIGNER_CHAIN_ID` | Yes | Chain ID used for signing |
146+
| `SIGNER_KEY` | Yes | Signing key used to sign the transaction |
146147

147148
The transaction submitter is located at `bin/submit_transaction.rs`.
148149

@@ -156,13 +157,13 @@ A binary (`bin/submit_order.rs`) for continuously sending small example orders f
156157

157158
The following values need to be configured:
158159

159-
| Key | Required | Description |
160-
| ------------------- | -------- | ------------------------------------------------ |
161-
| `RPC_URL` | Yes | RPC endpoint used for sending the transaction |
162-
| `SEND_TO_ROLLUP` | Yes | Whether to make a rollup order (RU-RU) or host order (RU-HOST) |
163-
| `SLEEP_TIME` | Yes | Optional delay (in ms) between transactions |
164-
| `SIGNER_CHAIN_ID` | Yes | Chain ID used for signing |
165-
| `SIGNER_KEY` | Yes | Signing key used to sign the transaction |
160+
| Key | Required | Description |
161+
| ----------------- | -------- | -------------------------------------------------------------- |
162+
| `RPC_URL` | Yes | RPC endpoint used for sending the transaction |
163+
| `SEND_TO_ROLLUP` | Yes | Whether to make a rollup order (RU-RU) or host order (RU-HOST) |
164+
| `SLEEP_TIME` | Yes | Optional delay (in ms) between transactions |
165+
| `SIGNER_CHAIN_ID` | Yes | Chain ID used for signing |
166+
| `SIGNER_KEY` | Yes | Signing key used to sign the transaction |
166167

167168
Run the order submitter with `cargo run --bin order-submitter`
168169

src/config.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ pub struct BuilderConfig {
8989
)]
9090
pub tx_broadcast_urls: Vec<Cow<'static, str>>,
9191

92+
/// Flashbots endpoint for privately submitting rollup blocks.
93+
#[from_env(
94+
var = "FLASHBOTS_ENDPOINT",
95+
desc = "Flashbots endpoint for privately submitting rollup blocks",
96+
optional
97+
)]
98+
pub flashbots_endpoint: Option<url::Url>,
99+
92100
/// Address of the Zenith contract on Host.
93101
#[from_env(var = "ZENITH_ADDRESS", desc = "address of the Zenith contract on Host")]
94102
pub zenith_address: Address,

src/test_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub fn setup_test_config() -> Result<BuilderConfig> {
3232
.try_into()
3333
.unwrap(),
3434
tx_broadcast_urls: vec!["http://localhost:9000".into()],
35+
flashbots_endpoint: Some("http://localhost:9062".parse().unwrap()), // NB: Flashbots API default
3536
zenith_address: Address::default(),
3637
quincey_url: "http://localhost:8080".into(),
3738
builder_port: 8080,

0 commit comments

Comments
 (0)