Skip to content

Commit 88f2ac1

Browse files
committed
fix(host-listener): count all inserted ops for slow-lane cap
Use inserted-only per-chain counting to avoid underestimating required producer pressure.
1 parent 4f05b54 commit 88f2ac1

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

coprocessor/fhevm-engine/host-listener/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ If you want to disable TFHE operation events propagation, you can provide an emp
3939

4040
Current behavior:
4141
- Counter is **per dependence chain, per ingest pass** (block-scoped in normal flow).
42-
- Count is **unweighted**: `+1` for each newly inserted op that has input handles.
42+
- Count is **unweighted**: `+1` for each newly inserted TFHE op in the chain.
4343
- `is_allowed` is **not** part of the counter (a non-allowed op can still be required producer work).
4444
- It is **not** dependency depth and **not** cumulative across past blocks.
4545

coprocessor/fhevm-engine/host-listener/src/database/ingest.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ use crate::cmd::block_history::BlockSummary;
1212
use crate::contracts::{AclContract, TfheContract};
1313
use crate::database::dependence_chains::dependence_chains;
1414
use crate::database::tfhe_event_propagate::{
15-
acl_result_handles, tfhe_inputs_handle, tfhe_result_handle, Chain,
16-
ChainHash, Database, LogTfhe,
15+
acl_result_handles, tfhe_result_handle, Chain, ChainHash, Database, LogTfhe,
1716
};
1817

1918
pub struct BlockLogs<T> {
@@ -187,11 +186,9 @@ pub async fn ingest_block_logs(
187186
for tfhe_log in tfhe_event_log {
188187
let inserted = db.insert_tfhe_event(&mut tx, &tfhe_log).await?;
189188
at_least_one_insertion |= inserted;
190-
// Count newly inserted dependent TFHE ops (ops that consume input
191-
// handles). This approximates dependent work added to a chain by this
192-
// ingest pass.
193-
let has_dependencies = !tfhe_inputs_handle(&tfhe_log.event).is_empty();
194-
if slow_lane_enabled && inserted && has_dependencies {
189+
// Count all newly inserted ops per chain to avoid underestimating
190+
// pressure from producer paths that are required by downstream work.
191+
if slow_lane_enabled && inserted {
195192
let total = dependent_ops_by_chain
196193
.entry(tfhe_log.dependence_chain)
197194
.or_default();

0 commit comments

Comments
 (0)