fix(stacking): add pox-5 support for Epoch 4.0 hard fork#412
Open
arc0btc wants to merge 1 commit into
Open
Conversation
stacks-core 4.0.1 activates pox-5 in place of pox-4. StackingService hardcoded pox-4 for stack-stx/stack-extend/stack-increase/delegate-stx/ revoke-delegate-stx/get-stacker-info, which will fail post-activation. Add a POX_5 contract constant (same boot-contract address as pox-4, following the pox-2/3/4 pattern) and resolve the active PoX contract dynamically at call time via the node's /v2/pox contract_id, falling back to the static POX_5 address if that lookup fails. This avoids another hardcoded-version cliff on the next PoX bump.
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.
Summary
StackingServicehardcodedPOX_4forstack-stx,stack-extend,stack-increase,delegate-stx,revoke-delegate-stx, andget-stacker-info— these will fail/no-op against an inactive contract post-activation.POX_5contract constant (src/lib/config/contracts.ts, mainnet + testnet, same boot-contract address as pox-4 following the pox-2/3/4 pattern).StackingServicenow resolves the active PoX contract dynamically at call time via the node's/v2/poxcontract_idfield, falling back to the staticPOX_5constant if that lookup fails — avoids hardcoding either version and future-proofs against the next PoX bump.Investigation: stackspot.app pot contracts (read-only, no code change)
Checked the deployed
Genesispot contract (SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.Genesis, used byskills/stacks-stackspot) via Hiro's contract-source endpoint:This pot contract hardcodes
pox-4and callsallow-contract-caller, a function pox-5 removes entirely. Since it's already-deployed, immutable Clarity code, this can't be patched — stackspot.app would need to deploy a new pot contract against pox-5. This repo's code can't fix that; filing a follow-up to watch for stackspot.app's migration and pause stackspot auto-join if it doesn't land before activation.Test plan
bun run typecheckpasses cleanNote: not urgent — hard-fork activation height has not been reached yet per stacks-core 4.0.1 release notes, but this should land before activation to avoid silent stacking failures.