Skip to content

test(evm/devnet): pin E2E devnet to solc 0.8.24+cancun (fix V10-UI-Tests)#1403

Open
Bojan131 wants to merge 6 commits into
mainfrom
fix/v10-ui-devnet-solc
Open

test(evm/devnet): pin E2E devnet to solc 0.8.24+cancun (fix V10-UI-Tests)#1403
Bojan131 wants to merge 6 commits into
mainfrom
fix/v10-ui-devnet-solc

Conversation

@Bojan131

@Bojan131 Bojan131 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What

Fixes the V10-UI-Tests pipeline (UNSTABLE on #66/#67/#68). The node-ui Playwright suite boots a throwaway devnet via scripts/devnet.sh, and its hardhat deploy compile was failing — so the devnet never booted and every UI test failed.

Root cause

  • The E2E harness compiles contracts via scripts/devnet.sh → hardhat deploy (see .devnet/hardhat/deploy.log).
  • @openzeppelin/contracts is lockfile-pinned to 5.4.0, whose utils/Bytes.sol emits the mcopy opcode (EIP-5656) and declares pragma ^0.8.24 → needs a ≥0.8.24 solc on the Cancun EVM.
  • With solc 0.8.28 (what CI was bumping to), KnowledgeAssetsLifecycle.sol:1626 hits HH600: stack too deep by 1 slot — a solc 0.8.26 IR-codegen regression. Compiler bisect: 0.8.24 ✅ · 0.8.26 ❌ · 0.8.27 ❌ · 0.8.28 ❌.

Fix — test-infra only, no source/contract changes

  • New packages/evm-module/hardhat.devnet.config.ts: extends the existing config, overriding solc → 0.8.24, evmVersion → cancun, hardfork → cancun, for the disposable E2E devnet only.
  • scripts/devnet.sh: pass --config hardhat.devnet.config.ts to the devnet's hardhat node + hardhat deploy.
  • Production hardhat.node.config.ts (solc 0.8.20 / london) is unchanged → deployed bytecode unaffected.

No .sol files and no application/daemon source are touched.

Verification

This version-controls a fix that was previously a live Jenkins pipeline sed-patch; that ephemeral patch can be dropped once this merges.

🤖 Generated with Claude Code

…sts)

The node-ui Playwright suite boots a throwaway devnet via scripts/devnet.sh,
whose `hardhat deploy` compile failed HH600 "stack too deep by 1 slot" at
KnowledgeAssetsLifecycle.sol:1626. Root cause: @openzeppelin/contracts is
lockfile-pinned to 5.4.0 (utils/Bytes.sol uses mcopy/EIP-5656, pragma ^0.8.24),
forcing a >=0.8.24 solc on Cancun -- and solc 0.8.26-0.8.28 hit an IR-codegen
stack regression at that site. solc 0.8.24 satisfies OZ's ^0.8.24 + mcopy AND
compiles cleanly (bisect: 0.8.24 ok, 0.8.26/0.8.27/0.8.28 fail).

Adds a devnet-only hardhat.devnet.config.ts (solc 0.8.24 + cancun + cancun
hardfork) and points devnet.sh's hardhat node/deploy at it. Production config
(hardhat.node.config.ts, solc 0.8.20/london) is untouched, so deployed bytecode
is unchanged. Version-controls what was previously an ephemeral Jenkins
sed-patch. Test-infra only -- no contract or application source changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread packages/evm-module/hardhat.devnet.config.ts Outdated
Comment thread scripts/devnet.sh Outdated
Comment thread scripts/devnet.sh Outdated
…ompile smoke check, single config path

Addresses all 3 otReviewAgent findings on #1403:

1. Compose, don't mutate: hardhat.devnet.config.ts no longer reaches into the
   imported hardhat.node.config singleton and mutates nested objects through
   casts. It now exports a COMPOSED config built from clones (spread the base,
   clone compilers[0] with version 0.8.24 + evmVersion cancun, clone
   networks.hardhat with hardfork cancun), and asserts its two base-shape
   expectations at load time — if the base ever moves to multiple compilers,
   an overrides-only solidity shape, or drops networks.hardhat, this file
   THROWS with instructions instead of silently retargeting whatever happens
   to sit at compilers[0].

2. Direct validation: scripts/devnet.sh now runs a focused
   `hardhat compile --config "$HARDHAT_CONFIG"` smoke check BEFORE booting the
   node, so a config typo / shape drift / solc-cancun regression fails
   immediately with the compiler's own message (logged to
   $DEVNET_DIR/hardhat/compile.log) instead of surfacing minutes later as an
   opaque UI-e2e boot failure. Hardhat caches compilation, so re-runs cost ~1s.

3. Single config path: the filename is defined once as HARDHAT_CONFIG next to
   the other devnet constants and reused by both the node and deploy commands,
   making the must-stay-on-the-same-config coupling explicit.

Verified: `hardhat compile --config hardhat.devnet.config.ts` with the new
composed config compiles all 101 Solidity files successfully (evm target:
cancun); bash -n clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@otReviewAgent otReviewAgent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Agent completed this review and found no issues.

@Jurij89

Jurij89 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Adversarial review summary (config / CI / devnet artifacts)

I reviewed the PR patch against the current CI/devnet flow. The core devnet wiring looks sound: scripts/devnet.sh now compiles, runs the Hardhat node, and deploys with hardhat.devnet.config.ts, and that config keeps the base settings while pinning devnet to solc 0.8.24 + Cancun.

