Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
7b4449c
Enforce asset selection for promotion
ward-taoshi Nov 6, 2025
a1ba541
Clear logging
ward-taoshi Nov 6, 2025
b78cef1
Include challenge period miners in promotion ranking
ward-taoshi Nov 6, 2025
c364ad0
Update promotion tests
ward-taoshi Nov 6, 2025
ec8b817
Validate challenge miners being ranked has ledgers/positions
ward-taoshi Nov 7, 2025
f9d5719
Clean message
ward-taoshi Nov 7, 2025
1e102e4
Move live price fetcher to its own process with rpc
ward-taoshi Oct 28, 2025
69cb0dc
Remove direct references for live price fetcher
ward-taoshi Oct 28, 2025
19579f3
Fix pickle generator bug
ward-taoshi Oct 29, 2025
a3fa6ff
Fix test case
ward-taoshi Oct 29, 2025
d54f47e
Add client connection retry and logging
ward-taoshi Oct 29, 2025
1ac305d
Wait for server process
ward-taoshi Oct 29, 2025
bead86e
rotate rpc authkey with uuid
ward-taoshi Nov 3, 2025
92296b7
Isolate price fetcher instances only using REST
ward-taoshi Nov 5, 2025
02e361a
Add health check and contain all lpf logic to client
ward-taoshi Nov 7, 2025
4b8ddf5
Disable ipc on live price fetcher
ward-taoshi Nov 7, 2025
7a15406
Fix test case
ward-taoshi Nov 7, 2025
a96adbf
Move MDD checker to separate process with shared locks
jbonilla-tao Nov 7, 2025
1ee1c27
Move elimination manager to separate process with shared locks
jbonilla-tao Nov 7, 2025
2593045
Isolate ChallengePeriodManager to its own process
jbonilla-tao Nov 7, 2025
8c41658
Add cross-process synchronization with epoch-based validation
jbonilla-tao Nov 8, 2025
57ff5e0
Move daemon classes into their parent classes
jbonilla-tao Nov 8, 2025
c779671
Fix multiprocessing error in HealthChecker daemon
jbonilla-tao Nov 8, 2025
017b6ad
Add 5-minute cooldown to SlackNotifier to prevent spam
jbonilla-tao Nov 8, 2025
9377d82
Fix race conditions and remove unused shutdown_dict logic
jbonilla-tao Nov 8, 2025
cada4e9
Switch to 100% pnl
ward-taoshi Nov 9, 2025
a980e25
temp lock logging
jbonilla-tao Nov 10, 2025
98a4281
ipc logging and optimization
jbonilla-tao Nov 10, 2025
7f0324d
debug log
jbonilla-tao Nov 10, 2025
0d70c4e
fix ipc between challenege and elimination managers
jbonilla-tao Nov 10, 2025
5d6b041
opti
jbonilla-tao Nov 10, 2025
aa1e0bc
metagraph dedicated manager. logs
jbonilla-tao Nov 10, 2025
2dfb38d
use original name
jbonilla-tao Nov 10, 2025
a9fedbe
opti
jbonilla-tao Nov 10, 2025
5e4f19d
debug log
jbonilla-tao Nov 10, 2025
a760553
Merge branch 'fix/asset-based-promotion' into refactor/price-fetcher
ward-taoshi Nov 12, 2025
056cd42
logs
jbonilla-tao Nov 12, 2025
3038ea1
getters and setters. remove blacklist func which does nothing but add…
jbonilla-tao Nov 13, 2025
4be293f
metagraph updater fix
jbonilla-tao Nov 13, 2025
842557c
temp
jbonilla-tao Nov 13, 2025
3cd557b
market open doesn't need ipc call
jbonilla-tao Nov 13, 2025
b6e9641
per-process ipc manager
jbonilla-tao Nov 13, 2025
a47fa8a
Temp logging for position loading
ward-taoshi Nov 15, 2025
b366e87
continue logging
ward-taoshi Nov 15, 2025
fc8bf57
Revert "Temp logging for position loading"
ward-taoshi Nov 15, 2025
bdcad27
Squashed: initial limit orders implementation
ward-taoshi Nov 13, 2025
2aa347f
fix order of args
jbonilla-tao Nov 15, 2025
c0e4cb3
new tests. fix grc
jbonilla-tao Nov 15, 2025
11c9988
eliminate mdd challenge miners
ward-taoshi Nov 15, 2025
02fb3ea
Fix ledger reference
ward-taoshi Nov 15, 2025
dbb9a58
Allow development orders on mainnet
jbonilla-tao Nov 15, 2025
48be445
modularize order processing
jbonilla-tao Nov 15, 2025
f0a637a
Fix EliminationManager initialization in tests
jbonilla-tao Nov 15, 2025
c910445
rpc position manager
jbonilla-tao Nov 15, 2025
a5f40b7
store compressed perf ledgers
jbonilla-tao Nov 15, 2025
47643a6
fix refactor
jbonilla-tao Nov 15, 2025
9194bbb
clean
jbonilla-tao Nov 15, 2025
3ef5195
- Before: Daemon on client making expensive RPC calls:
jbonilla-tao Nov 15, 2025
28b893a
cp
jbonilla-tao Nov 15, 2025
1a734aa
speed up open position fetch
jbonilla-tao Nov 15, 2025
dde3902
optimize open position search for faster order filling
jbonilla-tao Nov 15, 2025
58652db
rpc subclass and tests
jbonilla-tao Nov 15, 2025
81fbf0f
refactor: complete RPC architecture migration for ChallengePeriodMa…
jbonilla-tao Nov 16, 2025
f1cb424
fix: add missing RPC server modules for EliminationManager and Challe…
jbonilla-tao Nov 16, 2025
117affe
fix: remove manual RPC manager process startup
jbonilla-tao Nov 16, 2025
e6588b6
fix: remove redundant LivePriceFetcher health checker
jbonilla-tao Nov 16, 2025
cc457f9
refactor: use daemon pattern for MDDChecker instead of manual process…
jbonilla-tao Nov 16, 2025
b706ae3
Add missing to_checkpoint_dict RPC method and integration tests
jbonilla-tao Nov 16, 2025
bb42f7c
Fix p2p_syncer to not write/upload when generating checkpoints
jbonilla-tao Nov 16, 2025
8c41549
Refactor ValiBkpUtils.get_vcp_output_path() to accept running_unit_te…
jbonilla-tao Nov 16, 2025
4507347
Fix RPC coverage test logic bugs
jbonilla-tao Nov 16, 2025
56e7455
Fix penalty_ledger.py production error - use RPC instead of direct ac…
jbonilla-tao Nov 16, 2025
03fdf6a
Add validation/tmp/ to .gitignore
jbonilla-tao Nov 16, 2025
685a0a5
Remove temporary test artifacts from validation/tmp/
jbonilla-tao Nov 16, 2025
72029fb
Refactor metagraph to use RPC server/client pattern for massive perfo…
jbonilla-tao Nov 16, 2025
4f41302
Add atomic update_metagraph() RPC method for single-call updates
jbonilla-tao Nov 16, 2025
fae1719
Add threading lock to MetagraphServer for thread-safe atomic operations
jbonilla-tao Nov 16, 2025
9b32e4b
Remove individual setters - enforce single atomic update_metagraph() …
jbonilla-tao Nov 16, 2025
66bf511
Use explicit get_hotkeys() getter instead of property access
jbonilla-tao Nov 16, 2025
6f63419
Delete unused IPCMetagraph and related IPC functions
jbonilla-tao Nov 16, 2025
8922663
Update all files to use explicit getters instead of property access
jbonilla-tao Nov 16, 2025
3924740
Remove backwards compatibility properties from MetagraphManager
jbonilla-tao Nov 16, 2025
01ce899
Consolidate to single atomic update_metagraph() call
jbonilla-tao Nov 16, 2025
0dfe4f2
Update all metagraph property accesses to use explicit getters
jbonilla-tao Nov 16, 2025
2ae75b6
Move start_metagraph_server import to top of file
jbonilla-tao Nov 16, 2025
0bd91ad
Ignore temporary .md files at root while keeping README.md and CLAUDE.md
jbonilla-tao Nov 16, 2025
040d4ca
Remove temporary .md files from root, keep only README.md and CLAUDE.md
jbonilla-tao Nov 16, 2025
1c58832
Add port release wait after killing stale RPC server processes
jbonilla-tao Nov 16, 2025
a3b9bda
Fix port conflict: change ChallengePeriodManager from 50005 to 50003
jbonilla-tao Nov 16, 2025
6e25aee
Update debt_based_scoring.py to use explicit metagraph getters
jbonilla-tao Nov 16, 2025
65cfb2e
Fix unresolved attribute: use get_departed_hotkeys() instead of depar…
jbonilla-tao Nov 16, 2025
e91e44d
Add efficient single-hotkey RPC method for departed_hotkey lookup
jbonilla-tao Nov 16, 2025
cfb47fb
Implement lock-free metagraph server with atomic tuple assignment
jbonilla-tao Nov 16, 2025
67ef0dd
optimize
jbonilla-tao Nov 16, 2025
d4843a7
tests
jbonilla-tao Nov 16, 2025
c5aecb8
tests
jbonilla-tao Nov 16, 2025
ca44afe
fixes
jbonilla-tao Nov 16, 2025
1faa53f
cp
jbonilla-tao Nov 17, 2025
58d57e1
fix
jbonilla-tao Nov 17, 2025
2b224d9
Fix dev endpoint tp parsing
ward-taoshi Nov 17, 2025
5ddaba6
pos locks rpc mode
jbonilla-tao Nov 17, 2025
a55ca54
challenege period daemon
jbonilla-tao Nov 17, 2025
2dc69fb
Attempt to cancel limit order by uuid first, fall back to trade pair
ward-taoshi Nov 17, 2025
242d9b4
Assign execution type to filled orders
ward-taoshi Nov 17, 2025
9d122f4
Assign limit price
ward-taoshi Nov 17, 2025
ee6f814
bugs
jbonilla-tao Nov 18, 2025
de0643f
bug fix
jbonilla-tao Nov 18, 2025
1a53ba9
race cond
jbonilla-tao Nov 18, 2025
35584ee
opt
jbonilla-tao Nov 18, 2025
2383bf9
fix
jbonilla-tao Nov 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
!vali_objects/utils/model_parameters/all_model_parameters.json
!vali_objects/utils/model_parameters/slippage_estimates.json

# Markdown files (ignore temporary ones at root, keep important docs)
*.md
!README.md
!CLAUDE.md

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -171,6 +176,7 @@ mining/processed_signals/
validation/miners/
validation/outputs/
validation/plagiarism/
validation/tmp/
tests/validation/miners/
tests/validation/plagiarism/

Expand Down
99 changes: 99 additions & 0 deletions data/README_departed_hotkeys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Default Departed Hotkeys File

## Overview

The `default_departed_hotkeys.json` file contains a historical record of all hotkeys that have been eliminated from the network and subsequently de-registered from the metagraph. This file serves as a fallback when the runtime `validation/departed_hotkeys.json` file doesn't exist (e.g., on fresh validator deployments).

## Purpose

The departed hotkeys tracking system prevents miners who have been eliminated and de-registered from re-registering to the subnet. When a hotkey appears in both:
1. The current metagraph (actively registered)
2. The departed_hotkeys data (previously departed)

The validator will reject all orders from that hotkey with a re-registration error message.

## File Structure

```json
{
"departed_hotkeys": {
"5FxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxG": {
"detected_ms": 1758835913415
},
"5GxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxC5": {
"detected_ms": 1759363497136
}
}
}
```

Each entry maps a hotkey to metadata containing:
- `detected_ms`: Timestamp (in milliseconds) when the hotkey was eliminated/departed

