Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node Validator API #1771

Merged
merged 75 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
5db2dc7
sequencer `rollcall`
rob-maron Jul 22, 2024
a599c5d
external message handler
rob-maron Jul 22, 2024
8497354
address lints
rob-maron Jul 22, 2024
01ba5e9
don't respond if we didn't specify a URL
rob-maron Jul 22, 2024
fe97c14
remove patch
rob-maron Jul 23, 2024
a9b95d3
Merge remote-tracking branch 'origin/main' into rm/roll-call-changes
rob-maron Jul 23, 2024
0334071
Add node-metrics crate
Ayiga Jul 23, 2024
86f4049
Implement PartialEq for ServerMessage and ClientMessage
Ayiga Jul 2, 2024
424bd92
Expand implementation
Ayiga Jul 8, 2024
61e1363
Rename and add comments to assumption tests
Ayiga Jul 8, 2024
9c97ec7
Add specific errors for tide_disco::Error and surf_disco::Error
Ayiga Jul 8, 2024
605ddee
Replace `async_std::io::timeout` with prelude FutureExt `.timeout`
Ayiga Jul 8, 2024
eccb8ae
Add voters Sender and Receiver processing to `process_leaf_stream`
Ayiga Jul 8, 2024
6fb7fc2
Fix missing equality implementation for `LatestVoters` `ServerMessage`
Ayiga Jul 8, 2024
0b41463
Format and sort Cargo.toml dependencies
Ayiga Jul 8, 2024
05014b8
Remove unused lib types
Ayiga Jul 8, 2024
09b961b
Relocate the leaf stream construction
Ayiga Jul 8, 2024
3d611dc
Refactor NodeIdentity fields to be Optional
Ayiga Jul 8, 2024
d3b6924
Refactor `BitVec` for voters to be u16
Ayiga Jul 8, 2024
ae8f041
Add structure for decoding StakeTable from sequencer
Ayiga Jul 8, 2024
371dd8e
Refactor Node Identity storage in DataState
Ayiga Jul 8, 2024
ede6994
Replace ip addresses in node identity with public url
Ayiga Jul 9, 2024
9717b25
Add functions to parse Node Identity information from prometheus metrics
Ayiga Jul 11, 2024
83f81c8
Update Cargo.lock file for node-metrics
Ayiga Jul 15, 2024
7d398d2
Add parsing of wallet address
Ayiga Jul 15, 2024
607cd43
Fix incorrect key used for longitude
Ayiga Jul 15, 2024
1a520b9
Fix badly formatted Wallet address
Ayiga Jul 15, 2024
edd7a9f
Refactor node identity population to occur in separate functions
Ayiga Jul 15, 2024
3707bc6
Fix LocationDetails Debug trait test
Ayiga Jul 16, 2024
f23bde2
Fix test_process_client_handling_stream_subscribe_voteres test
Ayiga Jul 16, 2024
1bded48
Add process_node_identity_stream
Ayiga Jul 16, 2024
339924d
Add process_node_identity_url_stream
Ayiga Jul 16, 2024
69aa148
Add Node Identity information to Sequencer metrics reporting
Ayiga Jul 16, 2024
8daca23
Replace Sender with generic parameter
Ayiga Jul 17, 2024
cc26192
Fix inconsistent BLSPubKey decoding from str
Ayiga Jul 19, 2024
8dbb525
Fix incomplete urls in skipped test
Ayiga Jul 19, 2024
177e5bc
Remove unused module from use statements
Ayiga Jul 19, 2024
39eefef
Improve performance issue in `create_block_detail_from_leaf`
Ayiga Jul 19, 2024
5fce429
Fix types that were moved to espresso-types crate
Ayiga Jul 23, 2024
69593d0
Add simple node_validator_api creation function
Ayiga Jul 23, 2024
ae30f18
Rename Node Identity Environment variables
Ayiga Jul 24, 2024
139a559
Add public API advertisement environment variables
Ayiga Jul 24, 2024
6a4be2e
Move sample prometheus output for test to its own file
Ayiga Jul 24, 2024
c77239c
Add test file to typos exclusion list
Ayiga Jul 24, 2024
d15df90
Fix outdated `get_stake_table_from_sequencer` implementation
Ayiga Jul 24, 2024
26d9175
Add company website to node identity information
Ayiga Jul 25, 2024
32108b1
Remove unused main.rs
Ayiga Jul 25, 2024
c934c8e
Remove sequencer from dependency for node-metrics
Ayiga Jul 25, 2024
02c30a6
Refactor wrap async tasks in separate structures / impls
Ayiga Jul 25, 2024
1cde72e
Add optional processing of HotShot Events
Ayiga Jul 25, 2024
8b5c74d
Remove leaf retrieval from `create_node_validator_processing` call
Ayiga Jul 25, 2024
0951f9f
Add run_standalone_service call
Ayiga Jul 26, 2024
e7c9ed1
Refactor separate CDN tasks, and make optional
Ayiga Jul 30, 2024
7d560ad
Merge branch 'main' into ts/node-validator
Ayiga Jul 31, 2024
64507cf
Add connected network task tests for node-validator
Ayiga Jul 31, 2024
f07c65d
Add Node validator api port to env file
Ayiga Aug 1, 2024
ecc922f
Add node_validator to process compose
Ayiga Aug 1, 2024
cb132dd
Add node-validator to docker scripts
Ayiga Aug 1, 2024
a321982
Refactor simplify InternalClientMessage
Ayiga Aug 1, 2024
ac01ffe
Refactor `DataState` initialization to avoid mutation
Ayiga Aug 1, 2024
ea3d37a
Replace early return in `HotShotEventProcessingTask` with `continue`
Ayiga Aug 1, 2024
72d09f6
Add leaf chain sort to ensure ascending order
Ayiga Aug 1, 2024
4432510
Fix bad node-validator API documentation
Ayiga Aug 1, 2024
eebb3ce
Remove unnecessary drops
Ayiga Aug 1, 2024
b46ff57
Refactor define_api call to be more succinct
Ayiga Aug 1, 2024
762c0a0
Add comments describing some `NodeIdentity`
Ayiga Aug 1, 2024
9708b9e
Refactor ExtenralEvenHandler based on feedback
Ayiga Aug 1, 2024
ba8048c
Refactor separate node identity options into struct
Ayiga Aug 1, 2024
c0206d1
Refactor replace async task returns with panics
Ayiga Aug 2, 2024
e2a2180
Fix Identity value population
Ayiga Aug 2, 2024
0ef688d
Remove wallet_address from NodeIdentity
Ayiga Aug 2, 2024
07c4722
Add /v0/ to node_validator in process-compose.yaml
Ayiga Aug 2, 2024
6bbcb6e
Remove task joins from tests
Ayiga Aug 2, 2024
ddf35aa
Merge branch 'main' into ts/node-validator
Ayiga Aug 5, 2024
355093c
Add cancels to async tasks in tests to avoid panics
Ayiga Aug 5, 2024
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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ESPRESSO_SEQUENCER_GENESIS_FILE=/genesis/demo.toml
ESPRESSO_SEQUENCER_L1_PORT=8545
ESPRESSO_SEQUENCER_L1_WS_PORT=8546
ESPRESSO_SEQUENCER_L1_PROVIDER=http://demo-l1-network:${ESPRESSO_SEQUENCER_L1_PORT}
ESPRESSO_NODE_VALIDATOR_PORT=9000

