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

Add missing Clarity3 functions #1692

Merged
merged 6 commits into from
Jan 23, 2025
Merged

Conversation

wileyj
Copy link
Contributor

@wileyj wileyj commented Jan 17, 2025

ref: https://github.com/stacks-network/stacks-core/actions/runs/12835755981

this adds the missing clarity3 functions from the stacks-core broken workflow.

@wileyj wileyj requested a review from a team as a code owner January 17, 2025 22:07
@wileyj wileyj requested a review from obycode January 17, 2025 22:08
@obycode
Copy link
Contributor

obycode commented Jan 17, 2025

There are some other changes/additions needed for Clarity 3 / epoch 3:

  • get-block-info? (updates)
  • block-height (updates)
  • stacks-block-height (new)
  • tenure-height (new)

@wileyj
Copy link
Contributor Author

wileyj commented Jan 18, 2025

hmm. I'll take another look but those ones weren't generated.
i stand corrected - i see them now. will adjust and have a new commit to address.

i also think there is a way to automate this (i.e. in the open docs pr workflow), it'll just take a little massaging of the output.

@wileyj
Copy link
Contributor Author

wileyj commented Jan 20, 2025

  • get-block-info?

903a29e

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple minor issues. While you're in here, can you also remove the warnings on stacks-block-height and tenure-height?

reference/functions.md Outdated Show resolved Hide resolved
reference/keywords.md Outdated Show resolved Hide resolved
@wileyj
Copy link
Contributor Author

wileyj commented Jan 22, 2025

unrelated to this PR - but i think we can automate this process easier than i originally thought. i have some ideas i'll take a a look at it soon.

@wileyj
Copy link
Contributor Author

wileyj commented Jan 22, 2025

stacks-block-height

c309da9

@@ -1311,7 +1313,7 @@ Introduced in: **Clarity 3**
The `get-stacks-block-info?` function fetches data for a block of the given *Stacks* block height. The value and type returned are determined by the specified `StacksBlockInfoPropertyName`. If the provided `stacks-block-height` does not correspond to an existing block prior to the current block, the function returns `none`. The currently available property names are as follows:

- `id-header-hash`: This property returns a `(buff 32)` value containing the _index block hash_ of a Stacks block. This hash is globally unique, and is derived from the block hash and the history of accepted PoX operations. This is also the block hash value you would pass into `(at-block)`.
- `header-hash`: This property returns a `(buff 32)` value containing the header hash of a Stacks block, given a Stacks chain height. **WARNING** this hash is not guaranteed to be globally unique, since the same Stacks block can be mined in different PoX forks. If you need global uniqueness, you should use `id-header-hash`.
- `header-hash`: This property returns a `(buff 32)` value containing the header hash of a Stacks block, given a Stacks chain height.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one is okay to leave. There is one that should be removed in stacks-block-height.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@wileyj wileyj merged commit 7076344 into master Jan 23, 2025
6 checks passed
@wileyj wileyj deleted the chore/update_clarity_ref_1737149263 branch January 23, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants