-
Notifications
You must be signed in to change notification settings - Fork 4
Add daily_miner_deals_checked table to collect aggregated deal information #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add daily_miner_deals_checked table to collect aggregated deal information #624
Conversation
Co-authored-by: bajtos <1140553+bajtos@users.noreply.github.com>
Co-authored-by: bajtos <1140553+bajtos@users.noreply.github.com>
…DealsChecked Co-authored-by: bajtos <1140553+bajtos@users.noreply.github.com>
@copilot fix the test failures, e.g. this one:
|
Co-authored-by: bajtos <1140553+bajtos@users.noreply.github.com>
... Fixed the test failure in commit 7c71e98. The issue was that Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
That won't work, there will be too many INSERT calls and the operation will take long to complete. Please find a way how to keep using |
…oach Co-authored-by: bajtos <1140553+bajtos@users.noreply.github.com>
Fixed in commit 040177a. Changed to use a single query with |
I reverted back to the version in 5fb661d as that's the only one that works well. |
This PR enhances the
updatePublicStats()
function to collect aggregated information about deals checked, as requested in CheckerNetwork/spark-api#697.Changes Made
Database Schema
026.do.daily-miner-deals-checked.sql
to create the newdaily_miner_deals_checked
table with:day
(DATE) - the date when deals were checkedminer_id
(TEXT) - the miner identifierpayload_cids
(TEXT[]) - array of payload CIDs tested for that miner on that dayImplementation
updateDailyMinerDealsChecked()
function that:updatePublicStats()
workflowKey Features
Set
data structure in memory and PostgreSQLDISTINCT
operations to ensure no duplicate CIDsON CONFLICT DO UPDATE
witharray_cat()
allows multiple updates per day without losing datajsonb_to_recordset()
for batch processingTesting
Example Usage
After processing committees, the table contains aggregated data like:
This enables efficient analysis of which deals were checked by each miner on any given day, supporting the broader goal of improving deal monitoring and analytics capabilities.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.filspark.com
node /home/REDACTED/work/spark-evaluate/spark-evaluate/node_modules/.bin/mocha
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.