From 94435e0a6f86520a91e81601e7c7c96aae0fa1a8 Mon Sep 17 00:00:00 2001 From: Martin Schere Date: Thu, 19 Dec 2024 13:16:34 +0100 Subject: [PATCH] chore: mithril --- .github/image/entrypoint.sh | 13 +------------ k8s/sf-set.yaml | 8 ++++---- src/bin/dolos/bootstrap/mithril.rs | 9 +++++++++ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/image/entrypoint.sh b/.github/image/entrypoint.sh index 5a7b219b..eebbf0b5 100644 --- a/.github/image/entrypoint.sh +++ b/.github/image/entrypoint.sh @@ -2,17 +2,6 @@ echo "Starting dolos bootstrap from snapshot" -# Run the bootstrap command and capture the output -BOOTSTRAP_OUTPUT=$(dolos bootstrap snapshot --variant full --config /etc/dolos.toml) +dolos bootstrap mithril --variant full --config /etc/dolos.toml -# Check if the output indicates existing data -if echo "$BOOTSTRAP_OUTPUT" | grep -q "found existing data, skipping bootstrap"; then - echo "Bootstrap skipped due to existing data, skipping ledger removal and rebuild" -else - echo "Removing ledger and rebuilding" - rm -rf /var/data/ledger - dolos doctor rebuild-ledger --config /etc/dolos.toml -fi - -# Start the dolos daemon dolos daemon --config /etc/dolos.toml diff --git a/k8s/sf-set.yaml b/k8s/sf-set.yaml index ec56729c..c9295e65 100644 --- a/k8s/sf-set.yaml +++ b/k8s/sf-set.yaml @@ -4,7 +4,7 @@ metadata: namespace: dolos name: dolos-app spec: - replicas: 0 + replicas: 1 selector: matchLabels: app: dolos-app @@ -24,7 +24,7 @@ spec: cloud.google.com/machine-family: "c3" containers: - name: dolos-container - image: us-central1-docker.pkg.dev/comet-7aaf0/comet-ar/dolos:sha-2fac637 + image: us-central1-docker.pkg.dev/comet-7aaf0/comet-ar/dolos:sha-12bbd74 tty: true stdin: true ports: @@ -37,10 +37,10 @@ spec: resources: requests: - memory: "1.5Gi" + memory: "2.5Gi" cpu: "1" limits: - memory: "1.5Gi" + memory: "3Gi" cpu: "1" volumeClaimTemplates: diff --git a/src/bin/dolos/bootstrap/mithril.rs b/src/bin/dolos/bootstrap/mithril.rs index 00da4a30..176fcb73 100644 --- a/src/bin/dolos/bootstrap/mithril.rs +++ b/src/bin/dolos/bootstrap/mithril.rs @@ -59,18 +59,25 @@ impl mithril_client::feedback::FeedbackReceiver for MithrilFeedback { size, .. } => { + debug!( + downloaded_bytes = downloaded_bytes, + size = size, + "downloading snapshot" + ); self.download_pb.set_length(size); self.download_pb.set_position(downloaded_bytes); self.download_pb.set_message("downloading Mithril snapshot"); } mithril_client::feedback::MithrilEvent::SnapshotDownloadCompleted { .. } => { self.download_pb.set_message("snapshot download completed"); + debug!("snapshot download completed"); } mithril_client::feedback::MithrilEvent::CertificateChainValidationStarted { .. } => { self.validate_pb .set_message("certificate chain validation started"); + debug!("certificate chain validation started"); } mithril_client::feedback::MithrilEvent::CertificateValidated { certificate_hash: hash, @@ -78,6 +85,8 @@ impl mithril_client::feedback::FeedbackReceiver for MithrilFeedback { } => { self.validate_pb .set_message(format!("validating cert: {hash}")); + + debug!("certificate validated: {hash}"); } mithril_client::feedback::MithrilEvent::CertificateChainValidated { .. } => { self.validate_pb.set_message("certificate chain validated");