Compare commits

..

1 Commits

8 changed files with 87 additions and 322 deletions

View File

@@ -1,106 +0,0 @@
[stages.era]
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
max_duration = "10m"
[stages.prune]
commit_threshold = 1000000
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
incremental_threshold = 7000
rebuild_threshold = 7000
[stages.transaction_lookup]
chunk_size = 500000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[stages.etl]
file_size = 524288000
[prune]
block_interval = 5
[prune.segments.merkle_changesets]
distance = 10064
[peers]
refill_slots_interval = "5s"
trusted_nodes = []
trusted_nodes_only = false
trusted_nodes_resolution_interval = "1h"
max_backoff_count = 5
ban_duration = "12h"
incoming_ip_throttle_duration = "30s"
[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 15
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024
[peers.backoff_durations]
low = "30s"
medium = "3m"
high = "15m"
max = "1h"
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
[sessions.pending_session_timeout]
secs = 20
nanos = 0

View File

@@ -1,106 +0,0 @@
[stages.era]
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
max_duration = "10m"
[stages.prune]
commit_threshold = 1000000
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
incremental_threshold = 7000
rebuild_threshold = 7000
[stages.transaction_lookup]
chunk_size = 500000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[stages.etl]
file_size = 524288000
[prune]
block_interval = 5
[prune.segments.merkle_changesets]
distance = 10064
[peers]
refill_slots_interval = "5s"
trusted_nodes = []
trusted_nodes_only = false
trusted_nodes_resolution_interval = "1h"
max_backoff_count = 5
ban_duration = "12h"
incoming_ip_throttle_duration = "30s"
[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 15
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024
[peers.backoff_durations]
low = "30s"
medium = "3m"
high = "15m"
max = "1h"
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
[sessions.pending_session_timeout]
secs = 20
nanos = 0

View File

@@ -1,106 +0,0 @@
[stages.era]
[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000
[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100
[stages.sender_recovery]
commit_threshold = 5000000
[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
max_duration = "10m"
[stages.prune]
commit_threshold = 1000000
[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000
[stages.merkle]
incremental_threshold = 7000
rebuild_threshold = 7000
[stages.transaction_lookup]
chunk_size = 500000
[stages.index_account_history]
commit_threshold = 100000
[stages.index_storage_history]
commit_threshold = 100000
[stages.etl]
file_size = 524288000
[prune]
block_interval = 5
[prune.segments.merkle_changesets]
distance = 10064
[peers]
refill_slots_interval = "5s"
trusted_nodes = []
trusted_nodes_only = false
trusted_nodes_resolution_interval = "1h"
max_backoff_count = 5
ban_duration = "12h"
incoming_ip_throttle_duration = "30s"
[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 15
[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024
[peers.backoff_durations]
low = "30s"
medium = "3m"
high = "15m"
max = "1h"
[sessions]
session_command_buffer = 32
session_event_buffer = 260
[sessions.limits]
[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0
[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0
[sessions.pending_session_timeout]
secs = 20
nanos = 0

View File

@@ -36,7 +36,7 @@ commit_threshold = 100000
[stages.merkle] [stages.merkle]
incremental_threshold = 7000 incremental_threshold = 7000
rebuild_threshold = 7000 rebuild_threshold = 100000
[stages.transaction_lookup] [stages.transaction_lookup]
chunk_size = 500000 chunk_size = 500000

View File

@@ -36,7 +36,7 @@ commit_threshold = 100000
[stages.merkle] [stages.merkle]
incremental_threshold = 7000 incremental_threshold = 7000
rebuild_threshold = 7000 rebuild_threshold = 100000
[stages.transaction_lookup] [stages.transaction_lookup]
chunk_size = 5000000 chunk_size = 5000000

View File

@@ -36,7 +36,7 @@ commit_threshold = 100000
[stages.merkle] [stages.merkle]
incremental_threshold = 7000 incremental_threshold = 7000
rebuild_threshold = 7000 rebuild_threshold = 100000
[stages.transaction_lookup] [stages.transaction_lookup]
chunk_size = 5000000 chunk_size = 5000000

View File

@@ -36,7 +36,7 @@ commit_threshold = 100000
[stages.merkle] [stages.merkle]
incremental_threshold = 7000 incremental_threshold = 7000
rebuild_threshold = 7000 rebuild_threshold = 100000
[stages.transaction_lookup] [stages.transaction_lookup]
chunk_size = 5000000 chunk_size = 5000000

83
purge-backup-trash.sh Executable file
View File

@@ -0,0 +1,83 @@
#!/bin/bash
# Purge files from the backup trash directory.
#
# Usage:
# ./purge-backup-trash.sh [--dry-run]
#
# Environment:
# TRASH_DIR=/backup/trash Directory containing trash files to purge
# DRY_RUN=false If true, only report what would be deleted
set -euo pipefail
BASEPATH="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=volume-utils.sh
source "$BASEPATH/volume-utils.sh"
TRASH_DIR="${TRASH_DIR:-/backup/trash}"
DRY_RUN=false
if [[ "${1:-}" == "--dry-run" ]]; then
DRY_RUN=true
elif [[ -n "${1:-}" ]]; then
echo "Usage: $0 [--dry-run]" >&2
exit 1
fi
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2
}
# Main purge function
purge_trash() {
local total_bytes=0
local file_count=0
local delete_list=()
if [[ ! -d "$TRASH_DIR" ]]; then
log "Trash directory does not exist: $TRASH_DIR"
echo "0 0"
return
fi
# Find all files in the trash directory and build delete list with FULL paths
while IFS= read -r -d '' file; do
# Use full path, not just basename, to avoid stat() looking in wrong directory
delete_list+=("$file")
done < <(find "$TRASH_DIR" -maxdepth 1 -type f -print0 2>/dev/null)
# Process each file with full path
for file in "${delete_list[@]}"; do
if [[ ! -f "$file" ]]; then
continue
fi
local size
size=$(stat -c%s "$file" 2>/dev/null || echo 0)
total_bytes=$((total_bytes + size))
file_count=$((file_count + 1))
if $DRY_RUN; then
log "DRY-RUN would purge: $file (${size} bytes)"
else
rm -f -- "$file"
log "Purged: $file (${size} bytes)"
fi
done
echo "$file_count $total_bytes"
}
main() {
log "Starting trash purge from $TRASH_DIR (dry_run=$DRY_RUN)"
local count bytes
read -r count bytes < <(purge_trash)
local bytes_human
bytes_human=$(numfmt --to=iec-i --suffix=B "$bytes" 2>/dev/null || echo "${bytes}B")
log "Trash purge complete: deleted=$count files, freed≈$bytes_human"
}
main "$@"