mirror of
https://github.com/luxfi/node.git
synced 2026-07-29 08:36:26 +00:00
fix(rpcchainvm): compat shim for pre-rename plugin env-var
The EngineAddressKey const renamed from LUX_VM_RUNTIME_ENGINE_ADDR to
VM_RUNTIME_ENGINE_ADDR in 4ae211d46d (2026-05-15). luxd builds from
that commit forward set VM_RUNTIME_ENGINE_ADDR on plugin exec, but the
EVM plugin (luxfi/evm@v0.8.40 → luxfi/node@v1.23.4 → "LUX_VM_..." const)
in the same Docker image still os.Getenv("LUX_VM_...") — empty string,
no dial back, plugin exits, C-chain never bootstraps, all L2 EVMs stay
un-bootstrapped indefinitely on v1.27.x.
Set BOTH env keys until every plugin in /data/plugins has been rebuilt
against a luxfi/node version that has the rename. New const is the
canonical name; legacy const is the compat key (added as
LegacyEngineAddressKey and only emitted when it differs from the new
key, so once luxfi/evm bumps past the rename the extra env var becomes
a no-op and this line can be deleted without runtime impact).
This commit is contained in:
@@ -13,6 +13,12 @@ const (
|
||||
// Address of the runtime engine server.
|
||||
EngineAddressKey = "VM_RUNTIME_ENGINE_ADDR"
|
||||
|
||||
// LegacyEngineAddressKey is the pre-rename env-var name. Plugin binaries
|
||||
// compiled against luxfi/node <= v1.26.x read this key. The host sets
|
||||
// both keys until every plugin in /data/plugins has been rebuilt against
|
||||
// a luxfi/node version that has the rename.
|
||||
LegacyEngineAddressKey = "LUX_VM_RUNTIME_ENGINE_ADDR"
|
||||
|
||||
// Duration before handshake timeout during bootstrap.
|
||||
DefaultHandshakeTimeout = 5 * time.Second
|
||||
|
||||
|
||||
@@ -49,6 +49,15 @@ func Bootstrap(
|
||||
cmd.Env = os.Environ()
|
||||
}
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", runtime.EngineAddressKey, serverAddr.String()))
|
||||
// Compat shim: also set the pre-rename env key so plugin binaries built
|
||||
// against luxfi/node <= v1.26.x (which had EngineAddressKey =
|
||||
// "LUX_VM_RUNTIME_ENGINE_ADDR") can still dial back. Plugins built from
|
||||
// luxfi/node >= the rename pick up the new key; old plugins keep working.
|
||||
// Remove this line once every plugin in /data/plugins is rebuilt against
|
||||
// a luxfi/node version that has the rename.
|
||||
if runtime.EngineAddressKey != runtime.LegacyEngineAddressKey {
|
||||
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", runtime.LegacyEngineAddressKey, serverAddr.String()))
|
||||
}
|
||||
|
||||
stdoutPipe, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user