Skip to content

hpdevkit:0.6.5-beta image requires NPM v0.6.8 — older packages cause state directory deletion #40

@rippleitinnz

Description

@rippleitinnz

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 hpdevkit

Verify the update:

hpdevkit version

Additional Notes

  • NPM v0.6.8 correctly passes DISPARATE_DIR=disparate to 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 the disparate directory feature entirely

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions