Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bproxy:
node_healthchecker:
git_reference: v0.1.11
op_rbuilder:
git_reference: op-rbuilder/v0.4.6
git_reference: op-rbuilder/v0.4.10
rust:
version: 1.94.0
tdx_quote_provider:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Install]
WantedBy=default.target
WantedBy=minimal.target

[Unit]
Description=L2 builder proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ template {

command = ["/bin/sh", "-c",
<<-EOT
printf '{"@level":"info","@message":"rendered template","@destination":"/etc/systemd/system/bproxy.service","@content":"%s"}\n' "$( cat /etc/systemd/system/bproxy.service | base64 -w 0 )"
cat /etc/systemd/system/bproxy.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target bproxy.service
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Install]
WantedBy=minimal.target

[Unit]
Description=Blockchain node healthchecker
After=network.target
Wants=network.target

[Service]
Type=simple
SyslogIdentifier=node-healthchecker
User=op-rbuilder
Group=optimism

Restart=always
RestartSec=5
TimeoutStopSec=60

((- $cordon := ( secret "[[ gcp.Meta "attributes/vault_kv_path" ]]/node/_cordon/[[ gcp.Meta "name" ]]" ).Data.data ))
((- $cordon_after := "0" ))(( if $cordon.after ))(( $cordon_after = $cordon.after ))(( end ))
((- $cordon_before := "0" ))(( if $cordon.before ))(( $cordon_before = $cordon.before ))(( end ))
((- $status := "200" ))(( if ( and ( ge (timestamp "unix") $cordon_after ) ( le (timestamp "unix") $cordon_before ) ) ))(( $status = "503" ))(( end ))

ExecStart=/usr/bin/node-healthchecker serve \
--healthcheck-block-age-threshold 10s \
--healthcheck-timeout 500ms \
--healthcheck-reth-base-url http://127.0.0.1:18645 \
--healthcheck-unconditional-fail-duration 1m \
--http-status-ok (( $status )) \
--http-status-warning (( $status )) \
--server-listen-address 0.0.0.0:8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
template {
left_delimiter = "(("
right_delimiter = "))"

source = "/etc/vault-agent/node-healthchecker.service.ctmpl"
destination = "/etc/systemd/system/node-healthchecker.service"

user = "root"
group = "root"
perms = "0644"

exec {
timeout = "60s"

command = ["/bin/sh", "-c",
<<-EOT
cat /etc/systemd/system/node-healthchecker.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target node-healthchecker.service
systemctl restart node-healthchecker.service
EOT
]
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# op-rbuilder

[Install]
WantedBy=default.target
WantedBy=minimal.target

[Unit]
Description=op-rbuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ template {

command = ["/bin/sh", "-c",
<<-EOT
printf '{"@level":"info","@message":"rendered template","@destination":"/etc/systemd/system/op-rbuilder.service","@content":"%s"}\n' "$( cat /etc/systemd/system/op-rbuilder.service | base64 -w 0 )"
cat /etc/systemd/system/op-rbuilder.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target op-rbuilder.service
Expand Down
1 change: 0 additions & 1 deletion modules/l2/op-rbuilder-bproxy/mkosi.postinst.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euxo pipefail
# Enable systemd services

systemctl add-wants minimal.target \
node-healthchecker.service \
tdx-quote-provider.service

# Create users and groups
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
node_healthchecker:
git_reference: v0.1.11
op_rbuilder:
git_reference: op-rbuilder/v0.4.6
git_reference: op-rbuilder/v0.4.9
rproxy:
git_reference: v0.0.11
git_reference: v0.0.12
rust:
version: 1.94.0
tdx_quote_provider:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Install]
WantedBy=minimal.target

[Unit]
Description=Blockchain node healthchecker
After=network.target
Wants=network.target

[Service]
Type=simple
SyslogIdentifier=node-healthchecker
User=op-rbuilder
Group=optimism

Restart=always
RestartSec=5
TimeoutStopSec=60

((- $cordon := ( secret "[[ gcp.Meta "attributes/vault_kv_path" ]]/node/_cordon/[[ gcp.Meta "name" ]]" ).Data.data ))
((- $cordon_after := "0" ))(( if $cordon.after ))(( $cordon_after = $cordon.after ))(( end ))
((- $cordon_before := "0" ))(( if $cordon.before ))(( $cordon_before = $cordon.before ))(( end ))
((- $status := "200" ))(( if ( and ( ge (timestamp "unix") $cordon_after ) ( le (timestamp "unix") $cordon_before ) ) ))(( $status = "503" ))(( end ))

ExecStart=/usr/bin/node-healthchecker serve \
--healthcheck-block-age-threshold 10s \
--healthcheck-timeout 500ms \
--healthcheck-reth-base-url http://127.0.0.1:18645 \
--healthcheck-unconditional-fail-duration 1m \
--http-status-ok (( $status )) \
--http-status-warning (( $status )) \
--server-listen-address 0.0.0.0:8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
template {
left_delimiter = "(("
right_delimiter = "))"

source = "/etc/vault-agent/node-healthchecker.service.ctmpl"
destination = "/etc/systemd/system/node-healthchecker.service"

user = "root"
group = "root"
perms = "0644"

exec {
timeout = "60s"

command = ["/bin/sh", "-c",
<<-EOT
cat /etc/systemd/system/node-healthchecker.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target node-healthchecker.service
systemctl restart node-healthchecker.service
EOT
]
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# op-rbuilder

[Install]
WantedBy=default.target
WantedBy=minimal.target

[Unit]
Description=op-rbuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ template {

command = ["/bin/sh", "-c",
<<-EOT
printf '{"@level":"info","@message":"rendered template","@destination":"/etc/systemd/system/op-rbuilder.service","@content":"%s"}\n' "$( cat /etc/systemd/system/op-rbuilder.service | base64 -w 0 )"
cat /etc/systemd/system/op-rbuilder.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target op-rbuilder.service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Install]
WantedBy=default.target
WantedBy=minimal.target

[Unit]
Description=L2 builder proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ template {

command = ["/bin/sh", "-c",
<<-EOT
printf '{"@level":"info","@message":"rendered template","@destination":"/etc/systemd/system/rproxy.service","@content":"%s"}\n' "$( cat /etc/systemd/system/rproxy.service | base64 -w 0 )"
cat /etc/systemd/system/rproxy.service | base64 -w 2048

systemctl daemon-reload
systemctl add-wants minimal.target rproxy.service
Expand Down
1 change: 0 additions & 1 deletion modules/l2/op-rbuilder/mkosi.postinst.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set -euxo pipefail
# Enable systemd services

systemctl add-wants minimal.target \
node-healthchecker.service \
tdx-quote-provider.service

# Create users and groups
Expand Down