Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/publish_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
dockerfile: ./lez/sequencer/service/Dockerfile
build_args: |
STANDALONE=true
- name: sequencer_service-mdns
dockerfile: ./lez/sequencer/service/Dockerfile
build_args: |
FEATURES=mdns
- name: indexer_service
dockerfile: ./lez/indexer/service/Dockerfile
build_args: ""
Expand Down Expand Up @@ -94,5 +98,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: ${{ matrix.build_args }}
build-contexts: risc0_base=docker-image://${{ secrets.DOCKER_REGISTRY }}/${{ github.repository }}/risc0_base:sha-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ result

wallet-ffi/wallet_ffi.h
bedrock_signing_key
# The devnet committee's keys are fixed and generated, and the compose file mounts them.
!lez/configs/docker-all-in-one/devnet/*/bedrock_signing_key
sequencer_stake_signing_key
integration_tests/configs/debug/

Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ members = [
"tools/integration_bench",
"tools/cross_zone_chat",
"tools/dashboard_gen",
"tools/devnet_configs",
]

[workspace.dependencies]
Expand Down
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ regenerate-test-fixture:
@echo "🧪 Regenerating test fixture"
RISC0_DEV_MODE=1 RUST_LOG=info cargo run -p test_fixtures --bin regenerate_test_fixture

# Regenerate the four-node docker devnet's shared sequencer config and per-node keys (the genesis
# stakes the whole committee, so the signatures are resigned; commit the result).
regenerate-devnet-configs:
@echo "🕸️ Regenerating devnet sequencer config and keys"
@cargo run -q -p devnet_configs

# Regenerate the committed Grafana dashboards from the Rust generator
# (tools/dashboard_gen) and commit the result. CI checks these are up to date.
regenerate-dashboards:
Expand Down Expand Up @@ -209,5 +215,6 @@ clean:
rm -rf lez/wallet/configs/debug/storage.json
rm -rf lez/wallet/configs/debug/statistics.json
rm -rf rocksdb*
docker compose down -v
cd bedrock && docker compose down -v && cd ..
cd monitoring && docker compose down -v && cd ..
19 changes: 16 additions & 3 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,25 @@ services:
environment:
- RUST_LOG=error

sequencer_service:
sequencer_service_0:
depends_on:
- logos-blockchain-node-0
- indexer_service

sequencer_service_1:
depends_on:
- logos-blockchain-node-0
- indexer_service

sequencer_service_2:
depends_on:
- logos-blockchain-node-0
- indexer_service

sequencer_service_3:
depends_on:
- logos-blockchain-node-0
- indexer_service
volumes:
- ./lez/configs/docker-all-in-one/sequencer_config.json:/etc/sequencer_service/sequencer_config.json

indexer_service:
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include:
- path:
bedrock/docker-compose.yml
- path:
lez/sequencer/service/docker-compose.yml
lez/sequencer/service/docker-compose.devnet.yml
- path:
lez/indexer/service/docker-compose.yml
- path:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
û¦î"gZ\#«õ$G²þ°%Á:ÆØp¦øŠsšÉÉ
1 change: 1 addition & 0 deletions lez/configs/docker-all-in-one/devnet/seq-0/signing_key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
û¦î"gZ\#«õ$G²þ°%Á:ÆØp¦øŠsšÉÉ
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
žÔÕ†“呟†4ý»•Ræ
±—PíïHa÷Û+¤é
2 changes: 2 additions & 0 deletions lez/configs/docker-all-in-one/devnet/seq-1/signing_key
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
žÔÕ†“呟†4ý»•Ræ
±—PíïHa÷Û+¤é
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
©ö}ÞN>÷ÏNùŽ'€~tª%·ŠT+_AR¦›¿4º`
1 change: 1 addition & 0 deletions lez/configs/docker-all-in-one/devnet/seq-2/signing_key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
©ö}ÞN>÷ÏNùŽ'€~tª%·ŠT+_AR¦›¿4º`
Binary file not shown.
Binary file not shown.
217 changes: 217 additions & 0 deletions lez/configs/docker-all-in-one/devnet/sequencer_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
{
"home": "/var/lib/sequencer_service",
"max_num_tx_in_block": 20,
"max_block_size": "1.0 MiB",
"mempool_max_size": 10000,
"block_create_timeout": "10s",
"retry_pending_blocks_timeout": "7s",
"bedrock_config": {
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"node_url": "http://logos-blockchain-node-0:18080/",
"auth": null,
"funding_key": "2e03b2eff5a45478e7e79668d2a146cf2c5c7925bce927f2b1c67f2ab4fc0d26",
"priority_fee_percent": 12,
"channel_params": {
"minimum_sequencer_stake": 149,
"posting_timeframe": 60,
"posting_timeout": 25
}
},
"genesis": [
{
"stake_sequencer": {
"sequencer_key": [
39,
202,
62,
216,
114,
73,
186,
255,
190,
189,
100,
49,
125,
130,
186,
33,
203,
209,
90,
45,
93,
198,
58,
196,
235,
238,
249,
72,
112,
76,
14,
128
],
"ownership_public_key": "766d57e60d3e8b22d40920c428941191fb820d8e321a52bc6028dcf37ab6a4c1",
"stake_signature": "f05d0a9663e456ce4dff883d9133e46a85225d86db24a21d3d8700b15fda65482086b38a5aa9de5cda1f5772e632b7b1d505556dff4d914e1b3dc4c5cd560419"
}
},
{
"stake_sequencer": {
"sequencer_key": [
99,
109,
167,
55,
119,
13,
230,
240,
217,
130,
164,
76,
216,
51,
124,
252,
208,
17,
126,
55,
91,
224,
170,
168,
120,
133,
142,
248,
164,
44,
23,
206
],
"ownership_public_key": "5b53a6c0682f008dfae4e57aed512129a9b9565d833716dd6700d48fdbca6255",
"stake_signature": "bc110502ff0df80a6f2159f8de36adeeed804c39612522d51fc62dd224292f518ad3f7cbaeb899bdd42e4627a237bd3b6fdb16ec64ac33f8f9e493129e9c1880"
}
},
{
"stake_sequencer": {
"sequencer_key": [
233,
15,
97,
77,
72,
75,
237,
17,
32,
239,
58,
155,
0,
55,
82,
25,
94,
118,
76,
11,
173,
164,
80,
63,
128,
80,
184,
65,
109,
94,
253,
13
],
"ownership_public_key": "a9183a30a9cc2de17d9b75c217e59811303d69b86963603728350e2fd626c6f1",
"stake_signature": "e77a3502e7d5395905c89a6857e33ae45fb64a2b18020e68e6dfe9bd9cdf3ad0648539359f93ddbfd1d71f26700e7a11a03695d5f32f8a7ca1150058d2f12819"
}
},
{
"stake_sequencer": {
"sequencer_key": [
69,
240,
101,
139,
207,
1,
135,
210,
194,
142,
98,
226,
240,
132,
168,
26,
29,
204,
168,
234,
24,
146,
49,
36,
232,
100,
118,
10,
140,
96,
211,
111
],
"ownership_public_key": "94824e3f613d983b8092fea29454d3f777b551f95a12b1d2dbdc2f00c0130a23",
"stake_signature": "0740899cd9bf8115873adbdb0cc73af8b844557ea278e573be527a826044d0097acdb31be2f233280fc8d01a6d81c1677376c75b3127be2bc08064d47583462f"
}
},
{
"supply_bridge_account": {
"balance": 1000000
}
},
{
"supply_account": {
"account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV",
"balance": 10000
}
},
{
"supply_account": {
"account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo",
"balance": 20000
}
},
{
"supply_account": {
"account_id": "61EsoYN6gvTLkveh1YSTMG3yJkncpHy5EGmxhSK4ew29",
"balance": 10000
}
},
{
"supply_account": {
"account_id": "3m6HQmCgmAvsxZtxAHPqqEqoBG4335fCG8TzxigyW7rE",
"balance": 20000
}
}
],
"cross_zone": null,
"metrics_address": "0.0.0.0:9000",
"gossip": {
"listen_addr": "/ip4/0.0.0.0/udp/0/quic-v1",
"bootstrap_peers": []
}
}
2 changes: 1 addition & 1 deletion lez/sequencer/actors/executor/src/actor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn sequencer_config() -> (SequencerConfig, TempDir) {
mempool_max_size: 10,
block_create_timeout: std::time::Duration::from_secs(5),
retry_pending_blocks_timeout: std::time::Duration::from_secs(5),
signing_key: [37; 32],
signing_key: Some([37; 32]),
bedrock_config: BedrockConfig {
channel_id: [0; 32].into(),
node_url: "http://not-used".parse().expect("Failed to parse URL"),
Expand Down
19 changes: 16 additions & 3 deletions lez/sequencer/core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
time::Duration,
};

use anyhow::{Result, ensure};
use anyhow::{Context as _, Result, ensure};
use bytesize::ByteSize;
use common::config::BasicAuth;
pub use cross_zone_inbox_core::{CrossZoneConfig, CrossZonePeer, CrossZoneRoute};
Expand Down Expand Up @@ -89,8 +89,13 @@ pub struct SequencerConfig {
/// Interval in which pending blocks are retried.
#[serde(with = "humantime_serde")]
pub retry_pending_blocks_timeout: Duration,
/// Sequencer own signing key.
pub signing_key: [u8; 32],
/// The key this sequencer signs its blocks with.
///
/// Absent when the node is given one separately (`--signing-key`), which is
/// what lets a set of sequencers share a single config file — it is all
/// that otherwise differs between them.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub signing_key: Option<[u8; 32]>,
Comment thread
Arjentix marked this conversation as resolved.
/// Bedrock configuration options.
pub bedrock_config: BedrockConfig,
/// Genesis configuration.
Expand Down Expand Up @@ -150,6 +155,14 @@ impl SequencerConfig {
Ok(config)
}

/// The key [`Self::signing_key`] names, ready to sign blocks with.
pub fn block_signing_key(&self) -> Result<lee::PrivateKey> {
let bytes = self.signing_key.context(
"No block signing key: set `signing_key` in the config, or pass --signing-key",
)?;
lee::PrivateKey::try_new(bytes).context("Block signing key is not a valid private key")
}

/// Where this sequencer's database lives, suffixed with the channel id like
/// the indexer's, so several sequencers can share a home directory. Only the
/// database is per-channel; `bedrock_signing_key` stays unsuffixed, so
Expand Down
Loading
Loading