Skip to content

fix(antelope): ABI safety, table evidence, indexed lookups, arbitrary layouts, viz#667

Open
j76823284-hash wants to merge 3 commits into
tirth8205:mainfrom
j76823284-hash:antelope/correctness-pass
Open

fix(antelope): ABI safety, table evidence, indexed lookups, arbitrary layouts, viz#667
j76823284-hash wants to merge 3 commits into
tirth8205:mainfrom
j76823284-hash:antelope/correctness-pass

Conversation

@j76823284-hash

Copy link
Copy Markdown

Summary

Correctness + scalability pass on the Antelope contract support ahead of merge.

  • ABI object/version validation (crash fix). .abi files are now routed to a dedicated antelope_abi parser that validates the top-level is a JSON object before any .get(). A JSON array (the Solidity/Ethereum ABI shape) previously reached .get() and crashed parsing; it is now skipped safely. Non-string version, plain JSON objects, and malformed JSON are all skipped without producing nodes.
  • Tightened table evidence. table_schema is now tagged only on a real TABLE macro declaration in the same file (tree-sitter parses TABLE account {...} as a function named TABLE). Ordinary helper methods (primary_key/by_*) on plain C++ objects no longer become phantom tables.
  • Indexed graph queries (no full-graph scan). Dead-code detection no longer rescans the filesystem per node. _antelope_is_runtime_symbol(store, node) reads the antelope_kind tag already stored in the DB — O(1) per node, scales to large repos.
  • Arbitrary contract layouts. Dropped the hard /contracts/ path requirement; contracts are detected by positive runtime signals (ACTION/TABLE/multi_index/on_notify) anywhere in the tree.
  • Visualization includes dapp action edges + antelope surfaces. Added CALLS_ACTION (color, dashed style, arrow marker, legend) and dedicated Action/Table/Contract node kinds to both D3 templates.
  • Whitelist metadata, don't dump every extra field. node_to_dict/edge_to_dict now emit only a curated subset (antelope_kind, antelope_runtime, antelope_version, abi_action, abi_table, notebook_format, message_type for nodes; antelope, runtime for edges), preventing large internal payloads from leaking into the exported graph.

Test plan

  • 16 new unit tests (ABI parsing safety, table evidence, layout independence, indexed dead-code lookup, metadata whitelist) — all passing.
  • Full suite: 1977 passed, 0 failed, 79.25% coverage (≥65% required). Ruff clean on all changed source files.
  • mypy and bandit run in CI (not installed in the local venv, so not executed here).

Notes

  • Includes the original "model Antelope contract runtime surfaces" feature commit (894ef8c) rebased onto current origin/main (resolved conflicts in parser.py, graph.py, and the test files).
  • One rebase-regression fix is folded in: the bare-endpoint resolver's CALLS_ACTION handling now selects the kind column for all edge kinds.

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.

1 participant