fix: repair fresh npm install + document that local forking is unsupported - #4
Open
Equious wants to merge 1 commit into
Open
fix: repair fresh npm install + document that local forking is unsupported#4Equious wants to merge 1 commit into
Equious wants to merge 1 commit into
Conversation
…l forking is unsupported The committed package-lock.json pinned @cyfrin/battlechain-lib-js to a local tarball (file:../battlechain-lib/.../cyfrin-battlechain-lib-js-1.0.0.tgz) left over from local development against a sibling monorepo checkout. A fresh clone has no such file, so `npm install` fails with ENOENT — the README's first step is broken. Repoint that single lockfile entry to the npm registry (same version 1.0.0). The 1.0.0 -> 1.1.x bump is left to Dependabot under the repo's 7-day cooldown, since all newer versions are <7 days old. Also correct the local-forking docs: BATTLECHAIN_FORK / `just node-fork` cannot work. BattleChain is a ZKsync OS rollup whose RPC prunes historical state (~last 30 blocks) and does not implement eth_getProof, so Hardhat/EDR cannot fork it (forked contracts read back as empty code; bcDeploy fails with a BAD_DATA "0x" decode). Document why and point users to the live testnet flow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Two independent issues, both surfaced while validating the template against the restructured
battlechain-lib.1. Fresh
npm installfails (lockfile points at a local tarball)package-lock.jsonresolved@cyfrin/battlechain-lib-jsto:a path to a sibling monorepo checkout + an
npm packartifact from the author's machine. A fresh clone has neither, sonpm installfails withENOENT— the README's first instruction is dead on arrival. (package.jsonand.github/dependabot.ymlare both registry-oriented, so this was a stale dev artifact in the lockfile, not the intended distribution mechanism.)Fix: repoint that single lockfile entry to the npm registry, same version
1.0.0. Verified withnpm ci(installs from registry, integrity validated). The1.0.0 → 1.1.xbump is deliberately left to Dependabot: all published1.1.xversions are <7 days old, inside this repo's 7-day cooldown, so adopting one now would violate that policy.2. Local forking can't work on BattleChain — document it
BATTLECHAIN_FORK=1/just node-forkproduce a crypticbcDeployfailure:Root cause: BattleChain is a ZKsync OS rollup, and its RPC can't serve what Hardhat/EDR forking needs:
eth_getCodeat the pinned fork block returns empty), andeth_getProofis unsupported ("different storage layout than Ethereum").So every forked contract reads back as empty code. No hardfork/chainType setting fixes it — it's a property of the chain. This PR replaces the misleading "forking makes contracts reachable" comment/README section with an accurate explanation and points users to the live-testnet flow (
--network battlechain).Diff
package-lock.json— 2 lines (local tarball → registry, same1.0.0)hardhat.config.ts— accurate comment on theBATTLECHAIN_FORKbranchREADME.md— rewrite "Local development" section + TOC anchor🤖 Generated with Claude Code