diff --git a/CHANGELOG.md b/CHANGELOG.md index 36161ed018..8005427b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ All notable changes to this project will be documented in this file. - `.cursor/BUGBOT.md` and `.github/copilot-instructions.md` now tell Bugbot and Copilot to read the nearest sibling, flag a path that skips a zero or a duplicate, and assert a specific error and the exact log line at the expected index. Onchain checks apply only when the repository has onchain code. The eight path-scoped files under `.github/instructions/` are removed so Copilot reads only the repo-wide file. (#4247) - E2E/QA - Remove `TestQA_MulticastSettlement`. It funded a seat through `doublezero-solana shreds pay`, which is going away. The agent seat-pay RPC now returns Unimplemented if something still calls it. Unused settlement helpers go with the test. (#4248) +- Offchain + - The scheduler refuses to boot when `SOLANA_RPC` is unset or empty, rather than handing `nil` or an empty string to the Rust NIF. All three workers read the one config key, so the check sits in `config/runtime.exs` where the single cause was. The test environment is exempt, since the tests set the key themselves. `DZ_LEDGER_RPC` no longer sets a `ledger_rpc` key that nothing in the application read. (#4240 follow-up) + - The scheduler README closes its shell code block, so the Installation heading and everything after it stop rendering inside it. +- Solana programs + - Rename `test_lifetime_swept_2z_amount` to match the `lifetime_swapped_2z_amount` field and method it covers, so a search for the swapped-amount tests finds it. ## [v0.38.0](https://github.com/malbeclabs/doublezero/compare/client/v0.37.0...client/v0.38.0) - 2026-08-28 diff --git a/offchain/scheduler/README.md b/offchain/scheduler/README.md index f178b92f85..c097db4ed5 100644 --- a/offchain/scheduler/README.md +++ b/offchain/scheduler/README.md @@ -16,6 +16,8 @@ To run the scheduler locally: ```sh mix deps.get + ``` + ## Installation If [available in Hex](https://hex.pm/docs/publish), the package can be installed diff --git a/offchain/scheduler/config/runtime.exs b/offchain/scheduler/config/runtime.exs index 5d1658bf0b..fbaeabb92b 100644 --- a/offchain/scheduler/config/runtime.exs +++ b/offchain/scheduler/config/runtime.exs @@ -2,11 +2,24 @@ import Config config :scheduler, genesis_epoch: 31, - ledger_rpc: System.get_env("DZ_LEDGER_RPC"), - solana_rpc: System.get_env("SOLANA_RPC"), prometheus_endpoint: System.get_env("PROMETHEUS_ENDPOINT", "localhost"), plug_router_port: String.to_integer(System.get_env("SCHEDULER_HTTP_PORT", "4001")) +# Every worker hands this value straight to the NIF, which wants a usable URL. An +# unset variable used to arrive there as nil, so fail the boot instead. fetch_env! +# alone is not enough: it raises only when the variable is missing, so SOLANA_RPC= +# would pass an empty string through to the same place. Tests set the key +# themselves and never read this. +if config_env() != :test do + solana_rpc = System.fetch_env!("SOLANA_RPC") + + if String.trim(solana_rpc) == "" do + raise "SOLANA_RPC is set but empty. The workers pass it straight to the NIF." + end + + config :scheduler, solana_rpc: solana_rpc +end + config :scheduler, Scheduler.PromEx, disabled: false, manual_metrics_start_delay: :no_delay, diff --git a/solana/programs/revenue-distribution/src/state/journal.rs b/solana/programs/revenue-distribution/src/state/journal.rs index 935340130f..c58ddf2446 100644 --- a/solana/programs/revenue-distribution/src/state/journal.rs +++ b/solana/programs/revenue-distribution/src/state/journal.rs @@ -59,7 +59,7 @@ mod tests { use super::*; #[test] - fn test_lifetime_swept_2z_amount() { + fn test_lifetime_swapped_2z_amount() { let journal = Journal { lifetime_swapped_2z_amount: Uint::from(69_420), ..Default::default()