heartbeat block#10
Conversation
There was a problem hiding this comment.
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_secondsconfiguration 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.
There was a problem hiding this comment.
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.
f04e922 to
4083cee
Compare
4083cee to
c9451c8
Compare
There was a problem hiding this comment.
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.
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 thelastStoredBlock, if this was long time ago the resync can take a long time.With the heartbeat block it will reduce the resync time.