Randomness monitor service#584
Conversation
apps/randomness-monitor/src/index.ts
Outdated
| blockNumber: blockNumber, | ||
| }) | ||
| console.log(random) | ||
| result = new Monitoring(blockNumber, block.timestamp, MonitoringResult.Success) |
There was a problem hiding this comment.
i think we should also save the randomness value itself? since we are fetching it here, it may be useful in future analysis.
There was a problem hiding this comment.
Added
apps/randomness-monitor/src/index.ts
Outdated
| result = new Monitoring(blockNumber, block.timestamp, MonitoringResult.Failure) | ||
| } | ||
|
|
||
| await this.monitoringRepository.saveMonitoring(result) |
e52fa8a to
f6a443d
Compare
a956b36 to
26e00d5
Compare
f6a443d to
ba0fd44
Compare
26e00d5 to
81c5d7d
Compare
ba0fd44 to
4626e73
Compare
43caf65 to
1194438
Compare
bd92b1f to
2f1584b
Compare
289de0c to
393edd4
Compare
9ba9b58 to
924b418
Compare
924b418 to
c73f432
Compare
c73f432 to
c95e27e
Compare
c95e27e to
445f322
Compare
There was a problem hiding this comment.
I feel like I've seen this somewhere else, should we move to common?
There was a problem hiding this comment.
done
apps/randomness-monitor/src/index.ts
Outdated
| this.latestMonitoringBlockNumber = this.latestBlockchainBlockNumber | ||
| } | ||
|
|
||
| if (this.latestMonitoringBlockNumber && this.latestBlockchainBlockNumber) { |
There was a problem hiding this comment.
That condition is guaranteed by the two if above.
There was a problem hiding this comment.
right
apps/randomness-monitor/src/index.ts
Outdated
| * Monitor a specific block for randomness | ||
| */ | ||
| private async monitorBlock(blockNumber: bigint): Promise<Result<void, Error>> { | ||
| console.log("Monitoring block", blockNumber) |
There was a problem hiding this comment.
I agree this is a monitoring service, but probably could use a better name for "a monitoring", what about "a check"?
There was a problem hiding this comment.
done
There was a problem hiding this comment.
This could probably use a README file to explain the purpose, doesn't need to be much, maybe a slight expansion over the PR description.
Another question: how is the Grafana integration working, is there code for that somewhere?
There was a problem hiding this comment.
README added. Regarding your question about Grafana: the randomness monitoring service saves the results in a SQLite database, and Grafana queries that database directly to display the dashboard and configure alerts
445f322 to
98409a0
Compare
98409a0 to
07703f1
Compare

Description
This PR adds a new service that monitors every block of our blockchain to check whether the random() function is available. It then saves the result in a SQLite database, which is later queried by Grafana to display this dashboard: https://grafana.happy.tech/goto/ZamzFWAHR?orgId=1
Toggle Checklist
Checklist
Basics
norswap/build-system-caching).Reminder: PR review guidelines
Correctness
testnet, mainnet, standalone wallet, ...).
< INDICATE BROWSER, DEMO APP & OTHER ENV DETAILS USED FOR TESTING HERE >
< INDICATE TESTED SCENARIOS (USER INTERFACE INTERACTION, CODE FLOWS) HERE >
and have updated the code & comments accordingly.
Architecture & Documentation
(2) commenting these boundaries correctly, (3) adding inline comments for context when needed.
comments.
in a Markdown document.
packages/coreandpackages/react), see here for more info.