## How It Works

1. **Runtime Operation**: The validator tracks departures in `validation/departed_hotkeys.json` during normal operation
2. **Fallback**: If that file doesn't exist, the system loads `data/default_departed_hotkeys.json` (this file)
3. **Persistence**: New departures are added to the runtime file automatically

## Regenerating the Default File

To regenerate this file with the complete historical elimination data from the database:

### Prerequisites

1. Database access (config-development.json must be configured)
2. taoshi-ts packages available in PYTHONPATH
3. Current working directory must be the repo root

### Steps

```bash
# Ensure you're in the repo root
cd /path/to/proprietary-trading-network

# Set up the PYTHONPATH for taoshi-ts modules
export PYTHONPATH=/path/to/taoshi-ts/taoshi-ts-database-ptn:/path/to/taoshi-ts/taoshi-ts-ptnhs:$PYTHONPATH

# Run the generation script (mainnet)
python3 generate_default_departed_hotkeys.py --netuid 8 --network finney

# Run the generation script (testnet)
python3 generate_default_departed_hotkeys.py --netuid 116 --network test
```

The script will:
1. Query the current metagraph to get all active hotkeys
2. Load ALL historical eliminations from the taoshi.ts database
3. Identify hotkeys that are eliminated but NOT in the current metagraph (departed)
4. Generate `data/default_departed_hotkeys.json` with the results

### Script Output

The script provides detailed output:
- Number of current hotkeys in metagraph
- Total elimination records from database
- Unique eliminated hotkeys
- Departed hotkeys identified
- Time ranges and elimination reasons

### When to Regenerate

Regenerate this file:
- Before major releases
- After significant time periods (quarterly/yearly)
- When deploying to new environments
- When the elimination tracking system is updated

## Notes

- This file should be committed to the repository
- The runtime file (`validation/departed_hotkeys.json`) should NOT be committed
- The system automatically syncs new departures to the runtime file
- Old departures remain in the departed hotkeys list permanently (no automatic cleanup)

## See Also

- `generate_default_departed_hotkeys.py` - Script to regenerate this file
- `vali_objects/utils/elimination_manager.py` - Departed hotkeys tracking implementation
- `tests/vali_tests/test_reregistration.py` - Tests for re-registration prevention
5 changes: 3 additions & 2 deletions data_generator/base_data_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tiingo import TiingoWebsocketClient

from time_util.time_util import TimeUtil, UnifiedMarketCalendar
from vali_objects.vali_config import TradePair, TradePairCategory
from vali_objects.vali_config import TradePair, TradePairCategory, ValiConfig
from vali_objects.vali_dataclasses.recent_event_tracker import RecentEventTracker
from vali_objects.vali_dataclasses.price_source import PriceSource

Expand Down Expand Up @@ -77,7 +77,8 @@ def __init__(self, provider_name, ipc_manager=None):
self.last_restart_time = {}
self.tpc_to_last_event_time = {t: 0 for t in self.enabled_websocket_categories}

self.UNSUPPORTED_TRADE_PAIRS = (TradePair.SPX, TradePair.DJI, TradePair.NDX, TradePair.VIX, TradePair.FTSE, TradePair.GDAXI, TradePair.TAOUSD)
# Reference ValiConfig constant for backward compatibility
self.UNSUPPORTED_TRADE_PAIRS = ValiConfig.UNSUPPORTED_TRADE_PAIRS

for trade_pair in TradePair:
assert trade_pair.trade_pair_category in self.trade_pair_category_to_longest_allowed_lag_s, \
Expand Down
4 changes: 2 additions & 2 deletions data_generator/polygon_data_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,12 @@ def _get_filtered_forex_second_data():
elif timespan == 'minute':
ans = _get_filtered_forex_minute_data()
elif timespan == 'day':
return _fetch_raw_polygon_aggs()
return list(_fetch_raw_polygon_aggs())
else:
raise Exception(f'Invalid timespan {timespan}')
return ans
else:
return _fetch_raw_polygon_aggs()
return list(_fetch_raw_polygon_aggs())

def get_candles_for_trade_pair(
self,
Expand Down
Loading
Loading