# Only allow 1 block to be processed for events at a time, simulating a very bad L1 provider.
ESPRESSO_SEQUENCER_L1_EVENTS_MAX_BLOCK_RANGE=1
ESPRESSO_SEQUENCER_ETH_MNEMONIC="test test test test test test test test test test test junk"
Expand Down
1 change: 1 addition & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ extend-exclude = [
"doc/*.svg",
"contracts/lib",
"contract-bindings",
"node-metrics/src/api/node_validator/v0/example_prometheus_metrics_output.txt",
]
50 changes: 50 additions & 0 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"contracts/rust/diff-test",
"contracts/rust/gen-vk-contract",
"hotshot-state-prover",
"node-metrics",
"sequencer",
"types",
"utils",
Expand All @@ -30,16 +31,18 @@ ark-ff = "0.4"
ark-poly = "0.4"
ark-serialize = "0.4"
ark-srs = "0.3.1"
async-compatibility-layer = { version = "1.1", default-features = false, features = [
"logging-utils",
async-compatibility-layer = { version = "1.2.1", default-features = false, features = [
"logging-utils",
] }
async-once-cell = "0.5"
async-std = { version = "1.12.0", features = ["attributes", "tokio1"] }
async-trait = "0.1"
base64 = "0.22"
base64-bytes = "0.1"
bincode = "1.3.3"
bitvec = "1.0.1"
blake3 = "1.5"
circular-buffer = "0.1.7"
clap = { version = "4.4", features = ["derive", "env", "string"] }
cld = "0.5"
derive_more = "0.99.17"
Expand Down Expand Up @@ -133,3 +136,4 @@ paste = "1.0"
rand = "0.8.5"
time = "0.3"
trait-set = "0.3.0"

1 change: 1 addition & 0 deletions builder/src/bin/permissioned-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ async fn main() -> anyhow::Result<()> {
private_staking_key: private_staking_key.clone(),
private_state_key,
state_peers: opt.state_peers,
public_api_url: None,
config_peers: None,
catchup_backoff: Default::default(),
};
Expand Down
51 changes: 51 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ services:
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_0
- ESPRESSO_SEQUENCER_IS_DA=true
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer0
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000000
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Linux 5.15.153.1
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=US
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=40.7128
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=-74.0060
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer0:$ESPRESSO_SEQUENCER_API_PORT/
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
Expand Down Expand Up @@ -282,6 +292,16 @@ services:
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer1:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_1
- ESPRESSO_SEQUENCER_IS_DA=true
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer1
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000001
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Darwin 23.5.0
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=GR
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=39.0742
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=21.8243
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer1:$ESPRESSO_SEQUENCER_API_PORT/
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
Expand Down Expand Up @@ -324,6 +344,16 @@ services:
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_2
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer2:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_2
- ESPRESSO_SEQUENCER_IS_DA=true
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer2
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000002
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Darwin 23.5.0
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=CN
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=35.8617
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=104.1954
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer2:$ESPRESSO_SEQUENCER_API_PORT/
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
Expand Down Expand Up @@ -362,6 +392,17 @@ services:
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_3
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_3
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer3:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_3
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer3
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000003
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=Microsoft Windows NT 10.0.22621.0
- [email protected]
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=CN
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=35.8617
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=104.1954
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer3:$ESPRESSO_SEQUENCER_API_PORT/
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
Expand Down Expand Up @@ -400,6 +441,16 @@ services:
- ESPRESSO_SEQUENCER_PRIVATE_STATE_KEY=$ESPRESSO_DEMO_SEQUENCER_STATE_PRIVATE_KEY_4
- ESPRESSO_SEQUENCER_LIBP2P_BIND_ADDRESS=0.0.0.0:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_4
- ESPRESSO_SEQUENCER_LIBP2P_ADVERTISE_ADDRESS=sequencer4:$ESPRESSO_DEMO_SEQUENCER_LIBP2P_PORT_4
- ESPRESSO_SEQUENCER_IDENTITY_NODE_NAME=sequencer4
- ESPRESSO_SEQUENCER_IDENTITY_WALLET_ADDRESS=0x0000000000000000000000000000000000000004
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_NAME=Espresso Systems
- ESPRESSO_SEQUENCER_IDENTITY_COMPANY_WEBSITE=https://www.espressosys.com/
- ESPRESSO_SEQUENCER_IDENTITY_OPERATING_SYSTEM=TempleOS 5.03
- ESPRESSO_SEQUENCER_IDENTITY_NETWORK_TYPE=local
- ESPRESSO_SEQUENCER_IDENTITY_COUNTRY_CODE=AU
- ESPRESSO_SEQUENCER_IDENTITY_LATITUDE=-25.2744
- ESPRESSO_SEQUENCER_IDENTITY_LONGITUDE=133.7751
- ESPRESSO_SEQUENCER_PUBLIC_API_URL=http://sequencer4:$ESPRESSO_SEQUENCER_API_PORT/
- RUST_LOG
- RUST_LOG_FORMAT
- ASYNC_STD_THREAD_COUNT
Expand Down
39 changes: 39 additions & 0 deletions node-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[package]
name = "node-metrics"
description = "A Library for collecting, recording and distributing information about the Espresso Block Chain Network"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }

[features]
testing = ["serde_json", "espresso-types/testing"]

[dependencies]
async-compatibility-layer = { workspace = true }
async-std = { workspace = true }
async-trait = { workspace = true }
bincode = { workspace = true }
bitvec = { workspace = true }
circular-buffer = { workspace = true }
clap = { workspace = true }
espresso-types = { path = "../types" }
futures = { workspace = true }
hotshot = { workspace = true }
hotshot-query-service = { workspace = true }
hotshot-stake-table = { workspace = true }
hotshot-types = { workspace = true }
prometheus-parse = { version = "^0.2.5" }
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { version = "^1.0.113", optional = true }
surf-disco = { workspace = true }
tagged-base64 = { workspace = true }
tide-disco = { version = "0.9.0" }
time = { workspace = true }
toml = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }
vbs = { workspace = true }

# Dependencies for feature `testing`
hotshot-testing = { workspace = true, optional = true }
1 change: 1 addition & 0 deletions node-metrics/src/api/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod node_validator;
1 change: 1 addition & 0 deletions node-metrics/src/api/node_validator/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v0;
Loading
Loading