-
Notifications
You must be signed in to change notification settings - Fork 1
hpdevkit:0.6.5-beta image requires NPM v0.6.8 — older packages cause state directory deletion #40
Description
Summary
When using HP_DEVKIT_IMAGE=evernode/hpdevkit:0.6.5-beta with an
older hpdevkit NPM package (below v0.6.8), contracts fail to deploy
with the following error on every ledger:
Contract process chdir failed.
[err][hpc] Consensus contract execution failed.
[err][hpc] Error occured when closing ledger
Root Cause
The beta devkit image introduced a new disparate directory feature
to support multisig deployments. The cluster script expects
DISPARATE_DIR to be set as an environment variable.
NPM packages below v0.6.8 do not pass DISPARATE_DIR, leaving
$disparate_dir as an empty string in the cluster script. This
causes the following line in sync_instance to evaluate against the
state directory itself:
[ -d $contract_dir/contract_fs/seed/state/ ] && rm -r $contract_dir/contract_fs/seed/state/The state directory always exists (the contract bundle was just
copied into it), so it gets deleted immediately — leaving HotPocket
with no contract to execute.
Affected Versions
| NPM Version | Beta Image | Result |
|---|---|---|
| v0.6.4 and below | 0.6.5-beta | ❌ chdir failed |
| v0.6.8 | 0.6.5-beta | ✅ Working |
Fix
Update the hpdevkit NPM package to v0.6.8:
sudo npm install -g hpdevkitVerify the update:
hpdevkit versionAdditional Notes
- NPM v0.6.8 correctly passes
DISPARATE_DIR=disparateto the
cluster script - A defensive code fix has been raised as a PR to guard against this
scenario in future regardless of NPM version - The stable devkit (
evernodedev/hpdevkit) was never affected as
it predates thedisparatedirectory feature entirely