Skip to content

Commit a19ff73

Browse files
committed
more cleanup and readme updates
- removes some unused env vars
1 parent 05c75da commit a19ff73

File tree

3 files changed

+61
-51
lines changed

3 files changed

+61
-51
lines changed

README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,35 @@ The following environment variables are exposed to configure the Builder:
2020
# Builder Configs for Pecorino Test Net
2121
HOST_CHAIN_ID="3151908"
2222
RU_CHAIN_ID="14174"
23+
24+
# Transaction Pool Configs
25+
TX_POOL_URL="http://pool.url.here/" # trailing slash is required
26+
27+
# RPC Endpoints
2328
HOST_RPC_URL="https://host-rpc.pecorino.signet.sh"
29+
RU_RPC_URL="https://rpc.pecorino.signet.sh"
30+
TX_POOL_URL=""
2431
TX_BROADCAST_URLS="" # trailing slash is required - set to none for test net configuration
32+
33+
# Contract configurations
2534
ZENITH_ADDRESS="0xbe45611502116387211D28cE493D6Fb3d192bc4E"
35+
BUILDER_HELPER_ADDRESS="0xb393416A722Fd48C3b0a9ab5fC2512Ef0c55e4CA"
36+
37+
# Misc.
2638
QUINCEY_URL="http://sequencer.pecorino.signet.sh/signBlock"
2739
BUILDER_PORT="8080"
28-
INCOMING_TRANSACTIONS_BUFFER="10"
29-
BLOCK_CONFIRMATION_BUFFER="10"
40+
SEQUENCER_KEY=""
41+
BUILDER_KEY=""
3042
BUILDER_REWARDS_ADDRESS="BUILDER_REWARDS_ADDRESS_HERE"
31-
ROLLUP_BLOCK_GAS_LIMIT="30000000"
32-
CONCURRENCY_LIMIT=10 # Concurrency parameter for simulation
33-
# Pecorino Slot Timing Configuration
43+
ROLLUP_BLOCK_GAS_LIMIT=""
44+
CONCURRENCY_LIMIT=""
45+
46+
# Pecorino Slot Timing Configurations
3447
SLOT_OFFSET="4"
3548
SLOT_DURATION="12"
3649
START_TIMESTAMP="1740681556"
37-
# Transaction Pool Configs
38-
TX_POOL_URL="http://pool.url.here/" # trailing slash is required
39-
TX_POOL_POLL_INTERVAL="5" # seconds
40-
TX_POOL_CACHE_DURATION="600" # seconds
4150
```
4251

43-
## API
44-
45-
### SignRequest
46-
47-
Sign request example payload:
48-
49-
```json
50-
{
51-
"hostBlockNumber": "0x0",
52-
"hostChainId": "0x1",
53-
"ruChainId": "0x2",
54-
"gasLimit": "0x5",
55-
"ruRewardAddress": "0x0606060606060606060606060606060606060606",
56-
"contents": "0x0707070707070707070707070707070707070707070707070707070707070707"
57-
}
58-
```
59-
6052
## Transaction Sender
6153

6254
The builder includes a `transaction-sender` for sending miniscule transactions for the purpose of testing the rollup block construction process. The `transaction-sender` is located in `bin/submit-transaction.rs`.
@@ -67,10 +59,22 @@ It requires a key to sign the transactions and a funded wallet.
6759

6860
The `transaction-sender` also has a set of configurable environment variables listed below.
6961

70-
```
62+
```sh
7163
RPC_URL="" # The URL of the RPC endpoint of the node you're sending the transaction to.
7264
RECIPIENT_ADDRESS="" # The address the submitter addresses the transaction to.
7365
SLEEP_TIME="" # The time to wait before sending another transaction, in seconds.
7466
SIGNER_CHAIN_ID=""
75-
SIGNER_KEY="" #
76-
```
67+
SIGNER_KEY=""
68+
```
69+
70+
## Testing
71+
72+
### F
73+
74+
In order to test the `builder`, one must build and deploy an image in the target network with a provisioned key.
75+
76+
1. Build a docker image with your changes
77+
2. Push the image to the image repository
78+
3. Update the image in the deployment
79+
4. Assert and confirm expected behavior
80+

src/config.rs

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,47 +55,65 @@ pub type HostProvider = FillProvider<
5555
/// chain.
5656
#[derive(Debug, Clone, FromEnv)]
5757
pub struct BuilderConfig {
58-
/// The chain ID of the host chain
58+
/// The chain ID of the host chain.
5959
#[from_env(var = "HOST_CHAIN_ID", desc = "The chain ID of the host chain")]
6060
pub host_chain_id: u64,
61-
/// The chain ID of the rollup chain
61+
62+
/// The chain ID of the rollup chain.
6263
#[from_env(var = "RU_CHAIN_ID", desc = "The chain ID of the rollup chain")]
6364
pub ru_chain_id: u64,
65+
6466
/// URL for Host RPC node.
6567
#[from_env(var = "HOST_RPC_URL", desc = "URL for Host RPC node", infallible)]
6668
pub host_rpc_url: Cow<'static, str>,
69+
6770
/// URL for the Rollup RPC node.
6871
#[from_env(var = "ROLLUP_RPC_URL", desc = "URL for Rollup RPC node", infallible)]
6972
pub ru_rpc_url: Cow<'static, str>,
70-
/// Additional RPC URLs to which to broadcast transactions.
71-
/// NOTE: should not include the host_rpc_url value
73+
74+
/// URL of the tx pool to poll for incoming transactions.
75+
#[from_env(
76+
var = "TX_POOL_URL",
77+
desc = "URL of the tx pool to poll for incoming transactions",
78+
infallible
79+
)]
80+
pub tx_pool_url: Cow<'static, str>,
81+
82+
/// Additional RPC URLs to which the builder should broadcast transactions.
83+
/// * Should not include the `HOST_RPC_URL` value, as that is already sent to by default.
84+
/// * Setting this can incur `already known` errors.
7285
#[from_env(
7386
var = "TX_BROADCAST_URLS",
7487
desc = "Additional RPC URLs to which the builder broadcasts transactions",
7588
infallible,
7689
optional
7790
)]
7891
pub tx_broadcast_urls: Vec<Cow<'static, str>>,
79-
/// address of the Zenith contract on Host.
92+
93+
/// Address of the Zenith contract on Host.
8094
#[from_env(var = "ZENITH_ADDRESS", desc = "address of the Zenith contract on Host")]
8195
pub zenith_address: Address,
82-
/// address of the Builder Helper contract on Host.
96+
97+
/// Address of the Builder Helper contract on Host.
8398
#[from_env(
8499
var = "BUILDER_HELPER_ADDRESS",
85100
desc = "address of the Builder Helper contract on Host"
86101
)]
87102
pub builder_helper_address: Address,
103+
88104
/// URL for remote Quincey Sequencer server to sign blocks.
89-
/// Disregarded if a sequencer_signer is configured.
105+
/// NB: Disregarded if a sequencer_signer is configured.
90106
#[from_env(
91107
var = "QUINCEY_URL",
92108
desc = "URL for remote Quincey Sequencer server to sign blocks",
93109
infallible
94110
)]
95111
pub quincey_url: Cow<'static, str>,
112+
96113
/// Port for the Builder server.
97114
#[from_env(var = "BUILDER_PORT", desc = "Port for the Builder server")]
98115
pub builder_port: u16,
116+
99117
/// Key to access Sequencer Wallet - AWS Key ID _OR_ local private key.
100118
/// Set IFF using local Sequencer signing instead of remote Quincey signing.
101119
#[from_env(
@@ -105,13 +123,15 @@ pub struct BuilderConfig {
105123
optional
106124
)]
107125
pub sequencer_key: Option<String>,
126+
108127
/// Key to access Builder transaction submission wallet - AWS Key ID _OR_ local private key.
109128
#[from_env(
110129
var = "BUILDER_KEY",
111130
desc = "Key to access Builder transaction submission wallet - AWS Key ID _OR_ local private key",
112131
infallible
113132
)]
114133
pub builder_key: String,
134+
115135
/// Buffer in seconds in which the `submitBlock` transaction must confirm on the Host chain.
116136
#[from_env(
117137
var = "BLOCK_CONFIRMATION_BUFFER",
@@ -125,23 +145,11 @@ pub struct BuilderConfig {
125145
desc = "Address on Rollup to which Builder will receive user transaction fees"
126146
)]
127147
pub builder_rewards_address: Address,
148+
128149
/// Gas limit for RU block.
129150
/// NOTE: a "smart" builder would determine this programmatically by simulating the block.
130151
#[from_env(var = "ROLLUP_BLOCK_GAS_LIMIT", desc = "Gas limit for RU block")]
131152
pub rollup_block_gas_limit: u64,
132-
/// URL of the tx pool to poll for incoming transactions.
133-
#[from_env(
134-
var = "TX_POOL_URL",
135-
desc = "URL of the tx pool to poll for incoming transactions",
136-
infallible
137-
)]
138-
pub tx_pool_url: Cow<'static, str>,
139-
/// Duration in seconds transactions can live in the tx-pool cache.
140-
#[from_env(
141-
var = "TX_POOL_CACHE_DURATION",
142-
desc = "Duration in seconds transactions can live in the tx-pool cache"
143-
)]
144-
pub tx_pool_cache_duration: u64,
145153

146154
/// Oauth2 configuration for the builder to connect to init4 services.
147155
pub oauth: OAuthConfig,

src/test_utils.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ pub fn setup_test_config() -> Result<BuilderConfig> {
2929
builder_port: 8080,
3030
sequencer_key: None,
3131
builder_key: "0000000000000000000000000000000000000000000000000000000000000000".into(),
32-
block_confirmation_buffer: 1,
3332
builder_rewards_address: Address::default(),
3433
rollup_block_gas_limit: 3_000_000_000,
3534
tx_pool_url: "http://localhost:9000/".into(),
36-
tx_pool_cache_duration: 5,
3735
oauth: OAuthConfig {
3836
oauth_client_id: "some_client_id".into(),
3937
oauth_client_secret: "some_client_secret".into(),

0 commit comments

Comments
 (0)