feat(oracle-service): quiet expected gas-probe WARN + duplicate Venus normalize INFO #29
Labels
No labels
enhancement
governance
QA
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/ust1-window#29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Bundle two low-severity oracle-service log hygiene fixes observed in production Coolify logs:
UpdateRatesubmit emitswarn!network min gas price probe failed; using configured TERRA_GAS_PRICE floorwitherror=node config query 501 Not Implementednormalized Venus exchangeRateStored → oracle RATE_SCALE unitsline twice (identicalexchange_rate_stored/oracle_r)Both are expected consequences of current code paths (LCD without node-config API; 2-of-N EVM RPC consensus each calling
bsc::read_exchange_rate_stored). They do not indicate failed updates in the reviewed log slice, but they drown signal and can train operators to ignore realwarn!/error!lines.Current codebase
Gas-price probe (INV-ORACLE-GAS-001 / audit M-14)
oracle-service/src/terra_tx.rsquery_network_min_gas_priceGETs{lcd}/cosmos/base/node/v1beta1/configand parsesminimum_gas_price.Err;resolve_gas_pricethenwarn!s and falls back to the configuredTERRA_GAS_PRICEfloor.resolve_gas_priceis invoked on every fee computation path before broadcast, so a permanently unsupported LCD endpoint produces a WARN on every submit (and potentially every fee path that probes).max(configured, network_min).configured=28.325(uluna/gas units as used by the service).Duplicate Venus normalize INFO
oracle-service/src/main.rsrun_oncecallsevm_rpc::run_with_evm_rpc_rate_consensus, which queries at least two BSC RPC URLs in parallel (tokio::join!onurls[0]/urls[1], optional third for ties).bsc::read_exchange_rate_stored, which unconditionallytracing::info!s the full normalization payload (exchange_rate_stored, decimals,oracle_r).evm_rpc.rs(exact match → silent success; within 0.01% → one info; tie-break → warn). The per-provider normalizeinfo!therefore duplicates on every healthy tick.Related (out of scope unless trivial)
outcome="failed"for normalUpdateTooSoon— separate alerting concern; do not expand this issue into policy-log redesign unless a one-line doc note is needed.Why this is needed
tracingfor ops (no Prometheus). Recurring expected WARNs and duplicated INFO lines train pager blindness and make real DeliverTx / liveness / RPC-mismatch WARN/ERROR harder to spot.warnevery submit overstates severity relative to a previously working probe that suddenly fails (which should stay loud).RATE_SCALEconversion; two identical lines add no consensus evidence (consensus already logs disagreements).Constraints / guardrails
max(configured, network_min)when the probe succeeds; configured floor when it does not.evm_rpc.rs). Logging changes must not skip RPCs or accept a single provider.Noneis OK only if docs/skill state that the LCD lacks the endpoint; do not claim adaptive network gas when the probe never runs.debugthereafter), notwarnevery submit.debugwithrpc_urlredacted/host-only). Keep enough fields to verifyoracle_rmath in incidents.TERRA_GAS_PRICE,BSC_RPC_URLS, etc.) remain; optional new env only if clearly documented (prefer code behavior over new knobs).Relevant files
oracle-service/src/terra_tx.rsquery_network_min_gas_price,resolve_gas_price,effective_gas_price, fee pathoracle-service/src/bsc.rsexchangeRateStoredread + normalizeinfo!oracle-service/src/evm_rpc.rsoracle-service/src/main.rsrun_oncetick wiringoracle-service/src/config.rsTERRA_GAS_PRICE/ RPC envskills/audit-hardening-bundle/SKILL.mddocs/DEPLOYMENT.mdREADME.mdRecommended direction
A) Gas-price probe WARN
501, and optionally other documented “endpoint missing” statuses) → returnOk(None)(or a dedicated result) and log once at process start / first fee resolve (infoor singlewarn), then stay quiet while still using configured floor.warn(ideally rate-limited or “state changed” so flaps are visible).Some(network_min)→effective_gas_price; ifnetwork_min > configured, consider a single clearinfo!that the fee was raised.DEPLOYMENT.md/ audit-hardening skill that columbus-5 LCD may not implement node config; operators must keepTERRA_GAS_PRICE≥ live min gas.B) Duplicate BSC normalize lines
bsc::read_exchange_rate_storedtodebug!or remove it and emit a singleinfo!inrun_once/ consensus after a rate is accepted (includeoracle_r; optional note that N providers agreed).Acceptance criteria
/cosmos/base/node/v1beta1/config, a sequence of multiple successfulUpdateRatesubmits does not emit a gas-probewarn!on every submit (at most once per process lifetime, or debug-only thereafter).max(configured, network_min)(INV-ORACLE-GAS-001 unchanged).skills/audit-hardening-bundle/SKILL.mdanddocs/DEPLOYMENT.mdnote LCD 501 / configured floor expectations and the quieter log behavior.cargo test -p ust1-oracle-servicepasses; no new clippy warnings in touched files.Test plan (all paths)
Gas probe
minimum_gas_pricebelow configuredminimum_gas_priceabove configuredminimum_gas_priceeffective_gas_price_*unit testsBSC normalize / consensus
debuglevel enabledRegression
Test plan (attack / hack / abuse vectors)
minimum_gas_priceTERRA_GAS_PRICENone; no underpriced “0” fee from parse bugs%/ structured); no unsanitized multi-line RPC bodies at INFOPOLL_INTERVAL_SECSVerification criteria
terra_txcover 501 quieting + success max();evm_rpc/bsctests still pass with logging change.run_oncewith two mock RPCs returning the same mantissa; log capture shows a single normalize/summary INFO.TERRA_GAS_PRICEremains the safety floor when adaptive probe is unavailable.mentioned in issue #32
marked as related to #32