Skip to content

Commit 6388165

Browse files
committed
Merge branch 'main' of github.com:EspressoSystems/espresso-sequencer into hotshot/rc-0.5.69
2 parents 4300f42 + 702fa23 commit 6388165

File tree

12 files changed

+720
-222
lines changed

12 files changed

+720
-222
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
cargo build --locked --bin diff-test --release
5656
cargo test --locked --release --workspace --all-features --no-run
5757
cargo test --locked --release --workspace --all-features --verbose -- --test-threads 1 --nocapture
58-
timeout-minutes: 40
58+
timeout-minutes: 90

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/espresso-dev-node.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Espresso Dev Node
22

33
Espresso dev node is a node specifically designed for development and testing. It includes various nodes required to run
4-
a complete Espresso network, such as `builder`, `sequencer`, etc. Developers can use it for development and testing.
4+
a complete Espresso network, such as `builder`, `sequencer`, `state_prover` etc. Additionally, it supports deploying
5+
light client contracts on alternative chains and running a separate prover for each which can be useful for testing
6+
involving L3s. Developers can use dev node for development and testing.
57

68
## Download
79

@@ -13,16 +15,23 @@ docker run ghcr.io/espressosystems/espresso-sequencer/espresso-dev-node:main
1315

1416
## Parameters
1517

16-
| Name | Type | Environment Variable | Default Value | Description |
17-
| ------------------------------- | --------------- | ------------------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
18-
| `rpc_url` | `Option<Url>` | `ESPRESSO_SEQUENCER_L1_PROVIDER` | Automatically launched Avil node if not provided. | The JSON-RPC endpoint of the L1. If not provided, an Avil node will be launched automatically. |
19-
| `mnemonic` | `String` | `ESPRESSO_SEQUENCER_ETH_MNEMONIC` | `test test test test test test test test test test test junk` | Mnemonic for an L1 wallet. This wallet is used to deploy the contracts, so the account indicated by `ACCOUNT_INDEX` must be funded with ETH. |
20-
| `account_index` | `u32` | `ESPRESSO_DEPLOYER_ACCOUNT_INDEX` | `0` | Account index of the L1 wallet generated from `MNEMONIC`. Used when deploying contracts. |
21-
| `sequencer_api_port` | `u16` | `ESPRESSO_SEQUENCER_API_PORT` | Required | Port that the HTTP API will use. |
22-
| `sequencer_api_max_connections` | `Option<usize>` | `ESPRESSO_SEQUENCER_MAX_CONNECTIONS` | None | Maximum concurrent connections allowed by the HTTP API server. |
23-
| `builder_port` | `Option<u16>` | `ESPRESSO_BUILDER_PORT` | An unused port | Port for connecting to the builder. |
24-
| `prover_port` | `Option<u16>` | `ESPRESSO_PROVER_PORT` | An unused port | Port for connecting to the prover. If this is not provided, an available port will be selected. |
25-
| `dev_node_port` | `u16` | `ESPRESSO_DEV_NODE_PORT` | `20000` | Port for the dev node. This is used to provide tools and information to facilitate developers debugging. |
18+
| Name | Type | Environment Variable | Default Value | Description |
19+
| ------------------------------- | --------------- | -------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
20+
| `rpc_url` | `Option<Url>` | `ESPRESSO_SEQUENCER_L1_PROVIDER` | Automatically launched Avil node if not provided. | The JSON-RPC endpoint of the L1. If not provided, an Avil node will be launched automatically. |
21+
| `mnemonic` | `String` | `ESPRESSO_SEQUENCER_ETH_MNEMONIC` | `test test test test test test test test test test test junk` | Mnemonic for an L1 wallet. This wallet is used to deploy the contracts, so the account indicated by`ACCOUNT_INDEX` must be funded with ETH. |
22+
| `account_index` | `u32` | `ESPRESSO_DEPLOYER_ACCOUNT_INDEX` | `0` | Account index of the L1 wallet generated from`MNEMONIC`. Used when deploying contracts. |
23+
| `sequencer_api_port` | `u16` | `ESPRESSO_SEQUENCER_API_PORT` | Required | Port that the HTTP API will use. |
24+
| `sequencer_api_max_connections` | `Option<usize>` | `ESPRESSO_SEQUENCER_MAX_CONNECTIONS` | None | Maximum concurrent connections allowed by the HTTP API server. |
25+
| `builder_port` | `Option<u16>` | `ESPRESSO_BUILDER_PORT` | An unused port | Port for connecting to the builder. |
26+
| `prover_port` | `Option<u16>` | `ESPRESSO_PROVER_PORT` | An unused port | Port for connecting to the prover. If this is not provided, an available port will be selected. |
27+
| `dev_node_port` | `u16` | `ESPRESSO_DEV_NODE_PORT` | `20000` | Port for the dev node. This is used to provide tools and information to facilitate developers debugging. |
28+
| `update_interval` | `Duration` | `ESPRESSO_STATE_PROVER_UPDATE_INTERVAL` | `20s` | The frequency of updating the light client state |
29+
| `retry_interval` | `Duration` | `ESPRESSO_STATE_PROVER_RETRY_INTERVAL` | `2s` | Interval between retries if a state update fails. |
30+
| `alt_chain_providers` | `Vec<Url>` | `ESPRESSO_DEPLOYER_ALT_CHAIN_PROVIDERS` | `None` | Optional list of URLs representing alternate chains where the dev node will deploy Light client contracts and submit Light contract state updates. Useful for test environments involving L3s. |
31+
| `alt_mnemonics` | `Vec<String>` | `ESPRESSO_DEPLOYER_ALT_MNEMONICS` | `None` | Optional list of mnemonics for the alternate chains. If there are fewer mnemonics provided than chains, the base `MNEMONIC` will be used. |
32+
| `alt_account_indices` | `Vec<u32>` | `ESPRESSO_SEQUENCER_DEPLOYER_ALT_INDICES` | `None` | Optional list of account indices to use when deploying the contracts. If there are fewer indices provided than chains, the base ACCOUNT_INDEX will be used. |
33+
| `alt_prover_update_intervals` | `Vec<Duration>` | `ESPRESSO_STATE_PROVER_ALT_UPDATE_INTERVALS` | `None` | The frequency of updating the light client state for alternate chains. If there are fewer provided than chains, the base update_interval will be used. |
34+
| `alt_prover_retry_intervals` | `Vec<Duration>` | `ESPRESSO_STATE_PROVER_ALT_RETRY_INTERVALS` | `None` | Interval between retries if a state update fails for alternate chains. If there are fewer intervals provided than chains, the base retry_interval will be used. |
2635

