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

feat: Constraints API v0 #49

Merged
merged 34 commits into from
Nov 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
22a13a8
feat: constraints-api-v0
thedevbirb Nov 6, 2024
f2f2fcf
docs(constraints-api): fix broken links
thedevbirb Nov 7, 2024
dc2919d
fix(constraints-api-v0): drop validator_delegations migration, curren…
thedevbirb Nov 8, 2024
40cda8e
feat(constraints-api): add startup configuration
thedevbirb Nov 8, 2024
38c8e8f
Merge pull request #22 from chainbound/lore/feat/constraints-api-config
merklefruit Nov 8, 2024
ffc5e5e
introduce max_block_value_to_verify in constraints config
gd-0 Nov 11, 2024
61d611f
address PR comments + other fixes
gd-0 Nov 11, 2024
b531d46
feat: import website from aestus upstream, solve conflicts
merklefruit Nov 11, 2024
b66e136
chore: re-added cargo.lock
merklefruit Nov 11, 2024
9d7e97f
chore: run fmt clippy checks
merklefruit Nov 11, 2024
f995522
chore: default run on unspecified ip
merklefruit Nov 11, 2024
30c5cb5
chore: rm aestus naming and links from web page
merklefruit Nov 11, 2024
8ba703c
chore: gattaca logo
merklefruit Nov 11, 2024
25d777e
chore: reverted changes to dockerfile + tls dependencies
merklefruit Nov 11, 2024
c864a9e
chore: addressed review
merklefruit Nov 11, 2024
9ee178a
chore: logo size
merklefruit Nov 11, 2024
ea15474
fix(tests): make them compile
thedevbirb Nov 12, 2024
ae59749
chore(api): should verify proofs logic
thedevbirb Nov 12, 2024
00b5bcb
Merge pull request #23 from gd-0/dont-enforce-constraints-if-block-va…
thedevbirb Nov 12, 2024
9003727
chore(website): fmt
thedevbirb Nov 12, 2024
0aee3e8
Merge pull request #25 from chainbound/feat/import-website
thedevbirb Nov 12, 2024
30c66ac
fix(db): retry creating pool handle
merklefruit Nov 12, 2024
7a0342f
fix(db): don't panic upon failing migrations once
merklefruit Nov 12, 2024
44b1823
fix(website): rm blob related fields from table
merklefruit Nov 12, 2024
f778527
Merge pull request #26 from chainbound/fix/retry-db-pool
thedevbirb Nov 12, 2024
b78427d
fix(ssz): restore SSZ backwards compatibility on SignedBuilderSubmiss…
thedevbirb Nov 15, 2024
cdb2795
Merge pull request #27 from chainbound/lore/fix/ssz
merklefruit Nov 18, 2024
ca4d329
fix(ssz): order of enum variants is important
thedevbirb Nov 26, 2024
dd97cb2
refactor(api/builder): submit_block(_with_proofs) now have the same impl
thedevbirb Nov 15, 2024
bd2b542
Merge pull request #28 from chainbound/lore/refactor/constraints-api
thedevbirb Nov 27, 2024
f81a92e
fix(constraints-api): don't read from db for checking proposer duties…
thedevbirb Nov 27, 2024
242607c
Merge pull request #30 from chainbound/lore/fix/db-read-constraints-api
thedevbirb Nov 28, 2024
5848eec
fix(constraints-api): review constraints saving logic
thedevbirb Nov 27, 2024
abf32f5
Merge pull request #29 from chainbound/lore/fix/submit-constraints-logic
thedevbirb Nov 28, 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
Prev Previous commit
Next Next commit
chore: addressed review
  • Loading branch information
merklefruit committed Nov 11, 2024
commit c864a9e1af7817a580369f8cae360a23a6837026
121 changes: 10 additions & 111 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -58,7 +58,6 @@ deadpool-redis = { version = "0.12.0", features = ["rt_tokio_1"] }
redis = { version = "0.23.2", features = ["aio", "tokio-comp"] }
tokio-postgres = "0.7.10"
deadpool-postgres = "0.11.0"
tokio-postgres-rustls = "0.12.0"
refinery = { version = "0.8", features = ["tokio-postgres"] }
bytes = "1.5.0"
chrono = "0.4.19"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -57,4 +57,4 @@ WORKDIR /app
COPY --from=helix /app/helix-cmd* ./

