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

msggen: fix walk through nested json schemas #7218

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

daywalker90
Copy link
Contributor

I finally found (what i suspected in the first place) the bug in msggen where it wasn't walking through the if's correctly (you may have noticed the weird "x doesn't have a type" logs.

Fixes: #7185 #5345 #5354
Replaces: #7210

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.

Looks good, but I'd like the if statement to be clarified a bit, as the precedence of the conditions is not clear, and left-to-right order is even a tautology.

contrib/msggen/msggen/model.py Outdated Show resolved Hide resolved
@daywalker90
Copy link
Contributor Author

daywalker90 commented Apr 14, 2024

need #7217 merged first

I had to merge some arrays so it got more complicated :/

@daywalker90 daywalker90 force-pushed the msggen-fix-walk-nested branch 2 times, most recently from 1227d9a to 4da2e18 Compare April 14, 2024 23:04
@daywalker90
Copy link
Contributor Author

daywalker90 commented Apr 14, 2024

I WILL BRING ORDER TO THIS AAAAHHH

I'm honestly not sure why i lost the deterministic ordering of the fields of all the generated code but now its nice and sorted.

@daywalker90
Copy link
Contributor Author

bip340sig is now String type in rust and .proto, same as signature

@daywalker90

This comment was marked as resolved.

@daywalker90

This comment was marked as resolved.

@daywalker90

This comment was marked as resolved.

@daywalker90
Copy link
Contributor Author

We derived the i32 from rust enums implicitly by their order in the enum. I added explicit numbers in #7217 so the sorting doesn't mess anything up.

Btw if we ever delete an "open" enum field in *.proto with 0 it's going to be trouble. They must start with a field that is 0. But that's for a future PR.

@cdecker
Copy link
Member

cdecker commented Apr 17, 2024

Btw if we ever delete an "open" enum field in *.proto with 0 it's going to be trouble. They must start with a field that is 0. But that's for a future PR.

We might want to keep dummy placeholders in there once we do. But we'll cross that bridge once we get to it.

I don't fully understand why sorting is required here, does it have to do with the iteration through nested fields? Otherwise it feels strange to have enums not be in numeric order, but no real issue, I'm just curious :-)

@daywalker90
Copy link
Contributor Author

Yes when merging the arrays that were previously not collected we would get enums in node.proto that were out of order. And protoc wants them to start at 0. The ordering of enums in the rust files could be removed eagain after the explicit enum values were added. I don't remember exactly why i sorted those to be honest. Want me to check that out?

@daywalker90
Copy link
Contributor Author

rebased and rust model enums sorted by number not name

@cdecker
Copy link
Member

cdecker commented Apr 17, 2024

Rebased on top of master after merging #7217, and merging as soon as it passes CI (the previous CI failure was a flake).

@daywalker90
Copy link
Contributor Author

i have a bunch more coming but i wait until this and #7230 is merged

@cdecker cdecker self-requested a review April 18, 2024 16:16
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 c93d955

@cdecker cdecker merged commit ada4de1 into ElementsProject:master Apr 18, 2024
35 checks passed
@daywalker90 daywalker90 deleted the msggen-fix-walk-nested branch April 22, 2024 11:39
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.

schema: listnodes option_will_fund doesn't have a type
2 participants