2736
## APIs
2837

@@ -42,9 +51,23 @@ An example response is like this:
4251
```json
4352
{
4453
"builder_url": "http://localhost:41003/",
45-
"prover_port": 23156,
54+
"l1_prover_port": 23156,
4655
"l1_url": "http://localhost:8545/",
47-
"light_client_address": "0xb075b82c7a23e0994df4793422a1f03dbcf9136f"
56+
"l1_light_client_address": "0xb075b82c7a23e0994df4793422a1f03dbcf9136f",
57+
"alt_chains": [
58+
{
59+
"chain_id": 9,
60+
"provider_url": "http://localhost:8546/",
61+
"light_client_address": "0xa1b2c3d4e5f678901234567890abcdef12345678",
62+
"prover_port": 23157
63+
},
64+
{
65+
"chain_id": 10,
66+
"provider_url": "http://localhost:8547/",
67+
"light_client_address": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef",
68+
"prover_port": 23158
69+
}
70+
]
4871
}
4972
```
5073

@@ -53,8 +76,8 @@ An example response is like this:
5376
This endpoint simulates the effect of a liveness failure of the hotshot consensus protocol in the Light Client smart
5477
contract.
5578

56-
By calling this, the L1 height in the light contract will be frozen, and rollups will detect the HotShot failure. This
57-
is intended for testing rollups' functionalities when HotShot is down.
79+
By calling this, the height in the light contract will be frozen, and rollups will detect the HotShot failure. This is
80+
intended for testing rollups' functionalities when HotShot is down.
5881

5982
An example of a `curl` command:
6083

@@ -66,9 +89,10 @@ curl -X POST "http://localhost:20000/api/set-hotshot-down" \
6689

6790
Parameters
6891

69-
| Name | Type | Description |
70-
| ------ | ------- | ---------------------------------------- |
71-
| height | integer | The L1 height from which hotshot is down |
92+
| Name | Type | Required | Description |
93+
| -------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------- |
94+
| chain_id | integer | No | chain id for which the height needs to be frozen. If not provided, the base L1 light client contract is used. |
95+
| height | integer | Yes | The height from which hotshot is down |
7296

7397
### POST /api/set-hotshot-up
7498

@@ -84,3 +108,9 @@ An example of a `curl` command:
84108
curl -X POST "http://localhost:20000/api/set-hotshot-up" \
85109
-H "Content-Type: application/json"
86110
```
111+
112+
Parameter
113+
114+
| Name | Type | Required | Description |
115+
| -------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------- |
116+
| chain_id | integer | No | chain id for which the height needs to be unfrozen. If not provided, the base L1 light client contract will be used. |

hotshot-state-prover/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ark-srs = { workspace = true }
1515
ark-std = { workspace = true }
1616
async-compatibility-layer = { workspace = true }
1717
async-std = { workspace = true }
18+
async-trait = { workspace = true }
1819
clap = { workspace = true }
1920
cld = { workspace = true }
2021
contract-bindings = { path = "../contract-bindings" }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[route.getlightclientcontract]
22
PATH = ["/lightclient_contract"]
3-
DOC = "Get the address of light client contract on Layer1."
3+
METHOD = "GET"
4+
DOC = "Get the address of light client contract on Layer1."

hotshot-state-prover/src/bin/state-prover.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ async fn main() {
9595
relay_server: args.relay_server,
9696
update_interval: args.update_interval,
9797
retry_interval: args.retry_interval,
98-
l1_provider: args.l1_provider,
98+
provider: args.l1_provider,
9999
light_client_address: args.light_client_address,
100-
eth_signing_key: MnemonicBuilder::<English>::default()
100+
signing_key: MnemonicBuilder::<English>::default()
101101
.phrase(args.eth_mnemonic.as_str())
102102
.index(args.eth_account_index)
103103
.expect("error building wallet")
@@ -106,6 +106,7 @@ async fn main() {
106106
.with_chain_id(chain_id)
107107
.signer()
108108
.clone(),
109+
109110
sequencer_url: args.sequencer_url,
110111
port: args.port,
111112
stake_table_capacity: args.stake_table_capacity,

0 commit comments

Comments
 (0)