# set the startup command to run your binary
ENTRYPOINT ["/app/helix-cmd"]
ENTRYPOINT ["/app/helix-cmd"]
2 changes: 1 addition & 1 deletion crates/cmd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@ helix-utils.workspace = true
tikv-jemallocator = { version = "0.5", features = ["profiling"] }

tokio.workspace = true
futures.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-appender.workspace = true

num_cpus = "1.16.0"
futures = "0.3.28"
36 changes: 9 additions & 27 deletions crates/cmd/src/main.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ use helix_api::service::ApiService;
use helix_common::{LoggingConfig, RelayConfig};
use helix_utils::set_panic_hook;
use tokio::runtime::Builder;

use tracing_appender::rolling::Rotation;

use tikv_jemallocator::Jemalloc;
@@ -61,43 +60,26 @@ async fn run() {

let mut handles = Vec::new();

if !config.router_config.enabled_routes.is_empty() {
let api_config = config.clone();
let api_handle = tokio::spawn(async move {
tracing::info!("Starting API service...");
ApiService::run(api_config).await;
});
handles.push(api_handle);
} else {
tracing::warn!("No relay API routes are enabled.");
}
// Start the API service
handles.push(tokio::spawn(ApiService::run(config.clone())));

// Start the website service (if enabled)
if config.website.enabled {
let website_config = config.clone();
let website_handle = tokio::spawn(async move {
handles.push(tokio::spawn(async move {
loop {
tracing::info!("Starting website service...");
match WebsiteService::run(website_config.clone()).await {
match WebsiteService::run(config.clone()).await {
Ok(_) => {
tracing::error!("Website service unexpectedly completed. Restarting...");
}
Err(e) => {
tracing::error!("Website server error: {}. Restarting...", e);
tracing::error!("Website service unexpectedly completed. Restarting...")
}
Err(e) => tracing::error!("Website server error: {}. Restarting...", e),
}
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
}
});
handles.push(website_handle);
}));
}

if !handles.is_empty() {
// Await all tasks to prevent the runtime from shutting down
futures::future::join_all(handles).await;
} else {
tracing::error!("No services are enabled.");
std::process::exit(1);
}
futures::future::join_all(handles).await;
}

fn main() {
1 change: 0 additions & 1 deletion crates/database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -40,4 +40,3 @@ rand = "0.8"
dashmap.workspace = true
thiserror.workspace = true
tracing.workspace = true
tokio-postgres-rustls.workspace = true
12 changes: 4 additions & 8 deletions crates/website/src/website_service.rs
Original file line number Diff line number Diff line change
@@ -40,12 +40,8 @@ impl WebsiteService {
NetworkConfig::Sepolia => ChainInfo::for_sepolia(),
NetworkConfig::Holesky => ChainInfo::for_holesky(),
NetworkConfig::Custom { ref dir_path, ref genesis_validator_root, genesis_time } => {
ChainInfo::for_custom(
dir_path.clone(),
*genesis_validator_root,
genesis_time,
)
.expect("Failed to load custom chain info")
ChainInfo::for_custom(dir_path.clone(), *genesis_validator_root, genesis_time)
.expect("Failed to load custom chain info")
}
});

@@ -104,10 +100,10 @@ impl WebsiteService {
let addr: String =
format!("{}:{}", config.website.listen_address, config.website.port).parse()?;
let addr: SocketAddr = addr.parse().expect("Invalid listen address");
let listener = TcpListener::bind(&addr).await.unwrap();
let listener = TcpListener::bind(&addr).await?;
info!("Website listening on {}", addr);

axum::serve(listener, app).await.unwrap();
axum::serve(listener, app).await?;

Ok(())
}