Findings:

  • [P2] CI still precompiles the wrong Hardhat config. .github/workflows/ci.yml:591-592 still runs pnpm --filter @origintrail-official/dkg-evm-module exec hardhat compile, and the nearby comments still say devnet.sh uses the default config. The real devnet path now compiles with --config $HARDHAT_CONFIG in scripts/devnet.sh:162, with the compiler/hardfork pin in packages/evm-module/hardhat.devnet.config.ts:59-67. This means the dedicated CI warm-up step no longer validates or warms the compiler path the Playwright devnet actually uses, so a devnet-config regression moves back into webServer boot. I would switch that step to hardhat compile --config hardhat.devnet.config.ts or remove/reword it if the webServer-owned compile is intentional.

  • [P3] The devnet-only config inherits the normal Hardhat cache and artifacts paths from packages/evm-module/hardhat.node.config.ts:122-126. Because devnet now always compiles solc 0.8.24 / Cancun bytecode, local tools can see devnet build-info/artifacts after a UI-test boot. Consider isolating devnet paths, for example cache-devnet / artifacts-devnet, if developers or CI reuse the same checkout for non-devnet Hardhat work.

No other blocker found in the core fix.

…tReviewAgent #1403 P2/P3)

P2 — CI warmed the wrong config. The "Compile EVM contracts (for the devnet
boot)" step ran `hardhat compile` with the DEFAULT config (solc 0.8.20/london),
but this PR made devnet.sh compile + boot with `--config hardhat.devnet.config.ts`
(solc 0.8.24/cancun). So the dedicated warm-up validated bytecode the Playwright
devnet never uses, and a devnet-config regression would surface inside the
webServer boot instead of the localized step. The step (and its stale comment)
now compile with `--config hardhat.devnet.config.ts`.

P3 — devnet artifacts no longer pollute production ones. hardhat.devnet.config.ts
inherited the base `paths`, so its 0.8.24/cancun compile wrote build-info +
artifacts into the shared `./cache` / `./artifacts`; a later non-devnet hardhat
task in the same checkout could then pick up foreign bytecode. The devnet config
now redirects only cache/artifacts to `./cache-devnet` / `./artifacts-devnet`
(sources/tests/deploy roots unchanged), and .gitignore covers the new dirs.

Verified: `hardhat compile --config hardhat.devnet.config.ts` compiles all 101
files (evm target: cancun) and writes to the isolated devnet dirs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Bojan131

Bojan131 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — both valid, both fixed in f87b65156.

✅ P2 — CI warmed the wrong config (fixed)

Confirmed: the "Compile EVM contracts (for the devnet boot)" step ran hardhat compile with the default config (solc 0.8.20/london), and its comment still said devnet.sh uses the default config — stale after this PR switched devnet.sh to --config hardhat.devnet.config.ts (0.8.24/cancun). So the warm-up compiled bytecode the Playwright devnet never uses, and a devnet-config regression would've surfaced inside the webServer boot instead of the localized step. The step + comment now compile with --config hardhat.devnet.config.ts, matching the real devnet path. Verified it compiles all 101 files on the cancun target.

✅ P3 — devnet artifacts no longer pollute production ones (fixed)

Right — the devnet config inherited the base paths, so its 0.8.24/cancun build-info + artifacts landed in the shared ./cache / ./artifacts. It now redirects only cache/artifacts to ./cache-devnet / ./artifacts-devnet (sources/tests/deploy roots unchanged, so nothing else moves), and .gitignore covers the new dirs. Verified: the devnet compile writes to the isolated dirs and leaves the production ./artifacts untouched. Both the CI warm-up (P2) and devnet.sh's compile+deploy use the same config, so they share the isolated paths consistently.

The `Kosava: node-ui e2e (Playwright real-node devnet)` lane was red on a
racy assertion in `wm-swm-vm-ui-cycle.devnet.spec.ts` (UI-driven WM→SWM
migration on the SHARED seeded devnet CG) that timed out even after 2
retries, and the whole lane ran ~11m. Per the ask: keep the basics, drop
the heavy/flaky, ship green + faster.

Removed the 4 heavy, async, on-chain / soak specs (the flakiness + runtime
source):
  - wm-swm-vm-ui-cycle       — flaky UI migration on a shared CG; its
                               coverage is redundant with the API sibling,
                               and its publish step was already `fixme`.
  - wm-swm-vm-lifecycle      — on-chain KA mint (slow; 207-partial prone).
  - conviction-publishing    — destructive CG-wide `clearAfter` + on-chain.
  - messaging-ownership-extended — 30s inter-node "soak" window.

Kept the fast, deterministic API/UI smoke (the basics):
  - mcp-tools            — status / identity / CG list / SPARQL / manifest.
  - publishing-lifecycle — UI loads real CGs, operations view, WM create.
  - cg-variants          — nodes expose CGs, WM create, roles, UI listing.
  - messaging-ownership  — node reachable, peers, sessions, participants.

Basic messaging is still covered by messaging-ownership; the API-driven
publish surfaces remain exercised by the cli/publisher unit + integration
suites. Net: no more shared-CG async races in this lane, and a shorter run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml
Comment thread packages/evm-module/hardhat.devnet.config.ts
# Conflicts:
#	packages/node-ui/e2e/specs/devnet/conviction-publishing.devnet.spec.ts
#	packages/node-ui/e2e/specs/devnet/wm-swm-vm-lifecycle.devnet.spec.ts
Comment thread packages/evm-module/hardhat.devnet.config.ts
# Conflicts:
#	packages/node-ui/e2e/specs/devnet/conviction-publishing.devnet.spec.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants