# Executors will get underpaid while excessive gas will be refunded to the requestor

Seda gas meter divides remaining exec gas by full replication factor, ignoring outliers, so honest executors are underpaid and residue refunded to requestor.

- Payout: Audit contest
- Severity: medium
- Program: Seda Protocol
- Found by: zxriptor
- Disclosed: 2024-12-20
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/80
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-seda-protocol%3AM-3
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:go technique:source-review vuln:accounting-error vuln:reward-distribution

**Target:** seda-chain x/tally gas_meter.go executor gas metering
**Root cause:** MeterExecutorGasUniform caps per-executor gas at RemainingExecGas/replicationFactor without subtracting outliers, so outlier slots consume no gas but still shrink the per-executor share, leaving residue refunded to the requestor.
**Steps:**
1. Set remaining exec gas to 90,000, replicationFactor 10, gasReport 10,000, 2 outliers.
2. Observe gasUsed = min(10000, 90000/10) = 9,000.
3. 8 honest executors each get 9,000 = 72,000; 18,000 residue refunded to requestor.
4. Honest executors underpaid by 1,000 each despite sufficient remaining gas.
**How found:** Code review of gas metering: noticed outliers are skipped in the consume loop but not excluded from the replicationFactor divisor, causing a mismatch between paid slots and divisor.
**Insight:** When a divisor represents the number of paid participants, check whether skipped/outlier entries are still counted in that divisor; any skip path that doesn't adjust the divisor leaks value to the refund side.

