Conversation
Greptile SummaryThis PR replaces the hardcoded
Confidence Score: 5/5Safe to merge — purely additive config change with a sensible default; no logic regressions found The change is a clean, well-scoped refactor. The 400 ms default is more appropriate than the old 1 000 ms hardcoded value and is correctly tuned per deployment environment. The only finding is a minor test-fixture inconsistency in No files require special attention; Important Files Changed
Sequence DiagramsequenceDiagram
participant Cfg as OperatorConfig
participant Op as operator::run
participant S as run_sender
participant SS as SenderState
participant T as send_and_confirm
participant U as check_transaction_status
Cfg->>Op: confirmation_poll_interval_ms
Op->>S: confirmation_poll_interval_ms
S->>SS: SenderState::new(…, confirmation_poll_interval_ms)
SS-->>S: state.confirmation_poll_interval_ms stored
S->>T: handle_transaction_submission(state, …)
T->>U: check_transaction_status(rpc, sig, commitment, policy,<br/>state.confirmation_poll_interval_ms)
loop up to MAX_POLL_ATTEMPTS_CONFIRMATION (5)
U->>U: getSignatureStatuses RPC call
U->>U: sleep(poll_interval_ms)
end
U-->>T: ConfirmationResult
Reviews (1): Last reviewed commit: "feat(operator): configurable confirmatio..." | Re-trigger Greptile |
Problem
Two hardcoded assumptions in the per-transaction hot path for deposit/withdraw were capping the throughput:
check_transaction_statusused a fixed 1000 ms poll interval. Contra's block time is ~100 ms, so the operator waited 10× longer than necessary to detect confirmation.getSignaturesForAddress) retried 5 times with exponential backoff, burning ~1500 ms per transaction — even though the Contra RPC node returns-32601 Method not found, a response that will never change between attempts.Changes
Configurable poll interval: replaces the hardcoded
POLL_INTERVAL_MS_CONFIRMATION = 1000withconfirmation_poll_interval_msinOperatorConfig(default: 400 ms, matching Solana's block time). All deployment configs are updated:operator-solanauses 100 ms;operator-contrauses 400 ms.Permanent RPC error short-circuit:
with_retrynow exits immediately on-32601 Method not foundrather than exhausting the backoff budget. The check is scoped to this specific JSON-RPC error code so all other errors continue to retry as before. ATODOmarks the guard for removal oncegetSignaturesForAddressis implemented on the RPC node.Impact
Results
Deposit
Withdraw
Coverage Report