You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(roi): short-circuit offchain-deposit reader for on-chain-only agents; seed checkpoint on first run
Tightens the pre-deposit-as-loss helper so on-chain-only deployments do
zero extra work and generate no log noise:
- **Early return when ``mech_marketplace_config.use_offchain`` is False.**
Production on-chain-only traders take this path and never touch the
contract API. No RPC call, no persist, ROI number bit-identical to
today.
- **First-run checkpoint seeding.** When ``last_scanned_block == 0`` on
an off-chain deployment, the helper now fetches the current head block
via a new ``MechPrepaidReaderContract.get_current_block_number``
classmethod and stores it as the checkpoint instead of sweeping the
full history. Off-chain has not shipped in production, so there are
no pre-existing deposits to backfill; this avoids RPC
``eth_getLogs`` block-range caps (Alchemy 10k, Infura 100k, etc.)
that would otherwise error on every cycle and leave the checkpoint
pinned at zero.
- **``balance_tracker_address`` added to deployment configs.** The Python
default in ``mech_interact_abci/models.py`` seeded the address for
both chains, but the deployment yamls did not, so an operator could
not override it per-deployment. Added the real deployed addresses
(Gnosis 0x7D686bD1fD3CFF6E45a40165154D61043af7D67c, Polygon
0xaaFBeef195BDAb1Bb6f3Dc9cEbA875Cd72499230) to ``trader_pearl`` and
``polymarket_trader`` service.yamls, plus zero-address placeholders in
``trader_abci/skill.yaml`` and ``trader`` aea-config.yaml.
Existing behaviour under both modes stays correct: on-chain-only agents
see zero on all paths, off-chain agents capture every ``Deposit`` from
first run forward.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments