Repository navigation
consensus queue: fix blob expiry and validate config limits - #24266
Conversation
|
✅ No conflicts with other open PRs targeting |
|
I see you updated files related to
|
| // Plugin sizing constants. | ||
| const ( | ||
| // MaxBlobHandlesPerObservation is the most blobs a node broadcasts in one Observation. | ||
| MaxBlobHandlesPerObservation = 10 |
There was a problem hiding this comment.
Any reason these are constants instead of settings? If we want to try and optimize them we'd have to wait for a full release to update them and there might be some issues with different nodes running different limits. i.e. if 1 node has MaxBlobHandlesPerObservation set at 10 and a new node has it set at 20, the old node will reject the new nodes observations that have > 10 blobs
There was a problem hiding this comment.
As in a cresetting? Is there a clean way to do that without having to defensive about the non-atomicity? Or should we use the plugin config to avoid that issue?
There was a problem hiding this comment.
cresettings will be faster than a constant but there's still some non-atomicity. I posted in the other PR for how the vault is going to handle having atomic flags which should probably be included in here in a future update
Use the event deadline retained in the observation for a blob's expiration hint, instead of the same event after observeEvent strips its timestamps. The hint was always the minimum lifetime (~30s), so blobs expired long before their events could be executed and backlogged events were silently dropped, DON-wide. Validate the limits the plugin relies on. A config now needs at least four modified KV keys and enough bytes for them, an observation large enough for one event plus the blob handle reservation for the DON's N and F, a blob payload large enough for one event, and positive per-oracle blob quotas. The checks run when the config is decoded, when the plugin is created, and in the deployment config generator, so a wedging config fails loudly instead of stalling the DON. Size the default per-oracle blob quotas from the event lifetime at the DON's DeltaRound, with reaping slack. Share the sizing constants and quota formula in the new queuelimits package; queuepb keeps the config protos, conversion and validation. Co-Authored-By: Claude Code <noreply@anthropic.com>
A stalled blob store, or a peer that advertises a blob but never serves it, could block Observation, ValidateObservation and Committed indefinitely: OCR3.1 background plugin calls pass an epoch context with no deadline. Give each blob broadcast and fetch a two second timeout, mirroring the vault plugin's blobBroadcastTimeout. A timed-out broadcast is treated as a failed blob, so Observation still returns with that blob's events omitted; a timed-out fetch rejects the observation or drops the execution, and all spawned goroutines exit. Add tests with a fetcher and broadcaster that block until their context ends, asserting all three paths return promptly. Co-Authored-By: Claude Code <noreply@anthropic.com>
958f0ca to
8234ced
Compare
Use the event deadline retained in the observation for a blob's expiration hint, instead of the same event after observeEvent strips its timestamps. The hint was always the minimum lifetime (~30s), so blobs expired long before their events could be executed and backlogged events were silently dropped, DON-wide.
Validate the limits the plugin relies on. A config now needs at least four modified KV keys and enough bytes for them, an observation large enough for one event plus the blob handle reservation for the DON's N and F, a blob payload large enough for one event, and positive per-oracle blob quotas. The checks run when the config is decoded, when the plugin is created, and in the deployment config generator, so a wedging config fails loudly instead of stalling the DON.
Size the default per-oracle blob quotas from the event lifetime at the DON's DeltaRound, with reaping slack. Share the sizing constants and quota formula in the new queuelimits package; queuepb keeps the config protos, conversion and validation.
consensus queue: bound blob broadcasts and fetches with a timeout