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

newaddr: various fixes for msggen and docs #7217

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

daywalker90
Copy link
Contributor

There were various occurences of p2sh-segwit still left in msggen, tests and documentation. So i removed them. I also updated some documentation files to reflect the current state of newaddr.

Is it problematic that the values in message NewaddrResponse changed?

Fixes: #6996
Replaces: #7146

vincenzopalazzo

This comment was marked as off-topic.

.msggen.json Outdated Show resolved Hide resolved
.msggen.json Outdated Show resolved Hide resolved
@daywalker90
Copy link
Contributor Author

So previously when generating cln-rpc's model.rs we would just count from 0 upwards for enum fields and it somehow worked until i start removing fields and want to preserve backward compatibility. Now i added a commit where we lookup .msggen.json for the field numbers for model.rs whenever we can find them. If not we go back to simple counting. Happy to hear your feedback.

@daywalker90
Copy link
Contributor Author

this also found another wrong assigment in GetinfoBindingType btw

@cdecker
Copy link
Member

cdecker commented Apr 14, 2024

Yeah, we haven't removed fields so far, hence we never had a confirmation it'd be assigning stable field numbers. It seems you are hitting a couple of new and untested scenarios. Apologies for not having tried some of these before, and thanks for the incredible help 🙏

@daywalker90
Copy link
Contributor Author

had to add another check for an edge case that would cause problems in #7218

@daywalker90
Copy link
Contributor Author

added explicit numbering of rust enums

Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

I think I found one place where we are still just iterating numbers rather than picking them from the .mssggen.json file in grpc.py, otherwise this is very much good to go 👍

.msggen.json Show resolved Hide resolved
contrib/pyln-testing/pyln/testing/grpc.py Outdated Show resolved Hide resolved
@daywalker90
Copy link
Contributor Author

rebased and fixed

@daywalker90
Copy link
Contributor Author

daywalker90 commented Apr 17, 2024

I think I found one place where we are still just iterating numbers rather than picking them from the .mssggen.json file in grpc.py, otherwise this is very much good to go 👍

Where in grpc.py? enums for node.proto get sorted. For convert.rs sorting should be irrelevant, right?

@cdecker
Copy link
Member

cdecker commented Apr 17, 2024

I think I found one place where we are still just iterating numbers rather than picking them from the .mssggen.json file in grpc.py, otherwise this is very much good to go 👍

Where in grpc.py? enums for node.proto get sorted. For convert.rs sorting should be irrelevant, right?

I meant the 1 that should be a 3 in the previous comment :-)

Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

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

ACK a227b279ba26e3ff0d81a22247a7bdb2f7ea8aae

@@ -330,7 +330,6 @@
"NewaddrAddresstype": {
"all": 2,
"bech32": 0,
"p2sh-segwit": 1,
Copy link
Member

Choose a reason for hiding this comment

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

Technically we could leave these in, as a trace for future reference, so we don't end up reusing the same number for a new enum variant. But I'll merge this as is, since that's out of scope for this PR.

@cdecker cdecker merged commit 507c2de into ElementsProject:master Apr 17, 2024
35 checks passed
@daywalker90 daywalker90 deleted the newaddr-fix branch April 22, 2024 11:38
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.

Unable to generate P2TR address via gRPC
3 participants