Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Stacks 2.1] The /v2/pox endpoint never switches to PoX-2 #3262

Closed
zone117x opened this issue Aug 24, 2022 · 4 comments
Closed

[Stacks 2.1] The /v2/pox endpoint never switches to PoX-2 #3262

zone117x opened this issue Aug 24, 2022 · 4 comments
Labels

Comments

@zone117x
Copy link
Member

When running with the latest next branch, the GET /v2/pox endpoint always returns {"contract_id":"ST000000000000000000002AMW42H.pox"} regardless of the epoch or cycle.

The expected behavior is that this should return {"contract_id":"ST000000000000000000002AMW42H.pox-2"} when ready after the 2.1 epoch.

@zone117x
Copy link
Member Author

As a related question: is checking for pox-2 in the will GET /v2/pox response the best way for clients to determine if PoX-2 stacking contract-calls should be made?

As in, what is the recommended approach to determining if Period 3 has activated, as described in https://github.com/stacksgov/sips/blob/c0fb33e0fc2b62e8e6d4ed85fb4b4aa289bb6042/sips/sip-015/sip-015-network-upgrade.md#specification

Right now, it seems like the work-around for clients is something like:

async function isPoX2Ready(): Promise<boolean> {
  const req = await fetch(`/v2/data_var/ST000000000000000000002AMW42H/pox-2/configured?proof=0`);
  const body = await req.text();
  if (req.ok) {
    return JSON.parse(body)['data'] === '0x03'; // Clarity boolean-true
  } else if (req.status === 404 && body === 'Data var not found') {
    return false;
  } else {
    throw new Error(`Unexpected response: ${req.status} - ${body}`);
  }
}

@jcnelson
Copy link
Member

This code simply hasn't been written yet.

@zone117x
Copy link
Member Author

zone117x commented Oct 3, 2022

This was fixed in #3278

@zone117x zone117x closed this as completed Oct 3, 2022
@blockstack-devops
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants