mirror of
https://github.com/TelegramMessenger/tgcalls.git
synced 2026-11-18 21:35:28 +00:00
Replaces 10.0.0-pump/11.0.0-pump with two production versions so a server-side A/B can compare substrates: 18.0.0 runs the call core natively, 19.0.0 runs the same source as a wasm module embedded in the binary. One class declares both, so they share the Instance shell and CallCoreHost verbatim and differ only in which backend CallCoreHost constructs — that is what makes the comparison attributable to the substrate and nothing else. Substrate is derived from the negotiated version string rather than from configuration, so neither an app-side nor a server-side mistake can put a 19.0.0 call on the native core and quietly corrupt the A/B. WamrCoreBackend gains a bytes constructor and now has one load path with two ways of filling _moduleBytes: the module linked into the binary (EmbeddedCoreModule.h, generated by the parent repo's genrule), or a file. The file loader and customParameters.wasm_core_path exist only under TGCALLS_ALLOW_EXTERNAL_WASM_CORE, set on the CLI target alone: that key arrives from the server, so shipping it would be a remote-code-execution surface — WAMR bounds the module's memory, but the module drives negotiation and signaling through its host imports. With no filesystem-loading code linked in, the shipped binary can only execute bytes linked into it. V1 signaling framing is deleted. Both shipped versions are wire 11.0.0, so the V1 reliability layer (seq flag bits, message packing, acks, resends, service packets) was unreachable and unexercised; V2 needs none of it because the transport underneath is reliable, exactly as in stock. Gone with it: the wireVersion config field, the service-timer wiring and sendSignalingKeepalive hook, VariantCallCore's keepalive demo, and tools/parity/p2_framing.py. The C ABI is unchanged — set_timer/timer remain, used by the stats tick — so no version bump. The reference module shrinks 92741 -> 82162 bytes. Validated on the CLI: P1 offer/answer MATCH for 18-vs-stock, 19-vs-stock and 18-vs-19; W1-W4, W7-W8 and NR1-NR3 all exit 0 including both 30% drop / 50-200ms delay rows; a corrupt module fails the call (caller Failed, exit 1) with no fallback to native; the variant module still loads via --wasm-core. Squashed from 4 commits.