mirror of
https://github.com/luxfi/coreth.git
synced 2026-10-30 17:00:51 +00:00
F102 wired the chain-wide ChainSecurityProfile into the P-Chain and X-Chain VM factories at node bootstrap, but the C-Chain (coreth) plugin loads via the rpcchainvm transport in a separate process and never received the profile. Under strict-PQ with ForbidECDSAWallets the EVM mempool continued to admit legacy ECDSA-signed transactions. This change propagates the profile across the plugin boundary inside the JSON config bytes that already cross it on every chain Initialize: - plugin/evm/config/config.go adds LuxSecurityProfilePin (profileID + profileHashHex). The legacy LuxStrictPQ bool is retained for one release as a fallback path. - plugin/evm/vm.go calls installSecurityProfile() during Initialize. Resolve runs ProfileByID(profileID) → Validate → ComputeHash and constant-time-compares against the pinned hash. A forked binary that swapped canonical profile content fails the compare and the VM refuses to start. Adds VM.SecurityProfile() accessor. - plugin/evm/eth_gossiper.go threads the resolved profile into GossipEthTxPool via NewGossipEthTxPoolWithProfile. When ForbidECDSAWallets is true, Add refuses every Ethereum tx type (Legacy / AccessList / DynamicFee / Blob / SetCode) with ErrClassicalTxForbidden — they are all secp256k1-signed and there is no PQAuthTx type yet. - Precompile gate (ecrecover at 0x01) now derives from the resolved profile's ForbidECDSAContractAuth bit rather than the bool. Six F118 tests: - TestCorethVM_ReceivesSecurityProfile — Initialize with the pin resolves the canonical LuxStrictPQ, exposes it via VM.SecurityProfile(), and wires the precompile gate. - TestCorethVM_RefusesProfileHashMismatch — pinned hash that does not match the live canonical content fails Initialize. - TestCorethVM_RefusesECDSATxUnderStrictPQ — GossipEthTxPool.Add returns ErrClassicalTxForbidden under strict-PQ. - TestCorethVM_AcceptsClassicalTxUnderClassicalCompat — symmetric path: nil profile reaches the mempool admission code (no short-circuit). - TestCorethVM_RefusesEveryClassicalTxType — Legacy / AccessList / DynamicFee all rejected. - TestCorethVM_AcceptsMLDSATxUnderStrictPQ — forward-compat stub documenting the gate contract until a PQAuthTx type lands. go.mod bumps consensus v1.22.84 → v1.23.9 to pick up the canonical ChainSecurityProfile types (added in v1.23.x). All transitive deps are tidy.