mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
Drop github.com/luxfi/codec from the atomic-tx subsystem and replace the reflection-based polymorphic registry with a hand-rolled binary encoder. Type IDs preserved from the legacy linearcodec registration order (UnsignedImportTx=0, UnsignedExportTx=1, TransferInput=5, TransferOutput=7, secp256k1fx.Credential=9) so on-disk blobs and p2p gossip framing stay byte-equal to legacy. New atomic.Manager interface mirrors the message.Manager pattern shipped in Wave 1C — Marshal/Unmarshal only, no reflection registry. The atomic.Codec singleton is the only Manager exported from the package; downstream code (state/, vm/, sync/atomic, tests/warp, plugin/evm/vm.go, plugin/evm/network_handler.go) holds an atomic.Manager (or message.Manager for the wire codec) instead of the legacy codec.Manager. Tx.Sign drops its codec.Manager argument and uses the package-local atomic.Codec singleton. A new Tx.initializeBytes(c Manager) helper re-marshals a freshly-unmarshaled tx through whatever Manager produced the bytes — keeps the atomictest harness disjoint from production Codec while round-tripping correctly. sync/atomic.Summary picks up its own marshal/unmarshal (4 fixed fields, no codec needed) so plugin/evm/message doesn't have to know about syncable summary shape. The secp256k1fx.VM contract still requires codec.Registry — extracted to a new plugin/evm/secpfx/ adapter so the only remaining codec dependency in the atomic-tx universe lives outside plugin/evm/atomic/. Tests pass: plugin/evm/atomic/..., sync/atomic/..., tests/warp/...