Mediums batch 2 - #224
Closed
lordbutterfly-hive wants to merge 1 commit into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR — go-vsc-node: MED fix batch (gateway/wasm/oracle/runtime/dids/keystore) + ecrecover host-import HIGH + EVM-bridge devnet test suite
37 files changed = 21 (5 MED commits) + 16 new devnet test/helper files.
Title
fix(go-vsc): register crypto.ecrecover_strict/canonical host imports (un-brick contract ecrecover, HIGH) + 22 review6 MEDs across gateway/wasm/oracle/runtime/dids/keystore + EVM-bridge devnet test suite
⚠ THE HIGH — DS-RE-1: contract ecrecover host imports were never registered
df295dc1— The account-mapping + zk contracts importcrypto.ecrecover_strict(withdrawals) andcrypto.ecrecover_canonical(deposits), but go-vsc never registered these host functions. On a realgc.customWASM build the contract bricks on every ecrecover path. It was masked locally because the!gc.customSDK stub delegatesstrict→plain. FIXED: both host imports registered inmodules/wasm/runtime_ipc/wasm.go;strictrejects high-S (malleability),canonicalnormalizes — both empirically verified against go-ethereum. This is the cross-repo lynchpin: deploy this host BEFORE any contract WASM that imports them (see Deploy Order) or the contract bricks on instantiate.MED findings closed (22 numbered + round hardening)
gateway/p2p —
7e9ab539db_test.go's database growing to unbounded size during tests. #6ValidateMessage: switch/default to drop junk message types instead of processing them.sign_responsemade relay-safe.ParseMessagenow propagates the JSON error instead of swallowing it.electionPeerIDsrebuilt everyACTION_INTERVALrather than only on epoch change — stale peer set fix.gateway/multisig —
7e9ab539bhMudata-race guard aroundstoreBh/loadBh.Version0_2_0Active(fixes the MED-56 co-fire race; see also R2-6c below).waitForSigs.waitCheckBhreplaces a busy-wait.wasm/sdk + host —
7e9ab539, round3/5sp1_verify_groth16_exhost fn.system.callpanic rendering, gated onSdkErrorDeterminismVersion {0,2,0}.contracts.read_exreturning anexistsbool._initializeresult and aborts withWASM_INIT_ERRORwhen the gate is active; gated onWasmInitGuardVersion {0,3,0}; threaded viaWasmInitGuardCtxKeythroughtransactions.go,execution-context.go(WithInitGuard), and the GQL simulate path;currentConsensus2→3.oracle —
7e9ab539, round3relayDedupStorepersistence interface (loadDedup/storeDedup/clearDedup);prunedRecoveryBudget20s +prunedRecoveryPerPeerPolls=7; Warn on full-channel sig drop.Version0_2_0Active.verifyEthHeaderChainguards a typed-nil*ethChainDatabefore any field deref (a typed nil satisfies the interface assertion but panics on.ParentHash).runtime —
7e9ab539, round2/3/4IsSupportedAt()version-gates runtime acceptance at create/update AND at the call site (transactions.go, beforew.Execute) so a contract record with an invalid runtime inserted directly into Mongo yields a deterministic tx-level failure on all nodes instead of reaching theExecutedefault-case panic.Executedefault branch: explicitly-commented unreachable-assertion panic with the determinism rationale (the generic signature can't buildresult.Err[Result]; zero-valueResult[T]hasIsOk()==truewhich would mask a wiring regression — so panic, but documented as provably-unreachable sinceIsSupportedAtgates create/update).SimulateContractCallsnow addsWithTryCatchgated onTryCatchICCVersion, matching the four options the on-chain path sets (WithPendulumApplier,WithTryCatch,WithSdkErrorDeterminism,WithInitGuard) — Simulate was missingWithTryCatch, diverging from on-chain ICC try-semantics.assertIntervalDivisibilitystrengthened to require strict orderingACTION_INTERVAL < ROTATION_INTERVAL < SYNC_INTERVAL(equal intervals pass divisibility but permanently starve actions — reintroduces MED-56).dids —
7e9ab539EthDID.Verifylength guard (65 bytes) before indexingsigBytes[64](panic-on-malformed-sig fix).keystore —
7e9ab539os.Chmod(tssKeysDir, 0700)afterflatfs.CreateOrOpen— TSS key dir perms.CONSENSUS-VERSION GATING — review this carefully (determinism)
The fixes that change on-chain behavior are version-gated so nodes stay in lockstep until activation:
Version0_2_0Activegates: fix: node crash via empty required_auths in Hive custom_json #114 oracle relay/witness, Contract test util state diff, update contract #56 BlockTick scheduling.SdkErrorDeterminismVersion {0,2,0}gates: Fix/oracle deadlock #92 deterministic system.call panic.WasmInitGuardVersion {0,3,0}gates: Feat/onchain gossip readiness v2 #130 init-guard (currentConsensus2→3).TryCatchICCVersiongates: R2-5 simulateWithTryCatch.Reviewer: confirm no behavior-changing fix is ungated, and that the gating versions match the intended activation height.
EVM-BRIDGE DEVNET TEST SUITE (16 new files — this is the integration proof for THIS PR and the account-mapping PR)
Real 5-node docker devnet + anvil L1.
tests/devnet/:evm_anvil.go(anvil + MPT tx/receipt-trie proofs),evm_l2_sign.go(evm-DID L2 signing),evm_bot.go(bot runner),evm_bridge_setup.go(shared harness: deploy + wire mock verifier + RC bootstrap + deployWithRetry), and the waves:evm_bridge_w1""HIGH fix.evm_bridge_w2evm_bridge_w3evm_bridge_zkevm_bridge_w6negevm_bridge_botres"h"scan-height fix (see PR3); LastScannedBlock 0→74.evm_bridge_both"h"contract↔bot mismatch finding.All green; full regression re-swept (W1/W2/W3/ZK/W6Neg PASS). Status:
/mnt/o/MED-FIX-2026-06-19/devnet-results/STATUS-DEVNET.md.DEPLOY ORDER (mandatory — cross-repo coupling)
med/gv-develop, ecrecover_strict/canonical imports) BEFORE any contract WASM that imports them, or the contract bricks on instantiate.Reviewer guide
runtime_ipc/wasm.go, strict rejects high-S, canonical normalizes.NOTE — branch base
med/gv-developis 5 commits ahead oforigin/develop. If you want a tests-only or fixes-only split, say so; as-is the branch carries both the 5 MED commits and the devnet suite → one PR todevelop.Hygiene
LF line endings (verified). No
.wasm/binaries staged. TODO before merge: 3 devnet test files (evm_bridge_w0/wmock/zk) hardcode a local/home/clauderfly/...WASM path — being parameterized to an env var w/ default (does not affect CI logic, but shouldn't ship a machine path).