Skip to content

Commit 62596f4

Browse files
committed
Fix genesis
1 parent bd6d0d7 commit 62596f4

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

app/services/eth_block_importer.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,17 @@ def validation_stalled?
434434
return false unless ENV.fetch('VALIDATION_ENABLED').casecmp?('true')
435435

436436
current_position = current_max_eth_block_number
437+
438+
# Only check every 5 blocks to reduce DB queries
439+
return false unless current_position % 5 == 0
440+
441+
genesis_block = SysConfig.l1_genesis_block_number
437442
hard_limit = ENV.fetch('VALIDATION_LAG_HARD_LIMIT', 30).to_i
438443

439444
# Check for validation gaps in recent blocks
440-
# This covers BOTH sequential lag and scattered gaps
441-
check_range_start = [current_position - hard_limit + 1, 1].max # Last N blocks
445+
# Start from the later of: genesis+1 or (current - limit + 1)
446+
# This ensures we never try to validate genesis itself or before it
447+
check_range_start = [current_position - hard_limit + 1, genesis_block + 1].max
442448
check_range_end = current_position
443449

444450
# Count ALL missing validations in critical range (includes both gaps and lag)

config/recurring.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ development:
1414
command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)"
1515
schedule: every hour at minute 12
1616

17+
production:
18+
clear_solid_queue_finished_jobs:
19+
command: "SolidQueue::Job.clear_finished_in_batches(sleep_between_batches: 0.3)"
20+
schedule: every hour at minute 12
21+
1722
# development:
1823
# validation_gap_detection:
1924
# class: GapDetectionJob

docker-compose/docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ services:
3434
STORAGE_VERIFICATION_THREADS: ${STORAGE_VERIFICATION_THREADS:-10}
3535
PROFILE_IMPORT: ${PROFILE_IMPORT:-true}
3636
ETHSCRIPTIONS_API_BASE_URL: ${ETHSCRIPTIONS_API_BASE_URL-''}
37+
# Transient validation error handling configuration
38+
VALIDATION_TRANSIENT_RETRIES: ${VALIDATION_TRANSIENT_RETRIES:-3}
39+
VALIDATION_RETRY_WAIT_SECONDS: ${VALIDATION_RETRY_WAIT_SECONDS:-2}
40+
ETHSCRIPTIONS_API_RETRIES: ${ETHSCRIPTIONS_API_RETRIES:-3}
41+
# Validation lag control
42+
VALIDATION_LAG_HARD_LIMIT: ${VALIDATION_LAG_HARD_LIMIT:-30}
43+
ETHSCRIPTIONS_API_KEY: ${ETHSCRIPTIONS_API_KEY:-}
3744
DEBUG: 0
3845
volumes:
3946
- node-storage:/rails/storage

lib/storage_reader.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def get_ethscription_content(tx_hash, block_tag: 'latest')
210210
rescue => e
211211
Rails.logger.error "Failed to get ethscription content #{tx_hash}: #{e.message}"
212212
Rails.logger.error e.backtrace.join("\n") if Rails.env.development?
213-
binding.irb if ENV['DEBUG'] == '1'
214213
raise e
215214
end
216215

spec/support/ethscriptions_test_helper.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,6 @@ def import_l1_block_with_geth(l1_transactions)
515515
)
516516
ethscription_transactions.each { |tx| tx.ethscriptions_block = template_ethscriptions_block }
517517

518-
# Mock the L1 client but keep L2 client real
519-
mock_ethereum_client = instance_double(EthRpcClient)
520-
521518
mock_ethereum_client = instance_double(EthRpcClient,
522519
get_block_number: block_number,
523520
get_block: block_data,

0 commit comments

Comments
 (0)