-
Notifications
You must be signed in to change notification settings - Fork 5
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
Re enable OP_CAT
#39
Re enable OP_CAT
#39
Conversation
Oh, I didn't see this PR. Here's what I would expect this to look like: https://github.com/ajtowns/bitcoin/commits/202310-inq25-cat |
@ajtowns thanks for the reference. I'll get the deployment changes included in this branch. |
86ab1b1
to
6a7c8cd
Compare
6a7c8cd
to
54a8c52
Compare
@ajtowns I'm currently working on getting functional tests for CAT. Modeling it after CTV functional tests. Are there any other major pieces missing before this PR can get merged and activated? |
Would be ideal to get some unit tests as well, if possible. Seems like the BIP should get PRed to the bips repo; if it can get assigned a number we can use that in the signet activation path. |
ce04f20
to
b0f3e1f
Compare
Lint is failing again |
b0f3e1f
to
bdadf05
Compare
Thanks! Fixed |
Note: Bip has been added to the bips repo bitcoin/bips#1525 |
@ajtowns Doesn't seem like we're getting a number from Luke anytime soon. How about we use Bip390 for the activation params? |
Nah, picking your own bip numbers is just asking for confusion, and there's a bunch of other proposals similarly stalled. Let's just make our own numbering scheme instead; yours is BIN-2024-0001, so the code snippet will become: ... = SetupDeployment{
.year = 2024, .number = 1, .revision = 0,
.start = ..., .timeout = ...,
}; I think I've translated your doc to markdown accurately, but if I missed something or there's other tweaks needed, make a PR on that repo? |
https://github.com/ajtowns/bitcoin/tree/202401-inq25-opcat is a rough suggestion for updating this PR fwiw |
7de6410
to
b78dd18
Compare
96cbdcf
to
c9984ad
Compare
fb53c52
to
5390a5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to squash these commits so that each commit just has "this is the way we decided to do things" rather than "we tried it this way, then decided to undo that and do it a different way instead" (eg, 81e31f7 introduces opcat_tests.cpp then 81edc01 removes it)
I guess one option would be to merge this for 25.x now so we can get it activated, and do the squash when rebasing to 27.x?
MAX_PUSH_ERROR, | ||
self.nodes[0].sendrawtransaction, | ||
taproot_op_cat_stack_limit_spend.serialize().hex(), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would probably be good to check 520 bytes works and 521 bytes doesn't, rather than just checking 1024 bytes?
Something like "12345678" DUP DUP CAT DUP CAT DUP CAT DUP CAT DUP CAT CAT
for 520 bytes and an additional 1 CAT
for 521 bytes?
(These cases are already checked in test/script_tests.cpp
though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah im considering removing that testcase
Strongly agree on squasing before merge. |
efa0219
to
734f342
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some commit contents/ordering comments. Would probably be better to order as:
- Re-enable OP_CAT
- Add OP_CAT script_tests unittests
- op_cat deployment
- functional tests for OP_CAT
- clean up discourage flags in
validation.cpp
(ie, add the feature without activating; add the tests for the feature; activate it; add the functional tests to check it's activated; cleanup)
Otherwise, lgtm.
src/validation.cpp
Outdated
@@ -1009,9 +1009,12 @@ bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws) | |||
|
|||
const bool ctv_active = DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman, Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY); | |||
const bool apo_active = DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman, Consensus::DEPLOYMENT_ANYPREVOUT); | |||
const bool opcat_active = DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman, Consensus::DEPLOYMENT_OP_CAT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be part of the "op_cat deployment" commit
734f342
to
c7f053c
Compare
@ajtowns |
LGTM, ACK c7f053c . Anyone want to find some last minute bugs and make me look like a clown? |
One very small concern is whether we REALLY need SCRIPT_VERIFY_DISCOURAGE_OP_CAT, or whether DISCOURAGE is needed. This is because flags is uint_32. If SCRIPT_VERIFY_OP_CAT takes the spot 26 and SCRIPT_VERIFY_DISCOURAGE_OP_CAT takes the spot 27, then we only have 28, 29, 30, 31 left. Or, are we planning to make flags uint64_t when we used up all the spots? (This concern should not be a stopper of this PR) |
Actually the question above has been discussed in the club. ^ please ignore that concern, it was for transition. |
c7f053c
to
e51aa64
Compare
Updated 3257a41 to fix this comment #39 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
reACK e51aa64 |
Draft BIP
Basing implementation off Elements PR
Things left todo