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

[PoX-4] Match function signature for extend methods #4230

Closed
janniks opened this issue Jan 4, 2024 · 8 comments
Closed

[PoX-4] Match function signature for extend methods #4230

janniks opened this issue Jan 4, 2024 · 8 comments

Comments

@janniks
Copy link
Contributor

janniks commented Jan 4, 2024

Currently (next branch at time of writing), the methods: stack-extend and delegate-stack-extend have slightly differing signatures, even though they overlap in arguments a lot.
Additionally, all other signer-key accepting stacking methods have the signer-key as their last argument.

(define-public (stack-extend (extend-count uint)
(pox-addr { version: (buff 1), hashbytes: (buff 32) })
(signer-key (buff 33)))

(define-public (delegate-stack-extend
(stacker principal)
(pox-addr { version: (buff 1), hashbytes: (buff 32) })
(signer-key (buff 33))
(extend-count uint))

Might this be a good time to change the delegate-stack-extend signature (argument ordering)? Since, with the pox-4 update users will have to revisit any breaking code already.

to e.g.

(define-public (delegate-stack-extend
                    (stacker principal)
                    (extend-count uint)
                    (pox-addr { version: (buff 1), hashbytes: (buff 32) })
                    (signer-key (buff 33)))

CC @friedger

Haven't found anything exact on this in the SIPs, but I might be missing something.

@friedger
Copy link
Collaborator

friedger commented Jan 4, 2024

The proposed change makes sense to me. Let's do it. @setzeus

@setzeus
Copy link
Collaborator

setzeus commented Jan 5, 2024

ACK. I don't see any reason we can't do this & indeed remember coming across the different order, thanks for the note @janniks.

Edit*** discussed w/ Jude below.

@setzeus setzeus self-assigned this Jan 5, 2024
@jcnelson
Copy link
Member

jcnelson commented Jan 8, 2024

Hi, we don't know who out there would be affected by a change to the public API signature, so we can't assess what the fallout would be of changing the arguments. If you feel really strongly about the aesthetics, then please add a separate public function that just calls this one (but don't change the existing one).

@janniks
Copy link
Contributor Author

janniks commented Jan 8, 2024

This would only be changing the signatures, which are already being changed from pox-3 → pox-4 (i.e. adding the signer-key argument), so I'm assuming nobody depends on the public API signature yet. And folks who update their code from pox-3 to pox-4, could switch two args (in addition to adding the signer-key arg (which they likely are already looking up how to do).

@jcnelson
Copy link
Member

jcnelson commented Jan 8, 2024 via email

@friedger
Copy link
Collaborator

friedger commented Jan 8, 2024

Developers/users need to change the signature already when switching to pox-4. The api is not yet released in one way or the other.

The change is about quality of code/mental load, not aesthetics

@janniks
Copy link
Contributor Author

janniks commented Jan 23, 2024

Partially closed by #4279 -- I'm fine to close, at least signer-key will be consistently last. The other params I'm okay with keeping the same as pox-3 -- Feel free to reopen if someone feels strongly about the remaining param order.

@janniks janniks closed this as completed Jan 23, 2024
@github-project-automation github-project-automation bot moved this from Status: 🆕 New to Status: ✅ Done in Stacks Core Eng Jan 23, 2024
@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 Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

5 participants