Skip to content

Commit

Permalink
feat: improve scraper startup error handling (#5191)
Browse files Browse the repository at this point in the history
### Description

- handle errors and sets set chain metrics if scraper fails for chain
during startup

### Drive-by changes
 - implement Clone for `ScraperDb`
- this is because DbConn doesn't implement Clone when `mock` feature is
enabled

### Related issues
Fixes https://github.com/hyperlane-xyz/issues/issues/1408

### Backward compatibility

Yes

### Testing

Added unittest to test function. But don't have tests in place for
testing the logic in `Scraper::run()`
  • Loading branch information
kamiyaa authored Jan 21, 2025
1 parent 62702d3 commit 0372ff9
Show file tree
Hide file tree
Showing 6 changed files with 344 additions and 77 deletions.
4 changes: 4 additions & 0 deletions rust/main/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions rust/main/agents/scraper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ hyperlane-core = { path = "../../hyperlane-core", features = ["agent"] }
migration = { path = "migration" }

[dev-dependencies]
reqwest.workspace = true
sea-orm = { workspace = true, features = ["mock"]}
tokio-test = "0.4"
tracing-test.workspace = true
ethers-prometheus = { path = "../../ethers-prometheus", features = ["serde"] }
hyperlane-ethereum = { path = "../../chains/hyperlane-ethereum" }
hyperlane-test = { path = "../../hyperlane-test" }

[features]
Expand Down
Loading

0 comments on commit 0372ff9

Please sign in to comment.