Skip to content

feat(onchain-monitor): add reorg-safe evidence replay - #1251

Open
sentinelhood wants to merge 5 commits into
aeonfun:mainfrom
sentinelhood:followups-after-1244-20261020T193506Z
Open

sentinelhood wants to merge 5 commits into
aeonfun:mainfrom
sentinelhood:followups-after-1244-20261020T193506Z

Conversation

@sentinelhood

@sentinelhood sentinelhood commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1244.

Adds replayable evidence receipts and reorg-aware monitoring:

  • stores the last observed block hash;
  • detects canonical-history changes;
  • rewinds a safety window;
  • replays observations before emitting an alert.

Validation:

  • skill-pack validator: passed
  • README/catalog validator: passed
  • skill security scanner: passed
  • embedded JSON validation: passed
  • git diff --check: passed

The repository-wide eyebrowlock baseline drift is not asserted by this PR.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

From aaronjmars:
- Split any 10k-log window, wallets included (v4 PoolManager returns ~29.7k logs in one 30k-block window: 3 splits, 7 calls).
- ERC-721 Transfer shares topic0 with ERC-20: 3 topics = erc20, 4 topics = erc721 (empty data, token id in topics[3]); never call decimals() on erc721.
- docs/community-skill-packs.md: Sentinel Pack row no longer claims onchain-monitor lacks Robinhood Chain.

From Svector-anu:
- Clamp a late robinhood run to 280k blocks (~8h) and log the skipped span; 12h late was ~420k blocks, 15 windows per direction per watch.
- Path C gets the same WebFetch retry as Paths A/B on a non-429 failure.

@aaronjmars aaronjmars left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice follow-up. the #1244 review fixes (8h clamp, erc-721 split, log-limit halving) are good.

2 things before merge:

  1. reorg replay says to drop alerted_tx hashes first seen inside the replay range, but alerted_tx only stores hashes, no block. the agent can't do that. store {hash, block} or drop that line.
  2. the evidence receipt has one chain / chain_id / block_hash, but one run covers every watch across chains. needs one entry per chain (or one receipt per chain).

nit: memory/evidence/ gets a new file every run, forever. add a prune (keep 30 days?).

@sentinelhood

Copy link
Copy Markdown
Contributor Author

Addressed the review points in commit ded2a980:

  • alerted_tx entries now carry {hash, block_number, first_seen} so replay can remove entries inside the reorg window.
  • Evidence receipts use one chains[] entry per chain, with chain-local ranges, sources, counters, and transaction hashes.
  • Added 30-day pruning for evidence receipts.
  • Rebased the follow-up onto current main after docs(ecosystem): drop dead ai2human.io link #1254.

Validation: skill security scan, category check, evidence JSON example parse, and git diff --check pass. The repository pack validator is unavailable here because this checkout has no skills-pack.json; this PR documents a skill contract and does not claim end-to-end runtime execution.

@Svector-anu Svector-anu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran the full local checklist against this branch: check-skill-categories, check-capabilities-parity, validate-config.js, validate-readme-catalog.mjs, generate-skills-json (ci's normalized diff), generate-skill-icons --check, lint-shell.sh, biome ci ., dashboard typecheck. all pass. eyebrowlock.json diff is just this skill's own hash updating, as expected for a skill.md change.

read through the reorg logic, the evidence receipt schema, and the erc-20/erc-721 disambiguation by topic count. internally consistent, atomic state writes, evidence explicitly scoped as an audit trail not a safety verdict. solid follow-up to #1244.

approving.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants