Skip to content

heartbeat block#10

Merged
rube-de merged 8 commits into
masterfrom
rube/heartbeat-block
Jan 7, 2026
Merged

heartbeat block#10
rube-de merged 8 commits into
masterfrom
rube/heartbeat-block

Conversation

@rube-de

@rube-de rube-de commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator

This will relay a block and block hash periodically.
As there is on the contract a field lastStoredBlock, if the header oracle gets restarted it will resync blocks from the lastStoredBlock, if this was long time ago the resync can take a long time.
With the heartbeat block it will reduce the resync time.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a "heartbeat block" mechanism for the header oracle to reduce resync time after restarts. The feature periodically submits block headers even when no watched address interactions are detected, ensuring the lastStoredBlock on the contract stays reasonably current.

Key changes include:

  • Added heartbeat_interval_seconds configuration parameter (default: 3600s/1 hour, max: 86400s/24 hours)
  • Modified watcher mode to submit single blocks as heartbeats when the interval elapses and no activity is found
  • Added comprehensive test coverage for heartbeat functionality
  • Updated deployment configurations for mainnet and added development configuration file

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
rofl_oracle/config.py Added heartbeat_interval_seconds field to WatcherModeConfig with validation (0-86400 seconds), environment variable loading, and logging
rofl_oracle/header_oracle.py Implemented heartbeat tracking (last_heartbeat_time), heartbeat submission logic when no interactions found, and timer resets on successful submissions
tests/test_config.py Added tests for heartbeat interval validation, default values, and boundary conditions
tests/test_watcher_mode.py Added comprehensive heartbeat tests covering various scenarios (first run, due/not due, with/without activity) and updated existing tests to initialize last_heartbeat_time
rofl.yaml Updated deployment configuration for mainnet (resources, secrets, network, app_id, trust root, enclaves, machine configuration)
rofl-dev.yaml Added new development deployment configuration file with testnet settings
compose.yaml Changed image repository reference and removed default values for environment variables (now requires explicit configuration)
contracts/tasks/deploy-rofl-adapter.ts Updated default values for mainnet deployment (rofl app ID and source chain ID)
contracts/hardhat.config.ts Added Base network configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rofl_oracle/header_oracle.py
Comment thread compose.yaml
Comment thread rofl_oracle/header_oracle.py Outdated
Comment thread rofl_oracle/header_oracle.py
Comment thread tests/test_watcher_mode.py
Comment thread rofl_oracle/header_oracle.py
Comment thread rofl_oracle/header_oracle.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rofl_oracle/header_oracle.py
@rube-de
rube-de marked this pull request as ready for review January 6, 2026 15:53
@rube-de
rube-de force-pushed the rube/heartbeat-block branch from f04e922 to 4083cee Compare January 6, 2026 16:13
@rube-de
rube-de requested a review from Copilot January 6, 2026 16:13
@rube-de
rube-de force-pushed the rube/heartbeat-block branch from 4083cee to c9451c8 Compare January 6, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rofl-dev.yaml
Comment thread compose.yaml
Comment thread rofl_oracle/header_oracle.py
Comment thread contracts/hardhat.config.ts
Comment thread rofl.yaml
Comment thread rofl_oracle/header_oracle.py
Comment thread contracts/tasks/deploy-rofl-adapter.ts
@rube-de
rube-de merged commit 759fac9 into master Jan 7, 2026
4 checks passed
@rube-de
rube-de deleted the rube/heartbeat-block branch January 7, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants