Commit e75e546
refactor: make Context generic over DB, remove FallbackFns vtable
- Remove FallbackFns C-style vtable and InMemoryDB.fallback field
- Make Context generic: Context(comptime DB: type); DefaultContext = Context(InMemoryDB)
- Add Journal(DB) tracking wrappers guarded by @hasDecl (snapshotFrame, commitFrame,
revertFrame, commitTracking, discardTracking, notifyStorageSlotCommit,
hasNonZeroStorageForAddress, untrackAddress, forceTrackAddress)
- Replace Host.ctx with type-erased JournalVTable (18 entries); Host.init(DB, ctx, prec)
and Host.fromCtx(ctx, prec) constructors; opcode handlers unchanged
- Make Evm generic: EvmFor(comptime DB: type); Evm = EvmFor(InMemoryDB) alias
- Make MainnetHandler.* functions accept anytype evm for zero-cost duck typing
- Fix getDb() dangling pointer: change self: @this() → self: *const @this()
- Update test files to use Host.fromCtx() instead of Host{ .ctx = ... } literal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent cb63379 commit e75e546
File tree
21 files changed
+1246
-1222
lines changed- examples
- src
- context
- database
- handler
- inspector
- interpreter
- opcodes
- spec_test
21 files changed
+1246
-1222
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments