DG-VDT: Dynamic Graph-Guided Reinforcement Learning for Low-Latency Vulnerability Detection and Attack Traceability in Ethereum Smart Contracts
Shiman Sun, Wenbao JiangEthereum hosts more than 50 million deployed contracts, and cumulative losses from contract exploits exceed three billion US dollars, making automated detection and attacker attribution a practical priority. Existing tool-augmented language models and reward-driven reinforcement learning reason over transaction text or a single graph view; they infer maliciousness from superficial topology and degrade when applied to attacks whose traces lack it. This article presents DG-VDT, a reinforcement-learning framework in which tool-centric rewards are replaced by graph-structured feedback derived directly from Ethereum Virtual Machine execution traces. Each trace is decomposed into three complementary graphs (fund flow, contract creation, and contract call), and a dual-stage reward first credits embedding similarity to a canonical attack signature, then enforces exact subgraph-isomorphism matching, with a smooth curriculum governing the transition. The framework is scoped to three structurally distinct vulnerability classes: reentrancy, short-address attack, and timestamp dependence. Zero-shot evaluation on two author-independent public corpora yields 87.7% macro-F1 on SolidiFI-Bench and 84.0% (95% confidence interval 83.4–84.7) on SmartBugs Wild, exceeding fine-tuned GPT-4o by 6.8 and 6.3 points at 180 ms per trace on a single consumer graphics card. Ablation attributes 13.9 macro-F1 points to the multi-graph representation. Extension beyond the three evaluated classes remains future work.