Conversation
20bb13b to
e76c62c
Compare
| the changes without restarting the server. | ||
|
|
||
| Note: This only reloads values that are set in the config file. Values that | ||
| were set via the API but not persisted will remain unchanged.`, |
There was a problem hiding this comment.
Values that were set via the API but not persisted will remain unchanged.
How does that work? Do they not get replaced by the contents of the config file?
There was a problem hiding this comment.
A Piri node starts with this config file:
[pdp.aggregation.manager]
poll_interval = "30s"The node uses a poll interval of 30 seconds.
Runtime override (ephemeral):
piri client admin config set pdp.aggregation.manager.poll_interval 5m
The node now uses 5 minutes. The config file is unchanged.
Reload from file:
piri client admin config reload
The node returns to 30 seconds. The file wins; runtime overrides do not survive a reload.
Edit the file, then reload:
[pdp.aggregation.manager]
poll_interval = "5m"piri client admin config reload
The node uses 5 minutes. The file still wins—it just agrees with you now.
Runtime override with --persist:
piri client admin config set pdp.aggregation.manager.poll_interval 10m --persist
The node uses 10 minutes and the config file is updated to match. Future reloads will preserve the change.
In summary, the config file is the source of truth. Runtime changes are ephemeral by default, they override behavior without touching the file. A reload restores the file's authority. The --persist flag exists for operators who mean it: change the behavior and update the file so the two agree. This prevents the most common configuration surprise: a system whose running state has silently diverged from its config file, discovered during a restart nobody planned for.
- allow the aggregation manager to be configured dynamicly without needing to restart piri for configuration to take effect.
e76c62c to
b8bb044
Compare
Summary
Introduce a dynamic configuration system that allows operators to tune the aggregation manager's behavior at runtime without restarting piri. This enables gas usage optimization by adjusting how frequently the manager polls for work and how many roots it batches together when adding to the chain.
Motivation
The aggregation manager is responsible for batching aggregated roots and submitting them on-chain. The cost of these operations depends on:
Previously, changing these values required editing the config file and restarting piri. This PR enables operators to:
Changes
Core Dynamic Config Infrastructure (
pkg/config/dynamic/)Key design decisions:
Manager Integration (
pkg/pdp/aggregation/manager/)Dynamic behavior:
PollInterval: When changed, the manager's ticker immediately resets to the new intervalBatchSize: Read on each poll cycle, no subscription neededHTTP API (
pkg/admin/httpapi/)/admin/config/admin/config/admin/config/reloadCLI Commands (
cmd/cli/client/admin/config/)Config Keys
pdp.aggregation.manager.poll_intervalpdp.aggregation.manager.batch_sizeExample Usage
Scenario: Operator wants to reduce gas costs by batching more roots together and polling less frequently.